diff --git a/nbs/__init__.py b/nbs/__init__.py index 689d7de..d4162c9 100644 --- a/nbs/__init__.py +++ b/nbs/__init__.py @@ -5,12 +5,8 @@ class NetBoxScanner(object): - def __init__(self, netbox, hosts, tag, cleanup): - self.netbox = api( - netbox['address'], - netbox['token'], - ssl_verify=netbox.getboolean('tls_verify') - ) + def __init__(self, address, token, tls_verify, hosts, tag, cleanup): + self.netbox = api(address, token, ssl_verify=tls_verify) self.hosts = hosts self.tag = tag self.cleanup = cleanup diff --git a/netbox-scanner.py b/netbox-scanner.py index 0f4606f..b3d046b 100644 --- a/netbox-scanner.py +++ b/netbox-scanner.py @@ -53,7 +53,9 @@ def cmd_nmap(): # nmap handler h = Nmap(nmap['path'], nmap['unknown']) h.run() scan = NetBoxScanner( - netbox, + netbox['address'], + netbox['token'], + netbox.getboolean('tls_verify'), h.hosts, nmap['tag'], nmap.getboolean('cleanup') diff --git a/samples/nmap-1.xml b/samples/nmap-1.xml new file mode 100644 index 0000000..df7ecb0 --- /dev/null +++ b/samples/nmap-1.xml @@ -0,0 +1,72 @@ + + + + + + + + + +
+ + + + + + + + + + + + cpe:/a:openbsd:openssh:5.3p1 + cpe:/o:linux:kernel + +