How to get back a name of a hidden network i forgot - networking

I have hidden network ssid just for iot devices. My router stopped to work and i had to change it. The point is that i forgot the ssid name and i was wondering if there's a way to 'listen' the ssid those disconnected devices are trying to connect (kind of wireshark stuff).

You should be able to do that using any wireless sniffer.
Just set up Wireshark to capture wifi packets (plenty of guidelines online how to do that), chose the correct channel for the router (or make it scan all the channels).
Your IoT clients should scan for known networks every once in a while (depends on implementation) so you need to catch this scan and look for the SSID in that request.
See some more details here - https://wiki.wireshark.org/CaptureSetup/WLAN

Related

How to send data between two ESP32's over same LAN?

I want to send data(I think I can achieve it sending http requests) between two ESP's that are connected to the same LAN. I don't want to use one as an access point! I have one esp that is acting as a homekit device, and I want to send data(for example, sensor readings) to it from another esp. I've seen many tutorials where one device is acting as an access point, but that's not what I need. I also don't really need to access the esp data directly from my laptop, so I believe I don't need the html page. I would appreciate any help, code, or any existing tutorials, because I didn't find a single one.
Configuring one ESP as an AP is only done for convenience. You can configure both of them in STA (station) mode and they will connect to, e.g. your phone hotspot or your wifi router.
Connected to the same hotspot, they are on the same network, and they will be able to communicate with each other (unless the hotspot is configured to not allow this ... ). The tricky part will most likely be for the "client" to determine the IP address of the "server" in order to create the connection.
If you have admin access to the hotspot, you can cheat and hard code the IP addresses (assuming that the hotspot will assign the same IP address to the device the next time it sees it.)
It's also not difficult to use mdns (aka bonjour), which allows a network device to assign itself a local hostname. So you can name one ESP ("myserver") which allows the ESP running the client code to connect to "http://myserver.local"

Is there a way to broadcast UDP packets with ESP8266 without wifi connection?

My question is regarding an ESP8266 board and the ESP-touch technology.
ESP-touch uses the length field of a UDP package to broadcast wifi ID and PW through a device (like a smartphone) to the chip (like in my case ESP 8266).
I want to turn this around, more specifically:
I want the ESP8266 chip to broadcast UDP packets with some sort of identifier-number in the length field of the UDP packet, without beeing connected to any wifi connection. Then these UDP packets are recieved by an app on a smartphone so the identifier-number can be extracted and used on the smartphone.
I am relatively new to this topic and do not know if this can work.
When I try to find any information online they all say that the first step is to connect the chip to a wifi. But I don't want that. The smartphone and the chip don't know each other and are not connected in any way. So I want this type of "broadcasting" so that the smartphone can recieve the package without really beeing connected to the chip.
I guess there must be some way to make it function like I explained above, but I can't find a way how this can work.
I don't need the chip to send UDP packets explicitely, it can be any type of package. I took UDP packet as an example because there is already the ESP-touch technology which is more or less similar.
The important thing is that the package that I send has a field where I can put some identifier-number in (not encrypted), which can then be recieved by another device like a smartphone where this identifier-number is extracted.
For clarification: I don't need to use ESP touch or anything related to that. I only stated this technology as an example. I just want to achieve the behavior stated above and in the picture! :)
This is an example picture how I want it to work:
No, it's not possible to send any packages without being connected to the network. ESP-touch or TI Smart Config or similar technologies utilize Monitor mode. As the name suggests, in this mode one can listen for packages, but can't send them.
ESPNOW provides data flow between ESP devices without connections via router. It is another feature of the Espressive API. There are tutorials for ESP8266 and ESP32...
https://randomnerdtutorials.com/esp-now-esp8266-nodemcu-arduino-ide/ .. https://www.instructables.com/ESP32-With-ESP-Now-Protocol/

How to spoof individual BLE packets

I'm doing a security analysis project on an IoT device that uses an unencrypted BLE connection (with ATT protocol) and I want to spoof an individual BLE packet with the source address of an already connected device. Is there some tool or API that would allow me to do this easily? I've already tried gatttool and spooftooph but they seem to be connection based and don't allow you to send out single packets with modified fields (as far as I could tell).
You will need some hardware where you can access the radio peripheral directly. What you basically need to do is to find or write a ble sniffer firmware, with the modification that it at a given moment sends a packet on the connection it is currently listening to. But note that the signal strength must be stronger than the original device's signal so it doesn't interfere.
The only open source project I'm aware of is Ubertooth. You will also be able to do this with an nRF52 but then you need to write your own sniffer firmware since Nordic Semiconductor's is closed source.
I can't comment on Emils reply yet, < 50 rep:
Nordic Semis nRF Sniffer v2 needs only the nRF52DK and wireshark to work as a general BLE sniffer. At 40$ it's not that expensive. I know for a fact they will release a new dongle soon that will sell for ~10-15 bucks if you can wait a a month or two.

Forwarding data from server to router to Arduino

Basically I have an Arduino UNO that I have connected via Ethernet to my router. I have logged the IP with my server and I would like to push data to my arduino. I guess the flow of data would be to send data (not sure the best way? Should I just open up a port and stream the data?) to the router that then forwards it to my Arduino at a local address assigned by my router.
How can I tell the router to forward this information on without logging in and changing anything with the router. The point of this exercise is to do everything with code and not do any other activities like logging into the router and setting things up. I want to do this as I have my Arduino recording temperature and I want to push data to state if it should switch sending the data from degrees or Fahrenheit or visa versa.
I would use a socket server with a publish/subscribe pattern. Probably several out there but I know XSockets.NET best.
A few hours ago I actually connected my Arduino to XSockets and communicated between webpages and my arduino both ways.
I will put the code on github when I am done, but you can look at a video showing the concept here: The Stuff For You Starts At 3:20
You dont need to open any ports as long as your arduino and server is on the same local network. Since IP adresses maps all devices on a network including your arduino.
The reason you want to open ports on your router is to make people outside your local network access a server on your network. Reasons why port forwarding exists is that when someone sends a packet of data to your public IP (which is your router) it doesent know which local IP to send the packet to. It then discards it, unless you port forward a port to a local IP, which means your router sends all packets with that port to that local IP adress.
You also need to make your own server program, for example a java program to act as a server.
I made something similar to what you are looking for, but i use a wifi shield instead. I've had some problems with maintaining connections with it, but so far it seems that it's a problem with the wifi libary.
You still might learn something from it though:
Maintaining communication between Arduino and Java program
If you want to know more about how the java server works in general, here is a great tutorial which explains a lot of the basics:
http://www.thenewboston.org/watch.php?cat=25&number=38

Can the MAC address of a mobile device be easily determined?

This is somewhat of a general question, is it realistic to assume that a router can resolve any mobile device's MAC address without being already connected via wifi or bluetooth?
If the device is broadcasting, or if it's connected to another access point, then capturing the wifi data would allow you to capture the device's MAC address. Routers aren't generally set up to listen in that way, and I don't think it would be simple to configure that kind of behavior.
In general, if a device isn't connected to a wireless router/access point, you aren't going to be able to capture its MAC.

Resources