rohithgrandhi / droidsshd

Automatically exported from code.google.com/p/droidsshd
0 stars 0 forks source link

SSH Dynamic Port Forwarding not Working #20

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. Use an SSH client (such as PuTTY for Windows) to configure an SSH connection 
to the Android device to perform dynamic port forwarding using any port (such 
as 1080).
2. Enable logging for the client used to establish the SSH connection.
3. Establish an SSH connection with the device (either via USB/adb with port 
forwarding, or via one of the Android device's network adapters).
4. Configure an Internet application (such as a web browser) to use the SOCKS 
port configured in step 1.
5. Attempt connecting to the Internet with the application (i.e. visit a 
webpage, if you're using a web browser).

What is the expected output? What do you see instead?

Expected output is for the application configured to use the SOCKS proxy to 
successfully make connection to the Internet.  In the case of a web browser, it 
is expected the browser would render the page.  

If you review the SSH client log, for each Internet connection attempt made via 
the dynamic SOCKS port, you will see the error "Forwarded connection refused by 
server"

What version of the product are you using? On what operating system?

v0.6 of the DroidSSH APK.  Successfully connected to the Android device with 
PuTTY for Windows, configured it to connect with dynamic port forwarding on 
port 1080, configured Google Chrome to use a SOCKS proxy on port 1080.  PuTTY 
Event Log shows the forwarding errors.  Host system is running Windows XP SP3.

Original issue reported on code.google.com by jsie...@gmail.com on 18 Oct 2011 at 3:11

GoogleCodeExporter commented 9 years ago
Error is: Forwarded connection refused by server: Unknown channel type []

It's a build issue. Replacing the dropbear binary with another one from XDA 
works.

2012-06-30 11:12:25 Opening forwarded connection to xx.xx.xx.xx:990

Original comment by nathan.r...@gmail.com on 30 Jun 2012 at 10:14

GoogleCodeExporter commented 9 years ago
Just checked the patches, forwarding was disabled in the builds. And currently 
I can't build one with it enabled as none of my toolchains are working.

Original comment by nathan.r...@gmail.com on 30 Jun 2012 at 4:31

GoogleCodeExporter commented 9 years ago
I just did my own build of the latest official release of dropbear according to 
the instructions on the wiki page. It's version 2012.55 compiled with Sourcery 
2012.03 (GCC 4.6.3), but the directions and the patches are still good. I 
applied the changes in the old patches manually, and I didn't have any trouble 
finding the changes.

Yes, TCP forwarding is toggled in options.h in the dropbear source tree root. 
The droidsshd patch only makes some minor changes to build settings, but one of 
them is to comment out the lines for port forwarding (ex. #define 
ENABLE_CLI_LOCALTCPFWD). Probably a security thing.

The attached file is a drop-in replacement (after you change permissions, of 
course) for /data/data/br.com.bott.droidsshd/files/bin/dropbearmulti. The 
sftp-server binary I found elsewhere on this site still works. YMMV.

Original comment by yood...@gmail.com on 1 Jul 2012 at 7:36

Attachments:

GoogleCodeExporter commented 9 years ago
Just tried that, and port forwarding is apparently still disabled.

2012-07-01 14:00:02 Opening forwarded connection to checkip.dyndns.com:80
2012-07-01 14:00:02 Forwarded connection refused by server: Connect failed []

Original comment by nathan.r...@gmail.com on 1 Jul 2012 at 1:03

GoogleCodeExporter commented 9 years ago
Got mine built. Tested and working.

MD5:
cfa34eb2ecb6127af93b9c5d3ce40fff *dropbearmulti

Original comment by nathan.r...@gmail.com on 2 Jul 2012 at 9:42

Attachments:

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Nathan , what have  you changed in patches to make forward work ? I am trying 
to build my own server from latest dropbear version. I can apply patches 
(simple changes) but still can not find the line that disable dynamic 
forwarding...

Original comment by salatiel...@gmail.com on 6 Nov 2012 at 4:38

GoogleCodeExporter commented 9 years ago
I have both:
#define ENABLE_CLI_LOCALTCPFWD
#define ENABLE_CLI_REMOTETCPFWD
#define ENABLE_SVR_LOCALTCPFWD
#define ENABLE_SVR_REMOTETCPFWD
uncommented in options.h and i still can not make it work :/

Original comment by salatiel...@gmail.com on 6 Nov 2012 at 4:44

GoogleCodeExporter commented 9 years ago
#define ENABLE_CLI_LOCALTCPFWD
#define ENABLE_CLI_REMOTETCPFWD

#define ENABLE_SVR_LOCALTCPFWD
#define ENABLE_SVR_REMOTETCPFWD

Uncomment those in options.h
My attached one was built from dropbear 2012.55.

Original comment by nathan.r...@gmail.com on 6 Nov 2012 at 4:46

GoogleCodeExporter commented 9 years ago
I already done that ! (i think)
Could you please take a look in my options.h. I think it should be working.

Original comment by salatiel...@gmail.com on 6 Nov 2012 at 4:55

Attachments: