Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port Tunneling/Forwarding similar to rdp2tcp #935

Closed
karlmdavis opened this issue Jan 30, 2013 · 28 comments
Labels
Milestone

Comments

@karlmdavis
Copy link

@karlmdavis karlmdavis commented Jan 30, 2013

There's an old plugin/patch for rdesktop: http://rdp2tcp.sourceforge.net/. This provided support for tunneling/forwarding TCP connections over the RDP virtual channel protocol. This is analogous to SSH port forwarding (https://help.ubuntu.com/community/SSH/OpenSSH/PortForwarding).

This would be a very useful feature for freerdp. Any chance of someone porting/recreating this functionality?

@Shumen

This comment has been minimized.

Copy link

@Shumen Shumen commented Feb 24, 2013

this feature can be implemented as a plugin based on channels/sample/client.

@bmiklautz

This comment has been minimized.

Copy link
Member

@bmiklautz bmiklautz commented Jun 17, 2013

@karlmdavis this feature requires as @Shumen mentioned a extra virtual channel on the client and on the server side. rdp2tcp can be used for the server side but a rdp2tcp compatible client channel would still be required for freerdp. As far as I know there are no plans to support this in the near future but I'll leave the issue open as feature request.

@HackFisher

This comment has been minimized.

Copy link

@HackFisher HackFisher commented Nov 22, 2013

I also think that the rdp2tcp feature very useful.

@fred922

This comment has been minimized.

Copy link

@fred922 fred922 commented Jul 10, 2015

would be great to have this supported in FreeRDP.

@meanbunny

This comment has been minimized.

Copy link

@meanbunny meanbunny commented Jul 10, 2015

Oh I would love this! I am doing Android development with an emulator running on my host taking advantage of the Intel HAXM. The VM I remote into is a local one setup as a guest in qemu. If I could port forward ports like ssh then I would be golden. Right now I have a putty profile that starts up on login to the machine via FreeRDP

@ArturZaprzala

This comment has been minimized.

Copy link

@ArturZaprzala ArturZaprzala commented Dec 10, 2015

rdesktop client doesn't have Network Level Authentication, so I was forced to add rdp2tcp support to FreeRDP.

Here is rdp2tcp channel plugin for FreeRDP and a patch for rdp2tcp-0.1 fixing some important bugs:
freerdp.patch.txt
rdp2tcp.patch.txt

I also created a spec file to cleanly build and install rdp2tcp RPM in Fedora:
rdp2tcp.spec.txt

If someone has time and will to integrate this into FreeRDP, feel free to modify my patches as necessary.

TODO

I named the plugin rdp2tcp, but a more generic name is welcome (net, forward, socket, ...). Currently TCP and SOCKS is implemented, but someone could implement also Unix sockets, UDP, TUN/TAP.

rdp2tcp is run as a separate process on the client side (such a design resulted from license incompatibility between rdesktop and rdp2tcp) and server side. Maybe the client side could be built into FreeRDP plugin.

@hardening

This comment has been minimized.

Copy link
Contributor

@hardening hardening commented Dec 10, 2015

@ArturZaprzala your patches look interesting, anyway doing a pull request would be a better way to hope to have them upstream. Some remarks about the patch:

  • it gives the copyright to Marc-André Moreau, not sure that's expected;
  • you don't check for ret < 0 et errno == EINTR when read()ing
@ArturZaprzala

This comment has been minimized.

Copy link

@ArturZaprzala ArturZaprzala commented Dec 10, 2015

I am aware that this patches might not be ready for upstream and making them ready requires some more time, which I don't currently have. I just wanted to share my work early with the community. Surely many people want this feature.

If someone is interested and have the time, please help to improve, clean up and merge the patches upstream.

@ChaosEternal

This comment has been minimized.

Copy link

@ChaosEternal ChaosEternal commented Apr 14, 2017

@ArturZaprzala maybe a brief howto is required. great thanks.

@ArturZaprzala

This comment has been minimized.

Copy link

@ArturZaprzala ArturZaprzala commented Apr 14, 2017

Here is a source RPM with my latest patch ready to build on Fedora Linux 25:
freerdp-2.0.0-14.20170217git842a8c5.fc25.src.rpm.zip

@Mirro888

This comment has been minimized.

Copy link

@Mirro888 Mirro888 commented Jun 26, 2017

@ArturZaprzala - FreeRDP can be compiled nicely with Visual C++. However, the freerdp.patch.txt uses Unix specific stuff like unistd.h, uio.h. Could create a patch that compiles with Visual C++?
Thanks a lot.

@ArturZaprzala

This comment has been minimized.

Copy link

@ArturZaprzala ArturZaprzala commented Jun 30, 2017

@Mirro888

This comment has been minimized.

Copy link

@Mirro888 Mirro888 commented Jul 1, 2017

