Capture Mobile Data Packets - wireshark

I would like to capture packets of the internet traffic of my mobile. I would like to ask that if I install wire shark on my desktop machine, and then make my desktop a wifi hot spot, connect my mobile phone with this desktop powered wifi then Would I be able to capture/analyse packets of my internet traffic of mobile on wire shark at desktop?
Your help is highly appreciated.
(I can try it to see if it works, but don't have access to LAN at the moment and need the answer, Thanks for your help)

Here is one example that I did for my undergrad computer security course. It's called Rogue Access Point. I will not go into detail, but here is a rough guide.
Share your mobile data from your smartphone through USB, and make sure you have internet connectivity.
Connect an Ethernet cable from the Ethernet port to a LAN port of a wireless router to your desktop.
Rename the service set identification (SSID) to the same SSID provided by WiFi provider (For example, Starbuck WiFi, this was what we did, I do not recommend you do it).
Turn on Wireshark and start collecting packet.
Use filter in Wireshark to find packets related to Facebook login. Use keyword: datr You will find something like
Cookie: locale=en_US; c_user=506850624; fr=02PxKMh4c31xOpTft.AWXeEL4hlFqGE5DB0l5hpcqzlZU.BP2Yvw.3d.AWV3N4cB; xs=1%3AUONPf83CTZsfeQ%3A0%3A1349269748; datr=c_l0TvTFOzJaSVQPYIXjZ2am; lu=Tg2KgC1vKc8eTORy62Su_97w
Open Firefox, install any cookie injector Add-on.
Navigate to Facebook page and start the cookie injector.
Copy everything from fr=, in our case 02PxKMh4c31xOpTft.AWXeEL4hlFqGE5DB0l5hpcqzlZU.BP2Yvw.3d.AWV3N4cB and paste to cookie injector. And refresh the page. Now you should be logged in to Facebook with whoever uses your WiFi hotspot to access Facebook previously.
Note: Facebook now uses HTTPS by default unless you change it in your Facebook privacy setting. This method no longer works on Facebook. It "might" work on other login pages. You can easily find a guide on how to set this up on Youtube!
Best of luck!

Related

See devices connect to my wifi router using Swift and allow/block wifi acces

In short i'm trying to build an App that will grant/block wifi access to my son's wifi for his Ipad and his PS4 remotely using an App. I researched the topic and can't figure out how this can be done. Ideally i'd like to be able to grant/block wifi access independently Ie. block wifi to the Ipad and allow PS4.
How can this be done, no need for the full code ( well if you insist i'll take it ) but just point me in the right direction.
Depending on the router you're using you're going to need to write something that interacts with the router's API, if it has one. If it doesn't, you will need to replace the firmware on your router with something like ddwrt that can be scripted. From there, you might be able to create an app that talks to the router's API.
TLDR: You're probably better off simply bookmarking the management page for the router and enabling/disabling access for the devices.
Edit:
It occurred to me that some mainstream consumer router/access point manufacturers (Linksys, Asus, etc) have companion apps for managing their devices from the LAN side. You should see if such an app exists for your router, and if not, perhaps consider getting a different router that supports such an app.

Internet access between WiFi-IoT in Access Point mode with mobile phone connected

I did a lot of brain-storming about this, and couldn't reach a solution.
I am posting this as i can get some ideas.
I have developed a WiFi-IoT based device with sensor, which shows up in AP mode. A mobile phone connects to this AP and then the device starts sending sensor data to the mobile phone. A mobile application plots and displays this data.
Now, i want to send this data from mobile to internet. Connecting my mobile to another AP with internet is not an option, as i don't want to break the continuous data transmission.
Using internet of data provider is one option, but that brings constraint of have mobile data.
What other options do i have to send my data from mobile to internet ??
Edit:-
I worked on the suggestions, and came to this point:-
1) WiFi-IoT device (in station mode) and mobile phone connect to same Internet-enabled WiFi access point. WiFi-IoT device has the IP address of the mobile phone for current network, and sends data to a TCP port (eg. 9801) of this IP address. The application in mobile phone reads the data from the port no. 9801 and stores it and hosts it on the internet.
This works fine.
2)WiFi-IoT device comes up in Access Point mode, and the mobile phone connects to this Access Point. Now there is one-to-one connection between WiFi-IoT device and mobile phone.
My question is, in the second scenario, without breaking this one-to-one connection, is there way to host data to internet:-
1) without using mobile internet provided by mobile data service provider ?
2) without using a second mobile phone ?
I may be wrong, but i am just asking this to make be sure whether my requirement can be achieved or not !!
I don't think you can connect to two APs at the same time.
Maybe use Bluetooth as device to phone link?
Or have the device connect directly to internet after some config done in AP mode and then send a copy of the data to your phone app (either via WAN or locally to the private IP your phone gets from the Internet gateway AP)?
--Edit--
Let me explain about the second one:
What I mean is basically have your IoT device directly connect to Internet and send data to a server (your phone has also to be connected to Internet). Then make the server send a data copy back to your phone. It's two step process: 1) while the IoT device is in AP mode, use your phone to login and configure which Internet-connected AP it should be connected to. This serves as UI for your IoT device. 2) start sending data.
Or a bit ugly, just let the IoT device talk to your phone in the same WiFi network via private IP.
I brought up this way because you mentioned anyway your device has to send data to Internet(I assume it's a server) and have phone talk to a known location server is more portable and scalable once you have more than one IoT device.
--Further Edit--
I don't think there is a way to do what you described. At least from my experience:
1) on the link layer, the wireless NIC has to be able to connect to two APs at the same time. This is not a feature currently available.
2) on the network layer, there has to be two IP address attached to the same NIC, which I don't think is available in current OS for wireless NICs. Though there is a way to do this for Ethernet card, I.e. via Aliasing.

