Capturing packets using wireshark of an IoT device - wifi

I have an IoT device that connects to my wifi router using wifi. There is a limitation of capturing network logs on the device itself so I thought to capture it using Wireshark.
I am using windows 10 and downloaded the latest version of Wireshark. Now that my laptop and my IoT device connect to the same network through the same router, I am not able to capture the packets in and out from my IoT device.
I put the filer as ip.addr == {ip of the IoT device). But it shows nothing.
Is it possible to capture these packets using a laptop using Wireshark?
Let me know, please.
Thanks
Akhilesh

Is it possible to capture these packets using a laptop using Wireshark?
Yes, but your capture setup is almost certainly incorrect. In a nutshell, you need to be able to capture packets in monitor mode, and you're not doing that. Whether it's possible to do so using the WiFi card on your laptop is unknown, because not all cards support monitor mode on Windows.
Since it's impractical to provide an answer that simply repeats information already provided elsewhere, I'll refer you to the following sites for more detailed information:
The Wireshark WLAN (IEEE 802.11) capture setup wiki page
Jasper Bongertz's blog about Wireless Capture on Windows
See also my answer to this question, which basically provides the same information.

Related

Wireshark wifi traffic not fully listed under monitor mode under OrangePi(Lubuntu)

I‘m trying to monitor traffics under wifi, And I use both a mac and a lubuntu installed Wireshark, and after I enable monitor mode start listening, the amount of lubuntu packs is far less than Mac (10x less)
Does this happen since the CPU or net card things(other hardware things?) or just because of different Wireshark?
Is there any other way to identify this cause? (maybe with some other tool or commands)
added:
maybe related to the channel of wifi, but I config wifi to channel 7 and set the lubuntu monitor channel with
iwconfig wlanxx channel 7
but still, I can't get sniffer traffic under lubuntu but full of them under mac
seems lubuntu only could get the broadcast pack (like arp) and 802.11 Protocol Pack
I'm guessing this due to the bad configuration or implementation of wireless net card
There is probably just more activity on the Mac. I don't know your precise configuration, but if you have a browser open on the Mac and nothing on the lubuntu, then there will be a difference in the amount of network traffic.
There is not really a reason for network traffic to change significantly because of hardware. Configuration can play a role though. If ipv4 and ipv6 are enabled, address resolution packets will be double as if only one is. If Arp cache is set to expire fast, there will also be more Arp traffic.
To identify the cause, look at what wireshark is telling you. What packets are there on both machines ? what packets are unique to the Mac ? Have a look at protocols, destination IPs and port numbers, they are the main clue to tell you what is happening.
It seems due to router's setting( wifi channel and mode(802.11xx))
using channel hopping Tech, For capturing as much as possible packages while hopping through multiple channels
And maybe trying some advanced monitor wireless net card for various mode(802.11xx) and 2.5G/5G supporting

Real-time data from Raspberry Pi to iPhone

