How to intercept mobile traffic on Android? - android

I have a device (videocamera) with Android inside.
I have root access via ADB to the OS of the videocamera.
The camera sends data to the internet using a SIM card.
Is there a way to redirect the mobile traffic to a proxy, so that I could research it?
1) Seems that an apk like ProxyDroid may help, but it lacks the command line interface.
2) I tried redirecting the traffic using Access Point Name (APN), but is did not help.

The common tool for this is Charles Proxy, but you'd need to be able to install certificates on the host device.

Related

Access Chromebook's localhost from Android apps?

I have a Chromebook that I've set up in Developer Mode, with a crouton-installed version of Linux running alongside. Within the Linux crouton, I'm running a simple web server.
My question is whether it's possible to access that server using any Android apps that are also running on that Chromebook?
Android apps have been installable natively on ChromeOS for some time, but everything that I've read says that they run in some kind of sandbox. ChromeOS itself is pretty tight with its firewall rules as well.
Just to get a start, I'm trying to use the Android version of the Chrome browser to load up a page that's running on a web server in the Linux crouton. I've tried localhost,127.0.0.1, and the Chromebook's current IP address.
I followed the instructions at https://developer.android.com/topic/arc/index.html to enable Developer Mode on the Android side and also, I think, loosen up those firewall rules on the ChromeOS side.
Is there some secret sauce that I'm missing? Is this even possible at all?
I had the exact same question and found this:
https://developer.android.com/topic/arc/index.html#network
It seems that in essence there is no IP traffic allowed from local Chrome to the Android web servers..
Update (thanks jlb for the ping)
However, you can run ifconfig in crouton. And then you can access your content via that IP address. I wonder if Firefox takes that shortcut for you..
Leveraging #tomdemuyt's post, his citation source says that android apps will be assigned a private IP address, so you can access local IP traffic, just not with localhost or 127.0.0.1.
For example, from termux execute ifconfig and look for the local IP address. Then run your service, e.g. node from termux, or kWs, any Android app.... and point Chrome to http://<your-local-ip-address>:<your-service-port>
127.0.0.1 and localhost will work from other Android apps, just not Chrome.
The solutions by jlb and tomdemuyt are for accessing a android app from chromeos (i.e. an ftp server)
However, I needed the opposite way (accessing an node server running in the linux virtual environment from android chrome browser) and that was basically the question ChillyPenguin asked for.
I finally solved it:
Start your webserver and ensure that you can access it with localhost (in my case http://localhost:8080
Within the chromeos terminal run
hostname -I
100.115.92.203 (and an ip:v6:adress:...)
(or ip addr show which is more verbose)
Now I was able to access the web server from android chrome with http://100.115.92.203:8080

ssh tunnel between two android devices

I want to create a ssh tunnel between two android devices for directing internet traffic from one device to another. I installed connectbot and proxydroid in one smartphone. I ask: is there a ssh server app for android that is right for me?
The second question: i have a ssh server with public ip. Can i create a ssh tunnel from each device to this server for redirecting traffic from one device to another? If yes, how can i make this using these apps (connectbot and proxydroid)?
Thanks to everybody
I like this SSH Server App.
I do not know which "traffic" you want to redirect, so I can not help you there.

How to capture all network data in a android device like fiddler in pc?

Is there a way to analyse network traffic in a android device and log it in SD card? For example this app will run in background as a proxy making all network pass through it and based on some filters (eg: facebook data, whatsapp data) inspect data that is being sent and received and log it in a text file.
I don't know of a way to save the data to an SD card but you can capture all traffic from an Android device by configuring Fiddler on a PC that's in the same network.
In Fiddler, on your PC, go to Tools > Fiddler Options > Connections
Check Allow remote computers to connect
Check the Fiddler server's IP
In the Android device's WiFi settings, configure a proxy. Use your Fiddler server's IP and port as the Proxy hostname and Proxy port respectively.
This should make the traffic from your Android device appear in Fiddler.
Check the link at the beginning of this answer for a more detailed description and screenshots.
I think you are looking into TCPDump. But this cannot be run as a regular user, you will need to become root to executing it.
Note also that the tcpdump binary is not even published with stock images (my Cyanogenmod does not even contain this).
Here are some examples:
http://danielmiessler.com/study/tcpdump/
Some applications on Google Play allow you to capture traffic without rooting your device. One of these is Grey Shirts' Packet Capture.
They work by running on the device as a VPN service. Forcing all traffic to go through it while logging it as well. You can then view the logs on the app's UI (It might be possible to pull the session log from the SD card to open it on Wireshark. Haven't tried that).
The app also allows you to install its own root CA certificate so you can view SSL encrypted packets decrypted (just remember to delete the certificate once you're done capturing traffic). This works as longs as the app does not use customized trusted CAs.
Note that you will not be able to capture all traffic with an app running as a VPN service. Name resolutions made by apps for example will not pass through the VPN.

Using Fiddler2 HTTP request inspector with an Android device

For a project working I need to inspect the HTTP requests sent and received from my Android device. I'm using this tool Fiddler2 to monitor the traffic. In order to get it working I had to pass the traffic through a proxy. Now my phone is a Huawei U8180. Its runs Android 2.2 so it doesn't have a direct way to proxy settings. I used this app called Proxy Settings to gain access to set the proxy settings.
It almost works. I can see the traffic say, if I navigate to a website using the proxy web browser in that app (The app comes with a proxy browser). But not using my phone's normal browser. Neither I can see any HTTP requests sent by any of my apps installed in my device.
If anyone has any experience using Fiddler2 with Android, I'd really appreciate your input. I'm open to try any other alternatives to accomplish this if you got any.
Thanks.
Typically, Android users will use a tool like iptables to capture traffic from apps that don't support a proxy setting. This has some implications for HTTPS decryption; see the Fiddler Discussion Group (Help > Fiddler Community) for discussion of how to adjust Fiddler's HTTPS settings to accommodate iptables-redirected HTTPS connections.

How to sniff HTTPS traffic from Android emulator to remote server ?

I want to monitor HTTPS traffic from my application to remote server. I am trying to follow this instruction and it works for HTTP (without s), but not for HTTPS.
What is wrong? Should I write some custom code in my application to use https-proxy ?
The easiest way to do this is to use CharlesProxy to proxy your device or emulator traffic for you. The only extra step you need to do is to install the CharlesProxy SSL certificate on your device/emulator which is very straight forward:
Download the certificate from Charles Proxy (it's in their help menu) and place it on your device, then install via security settings on your device.
You then configure your device or emulators network connection to use a manual proxy and set it to the Charles Proxy address and port. Enable SSL proxying and your SSL connections will be securely routed end-to-end via Charles and Charles will be able to show you the content of requests and responses in the clear.
I'm using WireShark for sniffing, it allow you to monitor and filter raw data. But because you using https and all transactions encrypted i suppose it can't help you. May be you can switch from https to http for debug, and later when all will be works fine change protocol back to https
Do you mean you can't see the traffic at all or do you get it encrypted? Is this a web application or native application? which Android version are you using? phone or emulator?
Normally, if you set up the proxy properly, you will get the traffic, but encrypted so you can't read it. In order to see the actual content in Fiddler you would need your device to trust Fiddler's root certificate (used to create fake certificates on the fly). See this:
http://www.fiddler2.com/fiddler/help/httpsdecryption.asp
Unfortunately, I have not found a way to add root certificates to an android device other than
rooting it and replacing the certificate store (like this)
https means http secure, so it obviously can't be sniffed so easily. what would be the point if it would be the same unsecure thing as normal http?
you have to learn a bit more about secure network comunications. or, long story short, at least you will have to learn how to use a specilly devised http proxy like charles http://www.charlesproxy.com/documentation/welcome/ so you will be able to monitor you own https traffic in a clear form.

Categories

Resources