Terminal IDE app + DNS resolution - Networking

Hey guys,
Anyone know how to get DNS resolution working inside of Terminal IDE?
I tried creating /system/etc/resolv.conf which has two entries:
nameserver 8.8.8.8
nameserver 8.8.4.4
I also restarted my tablet after the change was made but it's still not working.
Does anyone else use this app and gotten DNS resolution to work?
Thanks!
Sent from my ASUS Transformer Pad TF700T using xda app-developers app

Android uses the properties "net.dns1" and "net.dns2" to communicate the DNS servers to the apps.
E.g.:
# setprop net.dns1 192.168.0.1
This said, I have no idea why Terminal IDE's DNS resolver doesn't work the way it's supposed to. I assume it should use the same DNS the device does by default, i.e. the DNS dhcp (or ppp) provided it with. This doesn't work, or you want to override it?

So it's currently not working at all (just inside of the app). I emailed the developer and he says it's a known limitation as this is a "statically linked C binary"
His solution to run "jping" on the hostname to resolve the IP and then use that.
Sounds like for whatever reason the necessary DNS resolving library was omitted from his app....
What I'm wondering if there's a way to work around it to get it to work.
If not, is there a comparable application around?
Sent from my ASUS Transformer Pad TF700T using xda app-developers app

amenic said:
So it's currently not working at all (just inside of the app). I emailed the developer and he says it's a known limitation as this is a "statically linked C binary"
His solution to run "jping" on the hostname to resolve the IP and then use that.
Sounds like for whatever reason the necessary DNS resolving library was omitted from his app....
What I'm wondering if there's a way to work around it to get it to work.
If not, is there a comparable application around?
Click to expand...
Click to collapse
Ah, I see. This is an error by the app developer. It is not possible linking the DNS resolver libs static, assuming standard libc used here (using bionic, this wouldn't be a problem in the first place). The resolver libraries are always loaded dynamic, even if the app claims to be static (e.g. checking using "ldd").
You can solve this by installing the resolver libraries. Pick them from e.g. the Debian ARM distribution. Make sure LD_LIBRARY_PATH contains the directory you place them in.
You also have to create an /etc/nsswitch.conf and /etc/resolv.conf to make the resolver libraries happy.

Related

[Android] Run Android without a data plan [CHECKLIST]

Hey Gang,
I currently do not have a data plan and won't get one until I switch from Sprint to Verizon. (accounts expire soon)
This is what I want to do with my Vogue:
Setup SD card with EXT2 partitions [CHECK]
Correctly install/run a SenseUI/Hero build [CHECK]
Convert my WM contacts to Android contacts offline [CHECK]
Install APK's offline [CHECK]
Use the internet connection through my PC via USB cable (while running android) [PENDING]
Install a "camera software" APK so i can use the camera [PENDING]
Enjoy the hell out of Android and all the possibilities for the Vogue! [CHECK]
Any and all help checking off my list is much appreciated!
~Syn
The camera already works out of the box. and Talk to enatefox about internet via USB connection.
Install a "camera software" APK so i can use the camera [PENDING]
I am currently using "Pro Paint Camera that came with this Hero/SenseUI build.
I can take pictures but not video. Also, none of the lighting effects work so every picture is very yellowish.
True.... the camera does work, but it is not really usable without adjustment.
I'm in the same situation right now. I want to use android but I'm afraid I wont be able to use internet to access the market (unlike WM/ActiveSync).
The camera issue is something that I can deal with, but I think that it would be nice if someone could make an activesync-like program that can share internet.
Only difference is that I'm on verizon right now, and might consider switching to sprint!
synaptyc said:
Install a "camera software" APK so i can use the camera [PENDING]
I am currently using "Pro Paint Camera that came with this Hero/SenseUI build.
I can take pictures but not video. Also, none of the lighting effects work so every picture is very yellowish.
True.... the camera does work, but it is not really usable without adjustment.
Click to expand...
Click to collapse
I forget exactly when that build came out, but I can assure you that the build I'm using now has a camcorder and camera app outside of Paint Pro Camera.
FWIW, I'm using the Droid donut ion build by Zenulator.
Also, from what I know, internet through USB only allows you to browse the web, and the marketplace doesn't work. There might be some changes in the future, however.
Yes. with Cupcake / Donut the camera/camcorder seem to work with the default applications. They still don't have filters or effects to correct lighting.
... still looking for that app.
Link9228 said:
I forget exactly when that build came out, but I can assure you that the build I'm using now has a camcorder and camera app outside of Paint Pro Camera.
FWIW, I'm using the Droid donut ion build by Zenulator.
Also, from what I know, internet through USB only allows you to browse the web, and the marketplace doesn't work. There might be some changes in the future, however.
Click to expand...
Click to collapse
How would one go about getting Internet via USB? I have searched endlessly (or so I thought). Thanks.
gascan555 said:
How would one go about getting Internet via USB? I have searched endlessly (or so I thought). Thanks.
Click to expand...
Click to collapse
I've been trying to do this too!
gascan555 said:
How would one go about getting Internet via USB? I have searched endlessly (or so I thought). Thanks.
Click to expand...
Click to collapse
I have also been trying to figure this out... but getting Internet via bluetooth rather than USB. So kind of like the bluetooth tethering that is possible right now with Android, but in REVERSE! So Internet-> PC-> Bluetooth-> Android.
USB Internet (at this point) can be very problematic. It can cause your phone to hard freeze out of the blue. I haven't spent a lot of time troubleshooting it since it's hard to figure out what went wrong when I'm forced to reset.
Credit to DimaFern for getting me anywhere near having this working. I just messed with it a little. This is reverse tethering because you are not getting the connection from the phone. So the USB Tethering option is not related in this situation.
Here's my howto
I have not tried this without a Linux host. I believe you can forward traffic with ICS but I don't know what is involved there.
My gateway is .37, my laptop is .107 and the phone gets it's IP from the laptop:
On laptop:
echo "1" | sudo tee /proc/sys/net/ipv4/ip_forward
On Android:
ip addr add 192.168.37.100/24 dev usb0
ifconfig usb0 up
## This is the IP for my laptop:
route add default gw 192.168.37.107
setprop net.dns1 192.168.37.107
cat /proc/net/route
Click to expand...
Click to collapse
The last line is not needed-- it's to show you that it's routing traffic. You won't be able to ping IPs from the command line and somehow Market doesn't think you're online but SAM Market, Browser, etc. do work. It's nice because you are not taxing the RAM of the phone for connectivity so it runs much quicker... unless it hard freezes on you.
i use tetherbot to tether my phone now that it's running android full time. basically install tetherbot and start the socks proxy server on port 1080 then.
Code:
adb forward tcp:1080 tcp:1080
from your computer and set up firefox to connect manually to the proxy.
http://www.google.com/url?sa=t&sour...tLoX-20q2czcpvdhw&sig2=YLuIUO1a9NqdzdKn2NhO5Q
http://www.google.com/url?sa=t&sour...D0n7yQtvLGRfy1GXg&sig2=OMS2j6DiIEHenOugM9VbSg
zenulator said:
http://www.google.com/url?sa=t&sour...D0n7yQtvLGRfy1GXg&sig2=OMS2j6DiIEHenOugM9VbSg
Click to expand...
Click to collapse
WOW..... this second link leads to a beautiful website.
10 levels of gay for poor "kevin" of 'kevin♥Amanda' but still a nice looking site
Geez.... he didn't even get his name capitalized in the header picture
/on_topic: I'll try Tetherbot.
(is there a way to use Tetherbot with Google Chrome? I haven't used Firefox in ages)
zenulator said:
i use tetherbot to tether my phone now that it's running android full time. basically install tetherbot and start the socks proxy server on port 1080 then.
Code:
adb forward tcp:1080 tcp:1080
from your computer and set up firefox to connect manually to the proxy.
http://www.google.com/url?sa=t&sour...tLoX-20q2czcpvdhw&sig2=YLuIUO1a9NqdzdKn2NhO5Q
http://www.google.com/url?sa=t&sour...D0n7yQtvLGRfy1GXg&sig2=OMS2j6DiIEHenOugM9VbSg
Click to expand...
Click to collapse
I'm sorry, but isn't Tetherbot used to share your phone's internet connection with your computer?
I think we are trying to be able to "reverse tether" and not tether.
enatefox (and others)...
I would love to see how this reverse-tethering can work. I know its very complicated and buggy right now, but if you do any more work on it you should create a thread showing how in layman's terms. I have dual-boots on both my computers into Ubuntu 9.10, I know what the terminal is and sudo and some basic commands, but when you type your commands with little explanation I get lost. They could use some clarification [ such as 1) open terminal 2) type these commands. ] And please explain terminal in Android. What apk do I need? I probably have it already but just need to install it. Thanks for any help. I don't have data since my line costs $10 a month (family plan) and data would be $26 a month. I just started reverse-tethering with WM6.5.1 and its really cool.
There aren't any other steps you just run what I posted and change "192.168.37.107" to what your desktop's IP is and "192.168.37.100" to "192.168.xxx.100" where "xxx" is the subnet of your LAN-- matching the 3rd set of numbers of your desktop's IP.
You can run these commands over ADB, which is required to do this. Here's a guide on how to set it up.
Here is what I came up with trying to do the same thing with bluetooth instead :
http://forum.xda-developers.com/showpost.php?p=4404512&postcount=9
I was missing your "ip addr..." command to add the forwarding network, this should help, I will give it a try.
I also came to the conclusion that I needed a way to fake that either the wifi or the data connection was up. Maybe this can be done by issuing a "setprop" command forcing the status to being "up"?
enatefox said:
There aren't any other steps you just run what I posted and change "192.168.37.107" to what your desktop's IP is and "192.168.37.100" to "192.168.xxx.100" where "xxx" is the subnet of your LAN-- matching the 3rd set of numbers of your desktop's IP.
You can run these commands over ADB, which is required to do this. Here's a guide on how to set it up.
Click to expand...
Click to collapse
UGH I'm stuck right now. I'm using Ubuntu 9.10, and when I type in terminal "sudo /etc/init.d/udev restart" I get some error message telling me to do it a different way. So even after restarting the computer, it does not recognize any command for adb. I already did the export PATH to the androidsdk/tools folder and adb is in there, but I cannot get it to open. Any ideas?
Got it to see adb. I forgot to put /home/drkow19 in front of the path...
edit: Has anyone successfully used ADB with zen's 2.0.1? I'm trying right now but it shows no devices connected. In the 50-android.rules file I have 0bb4 instead of 18d1 like enatefox said to. Also, on the Dream forums the file they use is 51-android.rules, whats the diff?
0bb4 and 18d1 are determined in the source code. Different versions can change so whichever is shown, use. The 50 and 51 are indicators for timing. Maybe I have this backwards but 51 should start later than 50 and can address issues with it not being recognized or more precisely, overrode with another operation. I set mine to 51.
Okay I deleted 50 and used 51-android.rules. What is the line about "define vendor id" does that need to be in the 51 file?
I can say adb start-server but no devices... They say you need to sudo adb start-server but when I try that I get "sudo: adb: command not found" How do you add the adb PATH so it works under sudo as well?

HTTP POST Capture

I was wondering whether there is such software for the android that can capture http posts before sending. i.e. like the firefox addons you can get and apps like http analyzer?
This would be really useful for testing purposes.
Cheers.
Gazos
You can try some general traffic capture tools (Like tcpdump or airodump-ng). If You have rooted phone, check out Shark for Root (tcpdump on phone).
Thanks for the update but I guess what I want is real time captures (and manipulation) like its possible in Firefox using only the phone.
I currently use tcpdump to capture data but want to edit the data before its sent out.
You can try to find/write small proxy server application and run it on phone, so you will be in control.
ex87 said:
You can try to find/write small proxy server application and run it on phone, so you will be in control.
Click to expand...
Click to collapse
Or you could run paros (http://sourceforge.net/projects/paros/files/) on a machine on your network and get the android browser to use it as the proxy (which looks like a bit of a task in it's self.)
The only viable way I can think of to do this (given Android's insane lack of proxy support) is to hack a custom firmware for a Linksys WRT54g so it basically routes everything to a transparent proxy (Fiddler2, Webscarab, Paros, Burp, etc) running on a PC. Something like this:
Android =[wi-fi]=> WRT54g -[ethernet]-> PC with proxy -> internet router
It might even be possible to achieve this without hacking the WRT54g.
The only problem you might still have (not sure) is Android's handling of invalid SSL certs since the proxy would basically be doing a man in the middle attack, and the app running on the Android phone would see an invalid SSL cert.
Be warned that trying this with a Windows host PC is almost guaranteed to fail unless it's Pro/Ultimate, and in any case this is going to involve some seriously hardcore manual routing config that goes beyond anything Windows' config screens were really intended to set up.
You can try to find/write small proxy server application and run it on phone, so you will be in control.
Click to expand...
Click to collapse
I'm pretty sure I saw this discussed on the android.security list, and the consensus was that the current API doesn't give any way to do this transparently, and it's questionable whether you could even implement something like WebScarab natively on Android using the NDK. I believe the general consensus was that if you want to host something like WebScarab on Android, it's going to take a custom kernel to pull it off, and some solution that lets you offload the actual proxying to a regular PC would be infinitely easier to pull off, and less cumbersome to use for actual security testing (it's enough of a pain trying to use Fiddler2 or Webscarab with a 1280x1024 display, let alone 854x480... not to mention trying to cut and paste examples into Word Documents for vulnerability assessment reports (shudder)).
^^^ OMG. I just installed AOSP ("Buufed") for the CDMA Hero, and it actually HAS the ability to set proxy for WiFi. I haven't tried it yet, and I'm not sure whether it's purely an "AOSP" feature or something I've just overlooked up to now that was in DamageControl, but it looks like at least *some* Android builds DO have it now

How to connect to android phone over 3g or 4g

Hello.
Does anyone know how to get access to their cellphone using the IP address from the wireless carrier?
I've already got SSH set up from the home wifi network. But I'm hoping to be able to do this over cellular. Any ides how to make that work?
Sent from my HTC Glacier using XDA App
If you meant having your phone run an sshd daemon, so you can use a shell with it .... Market has this: https://market.android.com/search?q=sshd
close...
that is what i'm looking to do. but for some reason i'm unable to connect to the device's ip address... any ideas?
Your phone's ip is a private ip address. TMO NATs it to a set of public ip addresses to go out to the internet. That's why you can't connect using your phone's ip.
Sent from my HTC Glacier using XDA App
Darn. I was really hoping to be able to get through. Oh well. Thanks.
Sent from my HTC Glacier using XDA App
One option to get around this is to use remote port forwarding via SSH. You can run an SSH server on your phone and then use ConnectBot on your phone to SSH into an SSH server on your home network. At that point, you can use remote port forwarding with ConnectBot to allow other computers on your home network to access the SSH server on your phone.
That's a very good idea. I'm going to try it in the morning. Very excited.
Sent from my HTC Glacier using XDA App
Hey ran across this sometime ago but didn't know an answer till today... but it's complicated...
1st~ it seems to depend on your service provider...
~ On Sprint I have been able to ssh into my device from a PC connected to a completely different wifi network using Putty on Vista home basic.
~ On Sprint I (with some great help from Almazick here at XDA) have also been able to run a LNMP server and connect to the sample web page and dbmin with the above mentioned network set up but with Chrome and Firefox instead of Putty (yeah that might be a duh statement for some but I don't want to lose ya reader, this stuff is cool ) you can find all the steps that that took by following the link in my sig that points to the XDA Guide I maintain and jump to pages (ruffly) 11-13+ and check the easiest ways to host websites off your device. And I'll eventually have a script and section in the main guide made so you all don't have to scroll through pages of our mutterings
~ Almazick, the person that I credit for getting me to do all this extensive testing, is not on Sprint and because of this has run into errors when trying to connect over 3G and or 4G. This leads me to believe that the issue is the network that your device is connected to.
~ Currently there are almost no other variables left that could be at fault. Both Almazick and I are using the same software and apps to test on.... but for those that have to know what the last variables to test is; hardware, we've got different devices and different service providers, and different PC's. All others have been eliminated or made identical or have been adjusted for.
2nd~ Root is required and if you want to ssh like us then getting Linux duel booted up will make life way easier for helping in the future.
~ Almazick uses Lil Debi and I'm a fan of Debian Kit, both can be found on the Android market place for free, and there are other options like QEMU and more but for this definitely start with Lil Debi and a 2Gb img file or larger (still working on figuring it out on Debian Kit) and follow the direction on page 11 or 12 for now.
~ or you could try downloading an app for ssh server (not client alone) and muddle your way through other guides on the web... I'll be testing/checking the possibilities for this but am not holding my breath on when that'll be ready
3rd~ accessing things...
~ running 'cd sdcard' and 'ls' was peppy and responsive
~ running programs or apps that use lots of data or memory can be ruff.
~~ Force closures happen when out of memory. So freeze or force close or uninstall apps that aren't needed if things like that start happening.
~~ things that use lots of data and or memory also cause much drain on the battery and if excessive wile plugged in can cause heat issues. So use a heatsink from an old computer and a fan and maybe pull the battery too and you can run a bit longer on the edge of what your device can do
4th~ all this is very "use at your own risk"
~ I haven't fried or bricked a device yet but things have gotten toasty so use some for thought and be careful.
Final notes;
I realize that this is a thread resurrection and not 100% directly related to your specific device. However, I offer a work around that should work for all devices* running root and Linux so we should celebrate and revel in the wonders of Open source and helpful people
*running on Sprint or WiFi if on another network then please try it and report the bugs to me on the main guide thread and I'll work with you and try to resolve it
Sent from either my SPH-D700 or myTouch3Gs
Debian Kit/QEMU Linux Install guide for all android devices that I'm writing:
http://forum.xda-developers.com/showthread.php?t=2240397
Now have working Installers for ARM Java 7 JDK + Maptools + jMonkey
nixxofugi said:
Hello.
Does anyone know how to get access to their cellphone using the IP address from the wireless carrier?
I've already got SSH set up from the home wifi network. But I'm hoping to be able to do this over cellular. Any ides how to make that work?
Sent from my HTC Glacier using XDA App
Click to expand...
Click to collapse
SSH server requires a PC which must be always on but you can use a router since it's already running 24/7. If you have a router with SSH/VPN/Proxy capability then you can use router as a server. For example you can use a 3rd party firmware for your router if it is compatible with DD-WRT, Tomato or OpenWRT to run Proxy server, SSH or VPN. They are very easy to setup for this task.
Update: Just noticed it's 2011 thread. Oh well
Almazick said:
SSH server requires a PC which must be always on but you can use a router since it's already running 24/7. If you have a router with SSH/VPN/Proxy capability then you can use router as a server. For example you can use a 3rd party firmware for your router if it is compatible with DD-WRT, Tomato or OpenWRT to run Proxy server, SSH or VPN. They are very easy to setup for this task.
Update: Just noticed it's 2011 thread. Oh well
Click to expand...
Click to collapse
Yeah I do that, been haunting the web for sometime now... I keep a personal log of questions I want answers to and when I find one that is solvable I go back to where I first ran across the question in the first place. Should have seen what the maptools teem thought of this kind of behavior; really motivational
Sent from either my SPH-D700 or myTouch3Gs
Debian Kit/QEMU Linux Install guide for all android devices that I'm writing:
http://forum.xda-developers.com/showthread.php?t=2240397
Now have working Installers for ARM Java 7 JDK + Maptools + jMonkey
S0AndS0 said:
Yeah I do that, been haunting the web for sometime now... I keep a personal log of questions I want answers to and when I find one that is solvable I go back to where I first ran across the question in the first place. Should have seen what the maptools teem thought of this kind of behavior; really motivational
Sent from either my SPH-D700 or myTouch3Gs
Debian Kit/QEMU Linux Install guide for all android devices that I'm writing:
http://forum.xda-developers.com/showthread.php?t=2240397
Now have working Installers for ARM Java 7 JDK + Maptools + jMonkey
Click to expand...
Click to collapse
so what maptool got to do with android over 3G/4G?
Almazick said:
so what maptool got to do with android over 3G/4G?
Click to expand...
Click to collapse
It's yet again a server client based networking set up but instead of accessing files and folders (like with putty here on this thread) or accessing web content (like with LNMP on the other thread) maptools serves up a virtual table top gaming experience to those that connect in. One person sets-up* a game and then shares out the guest login info to their fiends, the guests log in and after a few seconds every one connected can see the changes that any other player takes. Kinda like virtual desktop but for roll playing games.
*set-up of the game is rather labor intense for the individual. Because they make an entire dungeon or world map, tokens to populate it, and libraries of macros so things are more point and click. When compared to running a normal tabletop gaming experience the labor is almost as intense, it's just not easy to share in real time over them internets.
Update 08312013- to help continue answering this question here I found this guide
https://grepular.com/Punching_through_The_Great_Firewall_of_TMobile
That may help with T mobile subscribers in making a good connection over 3G or 4G
Sent from either my SPH-D700 or myTouch3Gs
Debian Kit/QEMU Linux Install guide for all android devices that I'm writing:
http://forum.xda-developers.com/showthread.php?t=2240397
Now have working Installers for ARM Java 7 JDK + Maptools + jMonkey
my carrier is: vodafone
im using SetDNS with openDNS server
also using Dynamic DNS with a no-ip.biz hostname
installed ssh/sftp server i run it... used a ssh client to test it locally, and it works, so the sshd is working
but i cant connect to my no-ip hostname from my PC
here i have some doubts:
SetDNS says it doesnt detect a web-proxy, yet Dynamic DNS has a note: 'you are connected to the internet through a proxy'
what to do next to be able to connect remotely from my PC on ssh through 3g on my phone?
please help!
ripnix said:
my carrier is: vodafone
im using SetDNS with openDNS server
also using Dynamic DNS with a no-ip.biz hostname
installed ssh/sftp server i run it... used a ssh client to test it locally, and it works, so the sshd is working
but i cant connect to my no-ip hostname from my PC
here i have some doubts:
SetDNS says it doesnt detect a web-proxy, yet Dynamic DNS has a note: 'you are connected to the internet through a proxy'
what to do next to be able to connect remotely from my PC on ssh through 3g on my phone?
please help!
Click to expand...
Click to collapse
Well first double check the IP you're using or tracking with no-ip.biz ~ I would suggest using
canyouseeme.org
or an app like Network Info II
https://play.google.com/store/apps/details?id=aws.apps.networkInfoIi
And ensure that the IP didn't change when setting up the first time around, this can happen at the worst times.
And if you're truly behind a firewall or NAT, such as with tmoblie, then I did run across this guide for getting round that last troublesome bit which likely will work for other service providers as well.
https://grepular.com/Punching_through_The_Great_Firewall_of_TMobile
Sent from either my SPH-D700 or myTouch3Gs
Debian Kit/QEMU Linux Install guide for all android devices that I'm writing:
http://forum.xda-developers.com/showthread.php?t=2240397
Now have working Installers for ARM Java 7 JDK + Maptools + jMonkey

[Q] Nook Color CM9/ICS Netfiler/IPtables

Long time reviewer, first time poster - can't post in the dev forums until I have 10 postings (sigh).
Question for the devs or others in the know - in the ICS (granted very early) builds, I can't get IPtables to work, but an earlier list of changes seems to indicate that this should be working.
Manifests itself with errors starting the firewall in Droidwall. So, am I doing something wrong or is IPtables not available in the current ICS builds (I'm using the 0120 nightly)?
Other than that and the lack of Flash, my experience with the NC ICS builds has been nothing short of amazing.
Many thanks for the answer and for the ICS builds.
I just noticed this last night when Sshtunnel wouldn't work on my nook, but is fine on a Touchpad. I'd rather not compile my own kernel if enough people would find iptables useful.
Apparently not many CM9 users are concerned about IPtables and restricting access to the internet by apps. Hopefully one of the devs will pick this up for a future build. I worry about the info that my apps are sending out to the extent that I might go back to CM7 on my NC...
It ain't that I am unconcerned, it is just that I don't know the answer. I actually consider a working firewall to be of the utmost importance. I am pretty sure we are not alone. I did have trouble with it too, it said that the kernel came loaded with an updated version of (all numbers approximate) iptables 1.4.1.11 instead of the 1.4.1.10 that the droidwall was looking for. I honestly don't know what the issue is, but I am trying to be kinda ok about it, simply because I bet you dollars to donuts that firewalls work on cm9 sooner or later.
Lots of stuff work on cm9, I just don't feel like I can get my panties in a bunch because my pet issue isn't ready yet. I bet if we're patient it wont be long.
Or I just need to learn how to run the software better. If figure it out I will report back.
I guess my issue is that one of the chagelogs indicated that Netfilter was functioning in the upstream builds, but wasn't (apparently) working in the NC version. "Glad" to see it's not just me, but not so good that it seems to be lingering without a Dev comment.
user17600 said:
I guess my issue is that one of the chagelogs indicated that Netfilter was functioning in the upstream builds, but wasn't (apparently) working in the NC version. "Glad" to see it's not just me, but not so good that it seems to be lingering without a Dev comment.
Click to expand...
Click to collapse
PS - Anyone able to post this question in the Dev thread (I can't due to low posting count)?
[Note: I am not addressing firewalls; just iptables and global SOCKS5 forwarding in this post]
I very much need iptables support in the kernel and it appears to be here now. My needs are for a global proxy that all Android apps using the network will use. In theory, it ought to be as easy as loading the relevant, pre-built kernel module, and writing the correct iptables script to route all outgoing connections through your already-running ssh proxy. There are several apps that do this already.
I noticed there's a newer app for iptables maintenance "Iptables (beta)" in the Market by Moroni Granja, who also wrote the Autoproxy utilities. His utility does indicate that CM 7.2.0-RC1-encore (as of 2012-03-24) does have the required modules on it and offers to update the iptables binary for you which may (or may not) be necessary. I did update mine.
Whether it automatically re-routes all your outgoing connections through your already running SOCKS proxy I have yet to find out [edit: see my **UPDATE** below]. I have seen several apps like this in the market but none have worked on my Nook Color CM 7.1.X but I will try to see if they work on CM 7.2.X with Moroni Granja's utility. Another one that claims "global proxy support" is MAX LV's "ProxyDroid." None of them will open an SSH tunnel using SOCKS dynamic proxying and then iptables to it [edit: see my **UPDATE** below].
Dropbear on Cyanogenmod is not built with "-D" option. If it were, you could open a dynamic socks proxy using "ssh" on the device, set Proxydroid to use 127.0.0.1:58080 as your SOCKS5 proxy, set it to global mode (or set up an iptables script for this), and you have your own SSH tunnel. I don't see any app that will do this all at once anywhere in the market but I'm close to putting together a skeleton if only I had OpenSSH or Dropbear with "-D" dynamic forwarding compiled into it. That's the big obstacle here [edit: see my **UPDATE** below]..
Well, I did write that last paragraph a little hastily. There are two apps, "SSHTunnel" and "SSHTunnel (beta)" which come close to these requirements, but the author specifically notes they are intended for people behind the "Great Firewall" and I have had very little luck getting this to work. However, these apps do have interesting internals that can be used to further the effort for a true SOCKS5 tunnel using SSH to a remote host because, as you may already know, all you need is a remote Unix host to get this to work completely.
**UPDATE** I have successfully used SSHTunnel (beta) to connect to a remote host through the SSH SOCKS5 tunnel without setting any browser settings on CM 7.2.0 on my Nook Color. It is working now, though it's cumbersome to say the least. I am observing several connections on my remote SSH host that are being made from my Nook Color to places like Wikipedia and Google Play Store using http and https, among other things. I cannot confirm that all of my outgoing connections are being made through the SOCKS5 proxy but many are.
The executable being used is named /data/data/org.sshtunnel.bat/sshtunnel and it is actually OpenSSH_5.8p2. OpenSSH is very inefficient as compared to Dropbear. Indeed, the author of SSHTunnel says it will significantly reduce battery life. Replacing this with a Dropbear binary with dynamic forwarding may result in significant speed increase, battery life, and decreased memory usage.
In conclusion, I can report that global SOCKS5 proxy via SSH does work on CM 7.2.0-RC1-encore using the "IPtables (beta)" app in conjunction with SSHTunnel (beta).

[DEV][WIP]Permanently change wireless MAC address

Heya guys;
Alpha Terminal script attached (randomizes mac) Reboot after you run it as root
I've been working on changing the mac address for a bit, and as of 30 minutes ago, I seemed to have successfully accomplished it.
Survives reboot
Accepts any OUI
Completes 4-way WPA handshake
However, while I have been successful on my phone, I don't have another device to confirm repeatability.
For the brave souls who wish to try, please note that this is a -permanent- change. Your original MAC is not copied somewhere automatically, so don't blame me for not remembering your original MAC, or if you get eaten by the dragons that may lie ahead.
For this test, I'm going to start with the basics of what I did. As I get feedback, I'll respond with questions and hopefully narrow down potential system variability. I was running these commands as root, though.
Open your terminal emulator of choice and follow along (replace the ×''s with the mac of your choosing
Code:
netcfg wlan0 hwaddr ××:××:××:××:××:××
Enjoy your new permanent mac. (Could it be this simple?)
confirm the change
Code:
ip link show wlan0
Make the change permanent
Code:
echo "××:××:××:××:××:××" > /efs/wifi/.mac.info
Reboot, then check to see if the MAC took
Code:
ip link show wlan0
Try connecting to an AP with WPA on, and report back.
Very interesting, could you put this all into an app? So perhaps Mac addresses could be spoofed? A GUI would make things a lot easier. I'll try this out later on my oneplus one. [emoji3]
-Sent from my BR0K3N ON3.
[DEV][WIP]Permanently change wireless MAC address (WORKS!)
evilpotatoman said:
Heya guys;
Alpha Terminal script attached (randomizes mac) Reboot after you run it as root
<< snip >>
Try connecting to an AP with WPA on, and report back.
Click to expand...
Click to collapse
Works on Samsung Centura SCH-S738C running Ice Cream Sandwich ( 4.0.4 ), and rooted with stock
ROM. Verified after reboot! The phone reconnected immediately to wifi network.
Also works on Samsung Tab 3 SM-T217S running KitKat ( 4.4.2 ), and rooted with stock ROM. Verified after reboot! The phone reconnected immediately to wifi network.
I skipped the commands, and simply edited both the ' .mac.info ' and ' .mac.cob ' (backup?) files (after backing up both!).
So simple. Works where MacChanger failed. May I tell you that I love you?
forid200 said:
Very interesting, could you put this all into an app? So perhaps Mac addresses could be spoofed? A GUI would make things a lot easier. I'll try this out later on my oneplus one. [emoji3]
-Sent from my BR0K3N ON3.
Click to expand...
Click to collapse
Yepper, spoofing works, but since that may an indication of nefariousness , the script doesn't spoof the oui, just mods the last 3 octets. Interested modders may mod my script as they see fit
evilpotatoman said:
Yepper, spoofing works, but since that may an indication of nefariousness , the script doesn't spoof the oui, just mods the last 3 octets. Interested modders may mod my script as they see fit
Click to expand...
Click to collapse
Privacy is hardly nefarious.
"This Android app turns off Wi-Fi tracking without turning off Wi-Fi"
"'Retailers, crooks, the government, and others shady individuals are tracking your movements. Even when your Wi-Fi is turned off, your phone may be broadcasting information to whomever is in range which can be used both to track repeated visits to as well as your exact movements in an area under surveillance,' Chainfire wrote on Google+."
100% agree with CFs implementation, which is why my script (rudely) emulates it. The nefarious acts I hinted at consist of things like manually setting your MAC to aide in the hacking of APs with MAC authentication. I'm sure you can agree with that being an invasion of privacy.
evilpotatoman said:
100% agree with CFs implementation, which is why my script (rudely) emulates it. The nefarious acts I hinted at consist of things like manually setting your MAC to aide in the hacking of APs with MAC authentication. I'm sure you can agree with that being an invasion of privacy.
Click to expand...
Click to collapse
Agreed. Though, I believe the good of personal privacy outweighs the potential evils.
evilpotatoman said:
Yepper, spoofing works, but since that may an indication of nefariousness , the script doesn't spoof the oui, just mods the last 3 octets. Interested modders may mod my script as they see fit
Click to expand...
Click to collapse
It's handy in a lot of cases, but the tools to do something shouldn't be restricted in my opinion. About the spoofing a particular MAC, there's many legitimate reasons why you may wanna do this too. So flagging it off as just for malicious usage is sort of invalid. For example, if you go to a mall, and they have free Wi-Fi, however they require you to create an account and login, via this they will log your usage and collect data. For privacy reasons, you may wanna spoof MACs. Or if you go to a hotel and want to setup your chromecast but it has a login landing page, you're stuck. Unless you can spoof the MAC with your phone.
-Sent from my BR0K3N ON3.
HoytK said:
I skipped the commands, and simply edited both the ' .mac.info ' and ' .mac.cob ' (backup?) files (after backing up both!).
Click to expand...
Click to collapse
It may be that the time stamp on the '.mac.info' file must be earlier than the time stamp on the '.mac.cob' file. Can anyone confirm this?
Can anyone make a script to reverse what Pry-Fi did to my device, so that it stops rebooting randomly.
I will happily pay for your time. I just cannot believe this and Pry-Fi are there only viable options? Surely someone can build a script to run via terminal to fix issues?
Let me know if you are action donations?
I would be forever in your debt!

Categories

Resources