![]() ![]() There might be some tool which does that for you, but I don't know any, so you'll have to script it. Yes, it's that difficult, and if you want to do it properly, you can't take shortcuts. The only command line tool I can think of for this is arping, but there's probably a better way.įor each of the IPs, do a DNS reverse lookup to uour home router, e.g. arp-scan is also less reliable, because it will try to get ARP responses over WLAN, but the hotspot already knows exactly which machines are connected.įor each of those MACs, find the corresponding IP address. That's more reliable than the arp cache, because the arp cache may not include all connected machines, and it may also include other machines on other LANs etc. Get MACs of connected stations using iw wlan0 station dump, where wlan0 is the IF of your hotspot. Typically, your home router runs a DNS server, where you either can enter which name belongs to which MAC address, or it automatically uses names if they are provided by DHCP. The ARP protocol tells you which MAC address belongs to which IP address (OSI level 3). You get the idea.Quick reminder of the layers involved: LAN and WLAN communicate using MAC addresses (OSI level 2). In addition, this assumes your wireless interface is "wlan0". It's possible for some results to not have an essid. If (iw_get_range_info(sock, "wlan0", &range) b.essid) ĭISCLAIMER: This is just a demonstration program. * Get some metadata to use for scanning */ Here is a simple program to get the ESSID for all available wireless networks. While you can use iw_set_ext and iw_get_ext, the libiw implements a basic scanning function iw_scan, from which you can extract most of the information that you need. You pretty much only need iwlib.h and iwlib.c for this question. However, the source code is pretty easy to read through. As far as I can tell, there is no web documentation for the api. ![]() If you're using Windows, type cmd into the Windows Search bar, right-click Command prompt, and then select Run as administrator. You can use the arp command on any operating system to find the MAC address of another computer on your network. ![]() All the documentation for the programming interface is in the. 1 Open a command prompt or terminal window. But using the C interface is a little more difficult so I'll focus on that.įirst of all, as other people have mentioned, definitely download out the wireless tools source code. The man pages are your friend here (check out iwconfig and iwlist). It's pretty easy to do a scan in the command line. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |