Pages

Friday, December 26, 2014

nmap scan hosts for IP, MAC Address and device Vendor/Manufacturer

$ nmap -sP 10.0.0.0/8 | grep -v "Host" | tail -n +3 | tr '\n' ' ' | sed 's|Nmap|\nNmap|g' | grep "MAC Address" | cut -d " " -f5,8-15

In the field, I needed to script a process to scan a specific vendor devices in the network. With the help of nmap, I got all the devices of that particular vendor, and started a scripted netcat session to download configuration files from a tftp server.


This is the nmap loop (part of the script). You can however, add another pipe with grep to filter the vendor/manufacturer devices only. If want to check the whole script, check in http://ift.tt/1Bb6EV9




commandlinefu.com


by David Winterbottom (codeinthehole.com)






from All commands http://ift.tt/1tlZnD9

No comments:

Post a Comment