-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
603 additions
and
7 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
<?xml version="1.0"?> | ||
<?xml-stylesheet href="file:///usr/local/bin/../share/nmap/nmap.xsl" type="text/xsl"?> | ||
<!-- Nmap 5.59BETA3 scan initiated Fri Sep 9 18:33:41 2011 as: | ||
nmap -T4 -A -p 1-1000 -oX - scanme.nmap.org --> | ||
<nmaprun scanner="nmap" args="nmap -T4 -A -p 1-1000 -oX - scanme.nmap.org" start="1315618421" | ||
startstr="Fri Sep 9 18:33:41 2011" version="5.59BETA3" xmloutputversion="1.03"> | ||
<scaninfo type="syn" protocol="tcp" numservices="1000" services="1-1000"/> | ||
<verbose level="0"/> | ||
<debugging level="0"/> | ||
<host starttime="1315618421" endtime="1315618434"> | ||
<status state="up" reason="echo-reply"/> | ||
<address addr="74.207.244.221" addrtype="ipv4"/> | ||
<hostnames> | ||
<hostname name="scanme.nmap.org" type="user"/> | ||
<hostname name="li86-221.members.linode.com" type="PTR"/> | ||
</hostnames> | ||
<ports> | ||
<extraports state="closed" count="997"> | ||
<extrareasons reason="resets" count="997"/> | ||
</extraports> | ||
<port protocol="tcp" portid="22"> | ||
<state state="open" reason="syn-ack" reason_ttl="53"/> | ||
<service name="ssh" product="OpenSSH" version="5.3p1 Debian 3ubuntu7" | ||
extrainfo="protocol 2.0" ostype="Linux" method="probed" conf="10"> | ||
<cpe>cpe:/a:openbsd:openssh:5.3p1</cpe> | ||
<cpe>cpe:/o:linux:kernel</cpe> | ||
</service> | ||
<script id="ssh-hostkey" | ||
output="1024 8d:60:f1:7c:ca:b7:3d:0a:d6:67:54:9d:69:d9:b9:dd (DSA)
 | ||
2048 79:f8:09:ac:d4:e2:32:42:10:49:d3:bd:20:82:85:ec (RSA)"/> | ||
</port> | ||
<port protocol="tcp" portid="80"> | ||
<state state="open" reason="syn-ack" reason_ttl="53"/> | ||
<service name="http" product="Apache httpd" version="2.2.14" | ||
extrainfo="(Ubuntu)" method="probed" conf="10"> | ||
<cpe>cpe:/a:apache:http_server:2.2.14</cpe> | ||
</service> | ||
<script id="http-title" output="Go ahead and ScanMe!"/> | ||
</port> | ||
</ports> | ||
<os> | ||
<portused state="open" proto="tcp" portid="22"/> | ||
<portused state="closed" proto="tcp" portid="1"/> | ||
<portused state="closed" proto="udp" portid="31289"/> | ||
<osclass type="general purpose" vendor="Linux" osfamily="Linux" | ||
osgen="2.6.X" accuracy="100"> | ||
<cpe>cpe:/o:linux:linux_kernel:2.6.39</cpe> | ||
</osclass> | ||
<osmatch name="Linux 2.6.39" accuracy="100" line="39278"/> | ||
</os> | ||
<uptime seconds="23450" lastboot="Fri Sep 9 12:03:04 2011"/> | ||
<distance value="11"/> | ||
<tcpsequence index="199" difficulty="Good luck!" | ||
values="49018209,48C3EBED,495A2E7F,493EF30C,48ED43B3,495A9B0C"/> | ||
<ipidsequence class="All zeros" values="0,0,0,0,0,0"/> | ||
<tcptssequence class="1000HZ" | ||
values="165CC09,165CC6E,165CCD2,165CD36,165CD9A,165CE48"/> | ||
<trace port="256" proto="tcp"> | ||
<!-- Several hop elements removed for brevity --> | ||
<hop ttl="9" ipaddr="72.52.92.109" rtt="15.69" host="10gigabitethernet1-1.core1.fmt1.he.net"/> | ||
<hop ttl="10" ipaddr="64.62.250.6" rtt="12.06" host="linode-llc.10gigabitethernet2-3.core1.fmt1.he.net"/> | ||
<hop ttl="11" ipaddr="74.207.244.221" rtt="16.55" host="li86-221.members.linode.com"/> | ||
</trace> | ||
<times srtt="26517" rttvar="19989" to="106473"/> | ||
</host> | ||
<runstats> | ||
<finished time="1315618434" timestr="Fri Sep 9 18:33:54 2011" elapsed="13.66" | ||
summary="Nmap done at Fri Sep 9 18:33:54 2011; 1 IP address (1 host up) | ||
scanned in 13.66 seconds" exit="success"/> | ||
<hosts up="1" down="0" total="1"/> | ||
</runstats> | ||
</nmaprun> |
Large diffs are not rendered by default.
Oops, something went wrong.
Empty file.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/sh | ||
# | ||
# Before running these tests, you must define some | ||
# environment variables, such as: | ||
# | ||
# $ export NETBOX_ADDRESS="https..." | ||
# $ export NETBOX_TOKEN="..." | ||
# $ export NMAP_PATH="..." | ||
## | ||
|
||
python -m unittest tests.test_netbox | ||
python -m unittest tests.test_nmap |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import unittest | ||
from os import environ | ||
from nbs import NetBoxScanner | ||
|
||
|
||
class TestRequest(unittest.TestCase): | ||
def test_api(self): | ||
address = environ.get('NETBOX_ADDRESS') | ||
token = environ.get('NETBOX_TOKEN') | ||
|
||
netbox = NetBoxScanner(address, token, False, [], 'test', False) | ||
self.assertIsInstance(netbox, NetBoxScanner) | ||
self.assertEqual(netbox.sync(), True) | ||
|
||
|
||
if __name__ == '__main__': | ||
unittest.main() |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import unittest | ||
from os import environ | ||
from nbs.nmap import Nmap | ||
|
||
|
||
class TestRequest(unittest.TestCase): | ||
def test_api(self): | ||
path = environ.get('NMAP_PATH') | ||
|
||
nmap = Nmap(path, 'test') | ||
self.assertIsInstance(nmap, Nmap) | ||
nmap.run() | ||
self.assertIsInstance(nmap.hosts, list) | ||
|
||
|
||
if __name__ == '__main__': | ||
unittest.main() |