This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/env python3 | |
import os | |
import time | |
import subprocess | |
import argparse | |
# Maps a string contained in name, description, or product_name to our custom name | |
custom_names = { | |
"Plantronics_Blackwire_5220": "PLT 5220", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nmap-uphosts() { | |
FILE=`realpath $1` | |
echo " | |
from lxml import etree | |
t = etree.parse('$FILE') | |
if \"-Pn\" in t.xpath(\"string(@args)\"): # port scan | |
hosts = t.xpath(\"/*/host[ports/port/state[@state='open']]/address[@addrtype='ipv4']/@addr\") | |
else: # ping scan | |
hosts = t.xpath(\"/*/host[status[@state='up']]/address[@addrtype='ipv4']/@addr\") | |
print(' '.join(hosts)) |
OlderNewer