@ArturZaprzala - thanks for the prompt response.
Has anyone managed to cross-compile FreeRDP with rdp2tcp patches using mingw for Windows? I've spent days on playing with mingw, but without success. Could you share successfull procedure? Thanks a lot.

@bmiklautz

This comment has been minimized.

Copy link
Member

@bmiklautz bmiklautz commented Jul 3, 2017

@Mirro888 We don't "support" (at least we don't test) mingw as FreeRDP compiles natively on Windows.

@Mirro888

This comment has been minimized.

Copy link

@Mirro888 Mirro888 commented Jul 21, 2017

@ArturZaprzala - I tried to compile your RPM, but I failed. Could you apply your patch to the latest version of freeRDP and post the patched freeRDP source code? Thank you very much.

@arch4ngel

This comment has been minimized.

Copy link

@arch4ngel arch4ngel commented Aug 1, 2017

@ArturZaprzala - I hate to res this thread on you again but I'm failing to build the provided rpm as well.
I am likely overlooking something in translation from RPM to compiling from source (admittedly, I'm a C noob).

Feel free to request more information if desired.

Here are a few bullets describing my environment and the observed behavior:

  • Compilation is taking place on a Debian based distribution (Linux ***** 4.9.0-kali4-amd64 1 SMP Debian 4.9.30-2kali1 (2017-06-22) x86_64 GNU/Linux)
  • All patches apply successfully via patch -p[relevant number] < [relevant patch file]
  • Cmake succeeds via cmake .
  • Compilation via make fails at 96%

Here is relevant output from make:

.....
Scanning dependencies of target generate_argument_docbook
[ 96%] Building C object client/X11/CMakeFiles/generate_argument_docbook.dir/generate_argument_docbook.c.o
[ 96%] Linking C executable generate_argument_docbook
../common/libfreerdp-client2.so.2.0.0: undefined reference to `rdp2tcp_VirtualChannelEntry'
collect2: error: ld returned 1 exit status
client/X11/CMakeFiles/generate_argument_docbook.dir/build.make:97: recipe for target 'client/X11/generate_argument_docbook' failed
make[2]: *** [client/X11/generate_argument_docbook] Error 1
CMakeFiles/Makefile2:3217: recipe for target 'client/X11/CMakeFiles/generate_argument_docbook.dir/all' failed
make[1]: *** [client/X11/CMakeFiles/generate_argument_docbook.dir/all] Error 2
Makefile:149: recipe for target 'all' failed
make: *** [all] Error 2
@hardening

This comment has been minimized.

Copy link
Contributor

@hardening hardening commented Aug 2, 2017

I feel like this discussion is totally offtopic for this project

@arch4ngel

This comment has been minimized.

Copy link

@arch4ngel arch4ngel commented Aug 2, 2017

I feel the same honestly @hardening but I'm not sure where would be more appropriate since there isn't a repo specifically for the patched version. Should I just create one and give credit to @ArturZaprzala?

shaddybaddah pushed a commit to shaddybaddah/FreeRDP that referenced this issue Aug 7, 2017
add rdp2tcp support to freerdp.
shaddybaddah pushed a commit to shaddybaddah/FreeRDP that referenced this issue Aug 7, 2017
add rdp2tcp support to freerdp.
@akallabeth akallabeth modified the milestones: 2.0-rc1, 2.0-rc2 Nov 23, 2017
@AnatomicJC

This comment has been minimized.

Copy link

@AnatomicJC AnatomicJC commented Jan 17, 2018

@arch4ngel did you manage to build the provided RPM by @ArturZaprzala ? I tried myself and got same error than you at the 96% step.
I tried to build the sb/rdp2tcp from @ArturZaprzala repo without success too :(

@bmiklautz bmiklautz removed this from the 2.0-rc2 milestone Feb 13, 2018
@VVD

This comment has been minimized.

Copy link

@VVD VVD commented Apr 24, 2018

Must have feature!!!

@ximex

This comment has been minimized.

Copy link

@ximex ximex commented Aug 20, 2018

cmake .
make
sudo make install

works for me on Kubuntu 18.04 from https://github.com/shaddybaddah/FreeRDP/tree/sb/rdp2tcp

But where did i get the rdp2tcp.exe?

Edit:
Ok to get it compiled from source i have to change the compiler from i586-mingw32msvc-gcc to i686-w64-mingw32-gcc in server/Makefile.mingw32

@xychix

This comment has been minimized.

Copy link

@xychix xychix commented Apr 4, 2019

rdesktop client doesn't have Network Level Authentication, so I was forced to add rdp2tcp support to FreeRDP.

Here is rdp2tcp channel plugin for FreeRDP and a patch for rdp2tcp-0.1 fixing some important bugs:
freerdp.patch.txt
rdp2tcp.patch.txt

I also created a spec file to cleanly build and install rdp2tcp RPM in Fedora:
rdp2tcp.spec.txt

If someone has time and will to integrate this into FreeRDP, feel free to modify my patches as necessary.

TODO

I named the plugin rdp2tcp, but a more generic name is welcome (net, forward, socket, ...). Currently TCP and SOCKS is implemented, but someone could implement also Unix sockets, UDP, TUN/TAP.

rdp2tcp is run as a separate process on the client side (such a design resulted from license incompatibility between rdesktop and rdp2tcp) and server side. Maybe the client side could be built into FreeRDP plugin.

does anyone still know the extact freerdp version this was for? Doesn't seem to patch in with 1.1.0-beta-2013071101

@widgetii

This comment has been minimized.

Copy link
Contributor

@widgetii widgetii commented Apr 12, 2019

@ArturZaprzala

This comment has been minimized.

Copy link

@ArturZaprzala ArturZaprzala commented Apr 12, 2019

Here are my latest patches for freerdp-2.0.0-47.rc4.fc29.src.rpm and rdp2tcp-0.1: rdp2tcp-20181203.zip.
FreeRDP patch is using winpr API now.

@widgetii

This comment has been minimized.

Copy link
Contributor

@widgetii widgetii commented Apr 16, 2019

@ArturZaprzala

I tried to build FreeRDP rc4 version with your last patch and got error:

FAILED: client/X11/xfreerdp 
: && /usr/bin/cc -fPIC -Wall -Wno-unused-result -Wno-unused-but-set-variable -Wno-deprecated-declarations -fvisibility=hidden -Wimplicit-function-declaration -Wredundant-decls -DWINPR_DLL -O3 -DNDEBUG  -rdynamic client/X11/CMakeFiles/xfreerdp-client.dir/xf_gdi.c.o client/X11/CMakeFiles/xfreerdp-client.dir/xf_gfx.c.o client/X11/CMakeFiles/xfreerdp-client.dir/xf_rail.c.o client/X11/CMakeFiles/xfreerdp-client.dir/xf_tsmf.c.o client/X11/CMakeFiles/xfreerdp-client.dir/xf_input.c.o client/X11/CMakeFiles/xfreerdp-client.dir/xf_event.c.o client/X11/CMakeFiles/xfreerdp-client.dir/xf_floatbar.c.o client/X11/CMakeFiles/xfreerdp-client.dir/xf_channels.c.o client/X11/CMakeFiles/xfreerdp-client.dir/xf_cliprdr.c.o client/X11/CMakeFiles/xfreerdp-client.dir/xf_monitor.c.o client/X11/CMakeFiles/xfreerdp-client.dir/xf_disp.c.o client/X11/CMakeFiles/xfreerdp-client.dir/xf_graphics.c.o client/X11/CMakeFiles/xfreerdp-client.dir/xf_keyboard.c.o client/X11/CMakeFiles/xfreerdp-client.dir/xf_video.c.o client/X11/CMakeFiles/xfreerdp-client.dir/xf_window.c.o client/X11/CMakeFiles/xfreerdp-client.dir/xf_client.c.o client/X11/CMakeFiles/xfreerdp-client.dir/cli/xfreerdp.c.o  -o client/X11/xfreerdp  -Wl,-rpath,/home/dima/git/FreeRDP/Debug/client/common:/home/dima/git/FreeRDP/Debug/libfreerdp:/home/dima/git/FreeRDP/Debug/winpr/libwinpr: -lX11 -lXinerama -lXext -lXcursor -lXv -lXi -lXrender -lXrandr -lXfixes client/common/libfreerdp-client2.so.2.0.0 libfreerdp/libfreerdp2.so.2.0.0 -lm -lrt winpr/libwinpr/libwinpr2.so.2.0.0 && :
/usr/bin/ld: client/common/libfreerdp-client2.so.2.0.0: undefined reference to `rdp2tcp_VirtualChannelEntryEx'

Similar linking error on Mac. With rdp2tcp patch everything is ok

@shaddybaddah

This comment has been minimized.

Copy link

@shaddybaddah shaddybaddah commented Jun 27, 2019

Hi. I find the rdp2tcp feature invaluable. That's why I forked the old code and tried to keep it current. Unfortunately I found it too difficult to port to freerdp2, despite an initial push. I never returned to it. If I can help though, I will. I'm keen to regain this function.

@widgetii

This comment has been minimized.

Copy link
Contributor

@widgetii widgetii commented Jul 9, 2019

Arthur's patch with help of FreeRDP contributors was merged into master. Please test and give a feedback

@H8to

This comment has been minimized.

Copy link

@H8to H8to commented Oct 28, 2019

@widgetii I tested the socks proxy functionality with the nightly build 2.0.0-dev5 (ab2b288) which was built from the package freerdp-git from Arch Linux AUR and can confirm that it works for my quick test cases (requesting sites through the RDP server). Great work. I might come back if any errors occur.

@akallabeth akallabeth added this to the 2.0.0 milestone Oct 28, 2019
@akallabeth akallabeth closed this Oct 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
You can’t perform that action at this time.