shahabaejaz / sshtunnel

Automatically exported from code.google.com/p/sshtunnel
GNU General Public License v3.0
0 stars 0 forks source link

Global proxy not working in Android Lollipop 5.0 #193

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
Attempt to connect using SSHTunnel in Android Lollipop using a Nexus 5. Stock 
ROM, rooted with SuperSU

What is the expected output? What do you see instead?
After successfully connecting with SSHTunnel, I opened the web browser and went 
to ifconfig.me to view my IP address. Expected IP address did not match SSH 
host, but was my current (routable) wifi address

What version of the product are you using? On what operating system?
1.5.6 on Android Lollipop 5.0 stock OTA ROM, rooted with SuperSU on a Nexus 5

Please provide any additional information below.
I/ActivityManager(  778): Start proc org.sshtunnel for activity 
org.sshtunnel/.SSHTunnel: pid=19960 uid=10090 gids={50090, 9997, 3003, 1028} 
abi=armeabi-v7a
I/ActivityManager(  778): START u0 {act=android.intent.action.MAIN 
cat=[android.intent.category.LAUNCHER] flg=0x10200000 
cmp=org.sshtunnel/.SSHTunnel (has extras)} from uid 10019 on display 0
D/SSHTunnel(19960): Service Start
D/SSHTunnel(19960): id=7, name=AlphaTunnel, host=xxx.yyy.org, port=22, 
local_port=1984, remote_address=127.0.0.1, remote_port=3128, isSocks=true
D/SSHTunnel(19960): Connecting start
D/SSHTunnel(19960): error: only position independent executables (PIE) are 
supported.
D/SSHTunnel(19960): /data/data/org.sshtunnel/iptables -t nat -D OUTPUT -p udp 
--dport 54 -j REDIRECT --to 8154
D/SSHTunnel(19960): Host does not support 'Public key' authentication.
D/SSHTunnel(19960): Authenticate with password
E/SSHTunnel(19960): Forward Successful
D/SSHTunnel(19960): /data/data/org.sshtunnel/proxy_socks.sh start 1984
D/SSHTunnel(19960): /data/data/org.sshtunnel/iptables -t nat -N SSHTUNNEL
D/SSHTunnel(19960): /data/data/org.sshtunnel/iptables -t nat -F SSHTUNNEL
D/SSHTunnel(19960): /data/data/org.sshtunnel/iptables -t nat -N SSHTUNNELDNS
D/SSHTunnel(19960): /data/data/org.sshtunnel/iptables -t nat -F SSHTUNNELDNS
D/SSHTunnel(19960): /data/data/org.sshtunnel/iptables -t nat -A SSHTUNNELDNS -p 
udp --dport 53 -j REDIRECT --to 39235
D/SSHTunnel(19960): /data/data/org.sshtunnel/iptables -t nat -A OUTPUT -p udp 
-j SSHTUNNELDNS
D/SSHTunnel(19960): /data/data/org.sshtunnel/iptables -t nat -A SSHTUNNEL -p 
tcp ! -d zzz.zzz.zzz.zzz --dport 80 -j REDIRECT --to 8123
D/SSHTunnel(19960): /data/data/org.sshtunnel/iptables -t nat -A SSHTUNNEL -p 
tcp ! -d zzz.zzz.zzz.zzz --dport 443 -j REDIRECT --to 8123
D/SSHTunnel(19960): /data/data/org.sshtunnel/iptables -t nat -A SSHTUNNEL -p 
tcp --dport 5228 -j REDIRECT --to 8123
D/SSHTunnel(19960): /data/data/org.sshtunnel/iptables -t nat -A OUTPUT -p tcp 
-j SSHTUNNEL
D/SSHTunnel(19960): Connecting finish
E/SSHTunnel(19960): IO Exception
E/SSHTunnel(19960): java.net.SocketException: Socket closed
E/SSHTunnel(19960):     at libcore.io.Posix.recvfromBytes(Native Method)
E/SSHTunnel(19960):     at libcore.io.Posix.recvfrom(Posix.java:161)
E/SSHTunnel(19960):     at libcore.io.BlockGuardOs.recvfrom(BlockGuardOs.java:250)
E/SSHTunnel(19960):     at libcore.io.IoBridge.recvfrom(IoBridge.java:553)
E/SSHTunnel(19960):     at 
java.net.PlainDatagramSocketImpl.doRecv(PlainDatagramSocketImpl.java:163)
E/SSHTunnel(19960):     at 
java.net.PlainDatagramSocketImpl.receive(PlainDatagramSocketImpl.java:171)
E/SSHTunnel(19960):     at java.net.DatagramSocket.receive(DatagramSocket.java:274)
E/SSHTunnel(19960):     at org.sshtunnel.DNSServer.run(DNSServer.java:533)
E/SSHTunnel(19960):     at java.lang.Thread.run(Thread.java:818)
D/SSHTunnel(19960): DNS try to stop service
I/SSHTunnel(19960): DNS Stopped
D/SSHTunnel(19960): /data/data/org.sshtunnel/iptables -t nat -F SSHTUNNEL
D/SSHTunnel(19960): /data/data/org.sshtunnel/iptables -t nat -X SSHTUNNEL
D/SSHTunnel(19960): /data/data/org.sshtunnel/iptables -t nat -F SSHTUNNELDNS
D/SSHTunnel(19960): /data/data/org.sshtunnel/iptables -t nat -X SSHTUNNELDNS
D/SSHTunnel(19960): /data/data/org.sshtunnel/iptables -t nat -D OUTPUT -p udp 
-j SSHTUNNELDNS
D/SSHTunnel(19960): /data/data/org.sshtunnel/iptables -t nat -D OUTPUT -p tcp 
-j SSHTUNNEL
D/SSHTunnel(19960): Connection Lost
D/SSHTunnel(19960): /data/data/org.sshtunnel/proxy_socks.sh stop

