IPs in esp8266 module

Ya’akov

Joined Jan 27, 2019
9,165
The typical way to get a list of IP addresses on a network is with a sequential ARP request to each IP in the subnet. This is not a guaranteed method, though, and success will depend on your network topology (e.g.: if your router is doing proxy arp) though it is mostly successful.

Alternatively, you can use a progressive ICMP echo request, usually called "ping" to do something similar, Sometimes it is helpful to do both, redundantly, since not all TCP/IP stacks follow the rules and might respond to one but not the other. In any case, you can miss things.

A third way is passive listening. By listening to all of the traffic on the network you can slowly accumulate the IP addresses of active stations when they make broadcasts. That is, when they frames to the network address instead of the unicast address of a particular station.

This requires that the stations actually do something you can hear like an ARP or DHCP request, and takes time. You can combine this with the other methods to fill in the list where they might fail.

How you will do this depends on the programming envrionment you are using. If you are using the Arduino IDE, there are projects using the ESP for things like WiFi "deauthers", which are obnoxious and stupid things but demonstrate some of the programming. If you are using Python there are other examples.

Search for "ESP 32 arp" and "ESP 32 sniffing" for some clues.

[EDIT: ESP 32 and ESP 8266 use the same libraries, I just used the wrong part number in the text.]
 

Thread Starter

haghgoo_ma

Joined Aug 9, 2021
3
The typical way to get a list of IP addresses on a network is with a sequential ARP request to each IP in the subnet. This is not a guaranteed method, though, and success will depend on your network topology (e.g.: if your router is doing proxy arp) though it is mostly successful.

Alternatively, you can use a progressive ICMP echo request, usually called "ping" to do something similar, Sometimes it is helpful to do both, redundantly, since not all TCP/IP stacks follow the rules and might respond to one but not the other. In any case, you can miss things.

A third way is passive listening. By listening to all of the traffic on the network you can slowly accumulate the IP addresses of active stations when they make broadcasts. That is, when they frames to the network address instead of the unicast address of a particular station.

This requires that the stations actually do something you can hear like an ARP or DHCP request, and takes time. You can combine this with the other methods to fill in the list where they might fail.

How you will do this depends on the programming envrionment you are using. If you are using the Arduino IDE, there are projects using the ESP for things like WiFi "deauthers", which are obnoxious and stupid things but demonstrate some of the programming. If you are using Python there are other examples.

Search for "ESP 32 arp" and "ESP 32 sniffing" for some clues.

[EDIT: ESP 32 and ESP 8266 use the same libraries, I just used the wrong part number in the text.]
I am in Arduino IDE
I need its code
 
Top