Exploit-DB updates

Thursday, December 16, 2010

Quick Python Script/Example For Finding The Mac and IP Of Users On Your LAN.

Well I wanted a quicker way to check what hosts are on my lan other than pinging/nmap/opening a browser and generating a bunch of data. So I made this quick script to save time and display it in a shell. Very basic but it's may serve someone some good as an example. I'm still learning so if I improve it (likely) than I'll post an update.

 
import urllib
import re
users = urllib.urlopen("Your Routers Client Table URL")
users = users.read()
ips = re.findall('(?:[\d]{1,3})\.(?:[\d]{1,3})\.(?:[\d]{1,3})\.(?:[\d]{1,3})', users)
print "[=>Live Hosts<=]"
print ips
X = '([a-fA-F0-9]{2}[:|\-]){5}[a-fA-F0-9]{2}'
c = re.compile(X).finditer(users)
if c:
    for y in c:
        print users[y.start(): y.end()]

Example Picture;

No comments:

Post a Comment