Original issue reported on code.google.com by peng...@gmail.com on 20 Nov 2014 at 4:23

GoogleCodeExporter commented 9 years ago
I'm also having this issue. Noticed that some other apps using iptables don't 
work properly too.

Original comment by va...@aleksensky.com on 15 Dec 2014 at 10:10

GoogleCodeExporter commented 9 years ago
Is it me? or it's not just Global Proxy.  But everything else simply failed to 
work, regardless if it's individual proxy, global proxy, or "GFW" (Great 
Firewall of China) proxy (which never worked for me at first place.

I am also running stock Android on Nexus 5 root with SuperSU, nothing more, not 
even customized recovery.

Any pointer on how to provide more information is much appreciated.  thanks in 
advance

Original comment by kngh...@gmail.com on 5 Jan 2015 at 7:30

GoogleCodeExporter commented 9 years ago
Observing the same issue. Also running stock Android on Nexus 5 root with 
SuperSU.

Original comment by ian.dah...@gmail.com on 9 Feb 2015 at 3:46

Attachments:

GoogleCodeExporter commented 9 years ago
Same issue for me on Moto G (falcon) running Android 5.0.2 cm12 nightly.

Original comment by till.fis...@gmail.com on 10 Feb 2015 at 5:55

GoogleCodeExporter commented 9 years ago
Confirmed here as well, its not just this app too I have been unable to get any 
ssh app to redirect traffic through tunnel since the 5.0 update. Doesn't appear 
the sev is really interested in supporting this since there hasn't been an 
update in months.

Original comment by vdomingu...@gmail.com on 20 Feb 2015 at 11:46

GoogleCodeExporter commented 9 years ago
Same problem with LG G3 and SSHTunnel. But no problems with ConnectBot + 
ProxyDroid.

Original comment by gibuspe...@googlemail.com on 17 Mar 2015 at 7:23

GoogleCodeExporter commented 9 years ago
Same as #6, LG G3 F460K, I'm using ConnectBot + ProxyDroid for now, thanks for 
the info.

Original comment by tommy.w...@gmail.com on 30 Mar 2015 at 2:42

GoogleCodeExporter commented 9 years ago
Same issue here can't browsing through ssh tunnel apps

Original comment by fadli....@gmail.com on 21 Apr 2015 at 12:40

GoogleCodeExporter commented 9 years ago
Is there any chance SSHTuneel works on Lollipop in near future.
I'm using ConnectBot + ProxyDroid but it's not so stylish as SSHTuneel ;)

Original comment by joseaca...@gmail.com on 22 Apr 2015 at 12:35

GoogleCodeExporter commented 9 years ago
i fixed a bug on dnsserver it could may be help this issue
check issue 200

Original comment by pro.ali....@gmail.com on 23 Apr 2015 at 6:02

GoogleCodeExporter commented 9 years ago
Hello,

There is a fix in xda for PIE error, check this 
http://forum.xda-developers.com/google-nexus-5/development/fix-bypassing-pie-sec
urity-check-t2797731

You have just to flash the zip on recovery but read carefuly the thread, not 
all devices are compatible.

it worked on my galaxy express 2 and i can use ssh tunnel on cm12.1  5.1.1

hope it's help.

Original comment by averelst...@googlemail.com on 22 May 2015 at 3:44

GoogleCodeExporter commented 9 years ago
I modded the apk and replaced the iptables and redsocks with the one inside 
proxydroid

Can be found here: 
https://mega.co.nz/#!bdFlDapC!EIwUNQoCg4WC3f8qKAvnIU2xyj1aSHOv4LErN2pTFPw

As the main problem is due to PIE error:
error: only position independent executables (PIE) are supported.

If you want to mod the apk yourself:

- get both proxydroid apk and sshtunnel apk
- open both apk with winrar 
- copy redsocks and iptables from proxydroid apk /assets/api-16/ to sshtunnel 
apk /assets/ 
- zipalign the apk 
- signapk

Original comment by devunder...@gmail.com on 8 Jun 2015 at 9:21

Attachments:

GoogleCodeExporter commented 9 years ago
post #12 actually works for me.
Lollipop 5.0.2

Original comment by marhe...@gmail.com on 12 Jun 2015 at 12:45

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Steps described in post #12 works for me
Lollipop 5.0 - Nexus 5

Original comment by ril...@gmail.com on 11 Jul 2015 at 7:40

GoogleCodeExporter commented 9 years ago
I use redsocks for another application with the same problem.
I then extracted the redsocks from the APK
The problem is that this version don't include redudp.
Can "devunder..." author of post #12 recompile with redudp support ?
or tell me how to do it ? 
I don't have linux...

Original comment by mail.thi...@gmail.com on 20 Jul 2015 at 4:31

GoogleCodeExporter commented 9 years ago
#12 apk worked for me as well.  Much thanks devunder ...

Original comment by patrice....@gmail.com on 11 Aug 2015 at 9:05