I recently have not much experiance about working with a raspberry.
I need to send real-time data from my Raspberry Pi 2 Model B to an iPhone. The Raspberry will get the internet connection via UMTS stick.
I thought about a websocket but I didn't find any information what websocket would be the best and how to config it.
So is there anyone who already has a solution about it?
Thank you!
WebSocket requires a WebSocket (WS) server or a webserver that understands the WebSocket protocol as defined by the IETF. So for a RPi to talk directly to your iPhone, one of the devices has to have a WS server... which is not likely.
There are a couple of possible alternatives (there are certainly others). You could send data from the RPi to an external server that hosts a WS-capable server which then forwards that data to your iPhone, either thru a native app or a web browser. The data is logically transmitted between the two devices, but physically sent using an external service to coordinate the two. Visit http://goo.gl/Utg0dU to see data exchanged between an RPi and an iPhone using web messaging (src available).
Another possible alternative is to use Bluetooth to send data directly from the RPi to the iPhone. Being a Java dude, I know you can run a JVM on the RPI and I know there's a Java bluetooth API, and obviously the iPhone supports bluetooth, so its definitely do-able with a JVM. A quick Google shows plenty of support for bluetooth on the RPi with other languages. So you're good with this approach too.
If the Raspberry Pi is connected to the Internet with a public IP Address (I guess it doesn't since it uses UMTS) then you can setup a TCP Listener where the iPhone will connect to. If it doesn't and you can do Port Forwarding (I guess you can't) then you can forward the TCP port to the Raspberry Pi. The above examples also work with an HTTP server.
If the iPhone is near the Raspberry Pi and you're writing an app for the iPhone you can use a Bluetooth transceiver on the Pi to communicate.
If you can't do any of this you may need a third server with a public IP where both devices will connect to and the server will relay all connections from one device to the other.
In general, it would help if you could describe a little bit better what you want to achieve and the network topology involved so we can provide more specific answers.

How can I sniff packet with Wireshark

I have already installed Wireshark in my laptop. Is it posssible to sniff the packets that my mobile phone sends through the internet? e.g. I open the browser in my mobile phone and I hit a simple link www.bbc.com , how can I sniff the packets that are transferred. They both to have connected to the same network?Because my mobile phone phone is connected to a network SSID1 and my laptop to SSID2.
Because I lack of experience in using wireshark if it possible suggest a link , so to make a quick progress and be more familiar with this software.
Thanks a lot
If you're asking if you can capture network packets on another network, then no that's impossible. You'd need to be on the same network as the device.
Thinking about it like catching fish in a river. If you cast a net in one river to catch all the fish swimming by you'll be successful. If you cast a net in this same river to catch fish in a river next to this one, you're going to be unsuccessful.
For an overview of the different modes you can use wireshark on the same network, look here.

Wired connection from iPhone to Raspberry Pi

I would like to build an application on my iPhone that connects to my raspberry Pi. Because these are going to be in close proximity (next to each other), I'd like to use the wired connection (lightning port to USB) to communicate. Is this possible or must I use wireless technologies? My assumption is that wired would be better as it ensures a connection and would be faster, however, I am open to be corrected.
This is related to a hobbyist project where I want to access a raspberry pi sensor on my iphone. The sensor (and Pi) will be next to the iphone. I'm building a custom weird case to combine them.
Any thoughts much appreciated.
Thanks
Iain
For communication with peripheral devices (Raspberry Pi for example) you have several alternatives.
UART via 30-pin or lightning connector (MFi needed)
USB via 30-pin or lightning connector (MFi needed)
Quick start: Microchip's development kits. This module can prolong communication to RPi or you can try to implement the Accessory stack (and communication with authentification chip) to RPi itself.
FSK or similar modulated-audio communication via audio-jack (no MFi needed)
You would have to implement hardware FSK modem on the RPi side and a software one on the iOS side. It is a bit tricky but by no means impossible.
Of course you could implement software modem on the RPi side, too. But since RPi doesn't have audio input you would have to use an USB audio card or something. Or complicate your life trying to sample an analog pin fast enough.
User not really Jake made a quite impressive list of links on this topic here on SO.
Bluetooth as an External Accessory (MFi needed)
Quick start: RN-41/42-APL
Easy to use Bluetooth stack. Communication with authentification chip is handled by the BT module. Note that when communicating with iOS devices data troughput is not much better than when using BLE modules.
Bluetooth as a BLE module (no MFi needed)
Data troughput not much worse then the old BT. Implementing the communication might be a bit more tricky code-wise. This module seems interesting.
WiFi communication (no MFi needed)
WiFi might be a good choice. But for your device and iOS device to be able to find eachother you will need either static IP (for the server device) or minimal Zeroconf (Bonjour) implementation.
When using WiFi you can go either with infrastructure network (using external Access Point) or you could go with AdHoc (created by your device). Later seems promising but be careful - iOS7 & AdHoc network don't seem to work well together yet.
With WiFi you have many modules to choose from. A simpler to use would be a module like RN-XV WiFly Module. TCP stack is already implemented in the module - you can use simple UART communication. I'm not sure how to implement Zeroconf on this one.
Or there are raw WiFi modules like MRF24WG0MA/MB. They are stable and reliable and they can be used on home-etched PCB. Downside for RPi user would be that you would almost certainly need an PIC24 or something between the RPi and MRF24W. Microchip provides free TCP/IP stack for their microcontrollers and this stack includes Zeroconf.
And the easiest way: you could simply use a WiFi dongle (with RPi) for communication. Zeroconf should be easy enough to implement on the RPi - and it's not even needed at the begining if you are ok with assigning static IP to the RPi (if it acts as a server).
This is not possible without signing up for apples MFI program. You have to pay and sign a bunch of NDA's.
https://developer.apple.com/programs/mfi/
You can use other methods, like bluetooth and connection over the audio port.
While #RokJarc's answer is pretty complete, I've also had success with both wired (lightning to usb) and wireless connections using iOS's personal hotspot. Here are the steps:
For wired, on the Pi, install ipheth-utils:
sudo apt-get install ipheth-utils
And add an eth1 network interface by editing /etc/network/interfaces to include:
allow-hotplug eth1
iface eth1 inet manual
For wireless, make sure /etc/network/interfaces has a wireless network entry such as:
allow-hotplug wlan0
iface wlan0 inet manual
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
If you are using wpa_supplicant and add a network entry for the iPhone's hotspot in /etc/wpa_supplicant/wpa_supplicant.conf:
network={
ssid="Banana Phone"
psk="ring ring ring"
key_mgmt=WPA-PSK
id_str="banana"
priority=3
}
The ssid should be the name of the phone from Settings -> General -> About -> Name and the password should come from the personal hotspot screen.
Now start the personal hotspot on your phone. The pi should automatically connect when connected by a usb to lighting cable or using wifi. After connecting, the pi should be assigned an ip somewhere in 172.20.10.x. You can run ifconfig on the pi to figure out which one. (I believe that you should be able to define a static ip here but haven't messed around with that yet)
From there, you can connect another computer to the hotspot and ssh into the pi using the 172.20.10.x ip or even ssh directly from the phone.
In my personal testing, latency over lightning is consistently low and I've used this on both a Raspberry Pi Two and Raspberry Pi Zero for streaming realtime mjpeg video from two cameras to a VR headset. In this scheme, the network is a fairly small source of the 100ms or so latency. The experience is not Vive quality of course, but it is still usable and the iPhone + Pi combo provides lots of fun hacking opportunities
It's possible to do this with Mfi.You can run usbmuxd service on your Raspberry Pi. The usbmuxd will transfer the USB data into socket packets. Your iOS App also need to implement the same protocol to rx/tx the data from/to your Raspberry Pi.
David House has already made this work. https://github.com/davidahouse/PiTalk

capture router packets using wireshark

i have two devices connected wireless on the same router. the one is my pc and the other is the smartphone. is it possible that, if i have instal the wireshark on the pc to capture the data/packets that the smartphone is sending and receiveing to a certain server which i know its ip? my pc has windows 2007 and the smartphone is an android device if its makes any difference
i try to install the shart for root on the android device but it is not working due to that my android is not rooted, and i don't wont to lose everything from my phone in order to root it
You can try using Cain & Abel. It will capture packets from your smartphone to router. To explain a bit, C&A will do ARP poisoning- meaning all the devices on your wireless network will assume that your desktop is the new router and all the incoming/outgoing traffic will go through your desktop. In this way you can capture the traffic on your phone without rooting it.
I hope this helps.

Resources