How to check wether a wifi network is secured or open using wpa_cli/wpa_supplicant or any other utility?

Wpa_cli command requires you to know in advance if a network is open or secured. I'm developing a script using wpa_cli and I just want it to connects to network whether it is open or secured , obviously if secured it should ask for password otherwise it should just connect.
How can I check if a network is open or secured so that scripts runs wpa_cli accordingly?
I just want a behavior like android phone, if a network is open it just connects to it, if it is secured it asks for password.
You can tell from the probe response what security settings a network is using.
In wpa_cli you'll need to do a scan and parse the results to find the SSID you want to connect to, and there it will tell you the security settings:
wpa_cli scan
Then to see the results of the scan:
wpa_cli scan_results
There is also another command that is not related to wpa_cli. From a shell:
iwlist interfaceID scan
Where interfaceID is your wireless adapter (e.g. wlan0).
This gives you scan results but with much more detail.
Again this can be used to deduce the security settings of a network.

Can you communicate with nearby devices using a website?

Can a website help a user communicate with nearby devices via bluetooth/WLAN without downloading software?
User requests that something be done on their device (which could be, for example a wirelessly connected printer or a bluetooth keyboard).
The site, which contains a repository of relevant actions, sends specific instructions for that device to the user's own machine.
Those instructions are then relayed to the correct device (with the user's permission) via the user's device's WLAN or existing bluetooth connection.
Part 3 is what I'm not sure of - is there a mechanism by which a website can contribute to a wireless/bluetooth connection held locally?
It is not possible. User browser can't interact with hardware for wireless networking.
You should force user to install some custom software to do this.
You would have to submit the "commands" first, then have the device make requests to the website server, i.e., check for any pending "commands" for the device, and then process them locally. A website is not "thing" that can directly interface with a hardware device.

Examining TCP traffic from an iOS device

Is there an app or clever way to check TCP:IPv4 traffic for a host:port on iOS devices? Users will be connecting to a device with an iOS app, and if there is an existing way to sniff or otherwise log TCP (and any IP traffic) on an iPad that would be super useful. We could eventually add this into the app, but it seems like there has got to be a nice app for inspecting a network... e.g. some of the functionality of wireshark, socat, and nmap. I don't seem to be able to use the right search terms in the app store and I'm also wondering if there is a way to do this in the Safari browser?
I ended up using iTelnet and turning off all the login scripts. That will connect to any ip:port with TCP.

Resources