Using WireShark to sniff network traffic of an Android device connected to a PC - mqtt

I have an Android device connected to my macbook via USB. The Android device is connected to a WiFi network, the same WiFi network that my macbook is connected to.
I wish to sniff network traffic going to the Android device (using WireShark). I then wish to filter that traffic by the MQTT protocol.
So far, I have tried doing this by running adb shell ip addr from my mac terminal in order to get the ip address of the wlan0 network. I took the inet address and plugged the ip address into the display filter on WireShark like so:
ip.addr == 192.168.190.123
However, no traffic is showing on there, nothing through MQTT protocol or any other protocol, but the device is definitely making network calls.
I am incredibly naive to network stuff, so I really feel lost. Can anyone point me in the right direction?

Related

Router as Access Point + Repeater

Is there a way to use a wireless router as some sort of Access Point + Repeater?
I have a LTE Box with a SIM Card that has a build-in router which is pretty shitty.
I now want to connect a proper router to this LTE Box (via WIFI, since the LTE Box has no LAN Port) to get internet access and then connect only to the router (via LAN Port, since I don't trust in WIFI).
The answer depends on your W-Lan Router.
Some devices got a function called WDS -> Wifi Distributed Service.
You need to specify the signal and the login data for the wlan router who should distribute the original signal.

Is it possible to sniff packets from/to chromecast dongle while doing screen mirror?

I want to observe streams between the original screen mirrored from and the target screen mirrored to to check something like frame loss, thus I'm thinking to sniff packets between sender and receiver.
Is there any plugins for Wireshark which enables me to do that..?
What you have to do is to route the network traffic through some network node that you can sniff on. Like your laptop.
I would connect the laptop to the Internet through ethernet and make a wifi hotspot on it. Then tell chromecast to connect to your hotspot. Now you're in the middle between chromecast and the Internet. Wireshark should be able to capture the traffic without any specific plugins.
Make sure you've enabled routing between ethernet and wifi hotspot.

Force iOS device app to talk through the local WIFI network

I'm building an application that will run in a museum with a local area wifi network without internet access, for some strange reason I'm not able to fully "join" this network with an iOS device. Enabling internet access on this network solves the problem...
The network should provide only a web server and a DNS server, the access point has a DHCP server, android devices can connect to the network without problems.
When I try to join the network with the device it remains in a "spinning wheel" status, the DHCP server log on the debian server says it has assigned an address to the iOS device, and if I check for the wifi address with an application (like iSys o SBSettings) I see the WIFI DHCP assigned address.
But when my app (or safari) tries to connect to the web server the request is routed through the 3G connection and not completed.
In my app I'm using the standard "Reachability" framework from Apple to check the reachability of a provided host name through the wifi connection and I get 0 on the SCNetworkReachabilityFlags mask....
I'm quite sure the problem is due to the fact iOS (5.1 in my case) tries to check the reachability for some "standard" host in the network, before routing traffic through the WIFI connection.
Anyone knows what an iOS device do to "validate" a WIFI network? I can add hostnames or simple dummy services to the server machine if this can help me connect the device to a LOCAL-only network :)
It seems that iOS doesn't like to join networks without a gateway, also if the network is local you have to setup a correct gateway address.
Setting the gateway as the server itself did the trick and the device started to route TCP/IP over my local area wifi network.

Getting IP addresses of the PC's available on wifi network in android

I am able to establish connection between android and PC via Wi-fi. But this is done by hard coding the the IP address of the PC (server) in the android program. But I wanted to get IP addresses of the PC's available on the Wi-fi network programmatically. So please let me know how to scan for PC's on the network and get their respective IP address.
can you not multicast a UDP packet on the network which the server listens for and responds to with a packet containing the ip address of the server in order to set up the connection?
You should be able to find help on that topic, with some options here here and here

How to make a program that sends data through the WiFi router

I got a WiFi router connected to my PC.
What I want is to send from another device some data to my PC through the Wi-Fi adapter.
Program on the device is developed using EVC++. The one on PC - on VC++.
EDIT 1:
PC has an IP address.
Another device s IP is set at program execution. I mean WiFi IP address. And then connection to WiFi router is proceeded.
EDIT 2:
What if it uses an ethernet and wifi together?
How should I make a connection through WiFi?
WiFI is no different to usual Ethernel network.
So you just usually find out IP of other computer (in config/ask user/DNS), establish usual TCP/IP connection and send data on.

Resources