Commit bc60b941e904252a790c16e725eb1954575cc28b
Exists in
master
Primeira versão que já identifica computadores, impressoras e ativos de rede normais
Showing
18 changed files
with
771 additions
and
66 deletions
Show diff stats
cocar/__init__.py
... | ... | @@ -6,28 +6,51 @@ import os |
6 | 6 | import ConfigParser |
7 | 7 | import logging |
8 | 8 | import logging.config |
9 | +from sqlalchemy.engine import create_engine | |
10 | +from sqlalchemy.ext.declarative import declarative_base | |
11 | +from sqlalchemy.orm import scoped_session, sessionmaker | |
9 | 12 | |
10 | -config = ConfigParser.ConfigParser() | |
11 | -here = os.path.abspath(os.path.dirname(__file__)) | |
12 | -config_file = os.path.join(here, '../development.ini') | |
13 | -config.read(config_file) | |
14 | 13 | |
15 | -# Logging | |
16 | -logging.config.fileConfig(config_file) | |
14 | +def load_config(environment='development'): | |
15 | + config = ConfigParser.ConfigParser() | |
16 | + here = os.path.abspath(os.path.dirname(__file__)) | |
17 | + config_file = os.path.join(here, '../' + environment + '.ini') | |
18 | + config.read(config_file) | |
19 | + | |
20 | + # Logging | |
21 | + logging.config.fileConfig(config_file) | |
22 | + | |
23 | + return config | |
24 | + | |
17 | 25 | |
18 | 26 | class Cocar(object): |
19 | 27 | """ |
20 | 28 | Classe global com as configurações |
21 | 29 | """ |
22 | 30 | |
23 | - def __init__(self): | |
31 | + def __init__(self, | |
32 | + environment='development' | |
33 | + ): | |
24 | 34 | """ |
25 | 35 | Parâmetro construtor |
26 | 36 | """ |
27 | - cocar_data_dir = config.get('cocar', 'data_dir') | |
37 | + self.config = load_config(environment) | |
38 | + cocar_data_dir = self.config.get('cocar', 'data_dir') | |
28 | 39 | |
29 | 40 | if os.path.isdir(cocar_data_dir): |
30 | 41 | self.cocar_data_dir = cocar_data_dir |
31 | 42 | else: |
32 | 43 | os.mkdir(cocar_data_dir) |
33 | - self.cocar_data_dir = cocar_data_dir | |
34 | 44 | \ No newline at end of file |
45 | + self.cocar_data_dir = cocar_data_dir | |
46 | + | |
47 | + # SQLAlchemy | |
48 | + sqlalchemy_url = self.config.get('sqlalchemy', 'url') | |
49 | + self.engine = create_engine(sqlalchemy_url, echo=True) | |
50 | + self.Base = declarative_base() | |
51 | + self.Base.metadata.bind = self.engine | |
52 | + self.session = scoped_session( | |
53 | + sessionmaker(bind=self.engine, | |
54 | + autocommit=True, | |
55 | + #expire_on_commit=False | |
56 | + ) | |
57 | + ) | ... | ... |
cocar/model/__init__.py
cocar/model/computer.py
... | ... | @@ -10,11 +10,13 @@ class Computer(Host): |
10 | 10 | Ativo de rede identificado como estação de trabalho |
11 | 11 | """ |
12 | 12 | def __init__(self, |
13 | - so | |
13 | + so, | |
14 | + *args, | |
15 | + **kwargs | |
14 | 16 | ): |
15 | 17 | """ |
16 | 18 | Classe que identifica uma estação de trabalho |
17 | 19 | :param so: Sistema Operacional encontrado |
18 | 20 | """ |
19 | - Host.__init__(self) | |
21 | + Host.__init__(self, *args, **kwargs) | |
20 | 22 | self.so = so |
21 | 23 | \ No newline at end of file | ... | ... |
cocar/model/host.py
... | ... | @@ -10,12 +10,11 @@ class Host(object): |
10 | 10 | """ |
11 | 11 | def __init__(self, |
12 | 12 | ip_address, |
13 | - mac_address, | |
14 | - network, | |
13 | + mac_address=None, | |
15 | 14 | hostname=None, |
16 | 15 | inclusion_date=None, |
17 | 16 | scantime=None, |
18 | - open_ports=[]): | |
17 | + open_ports=None): | |
19 | 18 | """ |
20 | 19 | Método construtor do ativo de rede |
21 | 20 | |
... | ... | @@ -30,7 +29,6 @@ class Host(object): |
30 | 29 | """ |
31 | 30 | self.ip_address = IPAddress(ip_address) |
32 | 31 | self.mac_address = mac_address |
33 | - self.network = network | |
34 | 32 | self.hostname = hostname |
35 | 33 | self.inclusion_date = inclusion_date |
36 | 34 | self.scantime = scantime | ... | ... |
cocar/model/network.py
... | ... | @@ -27,11 +27,7 @@ class Network(Cocar): |
27 | 27 | self.netmask = netmask |
28 | 28 | self.prefixlen = prefixlen |
29 | 29 | self.name = name |
30 | - self.network_dir = self.cocar_data_dir + "/" + str(self.network_ip.ip) | |
31 | - # Cria diretório se não existir | |
32 | - if not os.path.isdir(self.network_dir): | |
33 | - os.mkdir(self.network_dir) | |
34 | - | |
30 | + self.network_file = self.cocar_data_dir + "/" + str(self.network_ip.ip) + ".xml" | |
35 | 31 | if self.netmask is None: |
36 | 32 | self.netmask = self.network_ip.netmask |
37 | 33 | if self.prefixlen is None: | ... | ... |
cocar/model/printer.py
... | ... | @@ -10,16 +10,18 @@ class Printer(Host): |
10 | 10 | Classe que identifica uma impressora |
11 | 11 | """ |
12 | 12 | def __init__(self, |
13 | - counter, | |
13 | + counter=None, | |
14 | 14 | model=None, |
15 | - serial=None | |
15 | + serial=None, | |
16 | + *args, | |
17 | + **kwargs | |
16 | 18 | ): |
17 | 19 | """ |
18 | 20 | :param counter: Contador da impressora |
19 | 21 | :param model: Modelo da impressora |
20 | 22 | :param serial: Número de série da impressora |
21 | 23 | """ |
22 | - Host.__init__(self) | |
24 | + Host.__init__(self, *args, **kwargs) | |
23 | 25 | self.counter = counter |
24 | 26 | self.model = model |
25 | 27 | self.serial = serial |
26 | 28 | \ No newline at end of file | ... | ... |
cocar/session.py
... | ... | @@ -81,7 +81,7 @@ class NmapSession(Cocar): |
81 | 81 | if outfile is not None: |
82 | 82 | self.outfile = outfile |
83 | 83 | else: |
84 | - self.outfile = self.cocar_data_dir + "/" + str(self.host) + ".xml" | |
84 | + self.outfile = self.cocar_data_dir + "/" + str(self.host).replace("/", "-") + ".xml" | |
85 | 85 | |
86 | 86 | def scan(self): |
87 | 87 | """ |
... | ... | @@ -90,20 +90,22 @@ class NmapSession(Cocar): |
90 | 90 | """ |
91 | 91 | try: |
92 | 92 | if self.full: |
93 | - scanv = subprocess.Popen(["nmap", | |
93 | + scanv = subprocess.Popen(["sudo", | |
94 | + "nmap", | |
94 | 95 | "-PR", |
95 | - "-sV", | |
96 | + "-O", | |
96 | 97 | str(self.host), |
97 | 98 | "-oX", |
98 | 99 | self.outfile], |
99 | 100 | stdout=subprocess.PIPE, |
100 | 101 | stderr=subprocess.PIPE).communicate()[0] |
101 | 102 | else: |
102 | - scanv = subprocess.Popen(["nmap", | |
103 | + scanv = subprocess.Popen(["sudo", | |
104 | + "nmap", | |
103 | 105 | "-PE", |
104 | 106 | "-PP", |
105 | 107 | "-PS21,22,23,25,80,443,3306,3389,8080", |
106 | - "-sV", | |
108 | + "-O", | |
107 | 109 | str(self.host), |
108 | 110 | "-oX", |
109 | 111 | self.outfile], | ... | ... |
cocar/tests/__init__.py
1 | +#!/bin/env python | |
2 | +# -*- coding: utf-8 -*- | |
1 | 3 | __author__ = 'eduardo' |
4 | +from .. import Cocar | |
5 | +import os | |
6 | +import os.path | |
7 | + | |
8 | +cocar = Cocar(environment='test') | |
9 | +test_dir = os.path.dirname(os.path.realpath(__file__)) | |
10 | + | |
11 | + | |
12 | +def setup_package(): | |
13 | + """ | |
14 | + Setup test data for the package | |
15 | + """ | |
16 | + cocar.Base.metadata.create_all(cocar.engine) | |
17 | + pass | |
18 | + | |
19 | + | |
20 | +def teardown_package(): | |
21 | + """ | |
22 | + Remove test data | |
23 | + """ | |
24 | + cocar.Base.metadata.drop_all(cocar.engine) | |
25 | + pass | |
2 | 26 | \ No newline at end of file | ... | ... |
... | ... | @@ -0,0 +1,73 @@ |
1 | +<?xml version="1.0"?> | |
2 | +<!DOCTYPE nmaprun PUBLIC "-//IDN nmap.org//DTD Nmap XML 1.04//EN" "https://svn.nmap.org/nmap/docs/nmap.dtd"> | |
3 | +<?xml-stylesheet href="file:///usr/bin/../share/nmap/nmap.xsl" type="text/xsl"?> | |
4 | +<nmaprun scanner="nmap" args="nmap -PE -PP -PS21,22,23,25,80,443,3306,3389,8080 -O -oX 127.0.0.1.xml localhost" start="1412872886" startstr="Thu Oct 9 13:41:26 2014" version="6.46" xmloutputversion="1.04"> | |
5 | +<scaninfo type="syn" protocol="tcp" numservices="1000" services="1,3-4,6-7,9,13,17,19-26,30,32-33,37,42-43,49,53,70,79-85,88-90,99-100,106,109-111,113,119,125,135,139,143-144,146,161,163,179,199,211-212,222,254-256,259,264,280,301,306,311,340,366,389,406-407,416-417,425,427,443-445,458,464-465,481,497,500,512-515,524,541,543-545,548,554-555,563,587,593,616-617,625,631,636,646,648,666-668,683,687,691,700,705,711,714,720,722,726,749,765,777,783,787,800-801,808,843,873,880,888,898,900-903,911-912,981,987,990,992-993,995,999-1002,1007,1009-1011,1021-1100,1102,1104-1108,1110-1114,1117,1119,1121-1124,1126,1130-1132,1137-1138,1141,1145,1147-1149,1151-1152,1154,1163-1166,1169,1174-1175,1183,1185-1187,1192,1198-1199,1201,1213,1216-1218,1233-1234,1236,1244,1247-1248,1259,1271-1272,1277,1287,1296,1300-1301,1309-1311,1322,1328,1334,1352,1417,1433-1434,1443,1455,1461,1494,1500-1501,1503,1521,1524,1533,1556,1580,1583,1594,1600,1641,1658,1666,1687-1688,1700,1717-1721,1723,1755,1761,1782-1783,1801,1805,1812,1839-1840,1862-1864,1875,1900,1914,1935,1947,1971-1972,1974,1984,1998-2010,2013,2020-2022,2030,2033-2035,2038,2040-2043,2045-2049,2065,2068,2099-2100,2103,2105-2107,2111,2119,2121,2126,2135,2144,2160-2161,2170,2179,2190-2191,2196,2200,2222,2251,2260,2288,2301,2323,2366,2381-2383,2393-2394,2399,2401,2492,2500,2522,2525,2557,2601-2602,2604-2605,2607-2608,2638,2701-2702,2710,2717-2718,2725,2800,2809,2811,2869,2875,2909-2910,2920,2967-2968,2998,3000-3001,3003,3005-3007,3011,3013,3017,3030-3031,3052,3071,3077,3128,3168,3211,3221,3260-3261,3268-3269,3283,3300-3301,3306,3322-3325,3333,3351,3367,3369-3372,3389-3390,3404,3476,3493,3517,3527,3546,3551,3580,3659,3689-3690,3703,3737,3766,3784,3800-3801,3809,3814,3826-3828,3851,3869,3871,3878,3880,3889,3905,3914,3918,3920,3945,3971,3986,3995,3998,4000-4006,4045,4111,4125-4126,4129,4224,4242,4279,4321,4343,4443-4446,4449,4550,4567,4662,4848,4899-4900,4998,5000-5004,5009,5030,5033,5050-5051,5054,5060-5061,5080,5087,5100-5102,5120,5190,5200,5214,5221-5222,5225-5226,5269,5280,5298,5357,5405,5414,5431-5432,5440,5500,5510,5544,5550,5555,5560,5566,5631,5633,5666,5678-5679,5718,5730,5800-5802,5810-5811,5815,5822,5825,5850,5859,5862,5877,5900-5904,5906-5907,5910-5911,5915,5922,5925,5950,5952,5959-5963,5987-5989,5998-6007,6009,6025,6059,6100-6101,6106,6112,6123,6129,6156,6346,6389,6502,6510,6543,6547,6565-6567,6580,6646,6666-6669,6689,6692,6699,6779,6788-6789,6792,6839,6881,6901,6969,7000-7002,7004,7007,7019,7025,7070,7100,7103,7106,7200-7201,7402,7435,7443,7496,7512,7625,7627,7676,7741,7777-7778,7800,7911,7920-7921,7937-7938,7999-8002,8007-8011,8021-8022,8031,8042,8045,8080-8090,8093,8099-8100,8180-8181,8192-8194,8200,8222,8254,8290-8292,8300,8333,8383,8400,8402,8443,8500,8600,8649,8651-8652,8654,8701,8800,8873,8888,8899,8994,9000-9003,9009-9011,9040,9050,9071,9080-9081,9090-9091,9099-9103,9110-9111,9200,9207,9220,9290,9415,9418,9485,9500,9502-9503,9535,9575,9593-9595,9618,9666,9876-9878,9898,9900,9917,9929,9943-9944,9968,9998-10004,10009-10010,10012,10024-10025,10082,10180,10215,10243,10566,10616-10617,10621,10626,10628-10629,10778,11110-11111,11967,12000,12174,12265,12345,13456,13722,13782-13783,14000,14238,14441-14442,15000,15002-15004,15660,15742,16000-16001,16012,16016,16018,16080,16113,16992-16993,17877,17988,18040,18101,18988,19101,19283,19315,19350,19780,19801,19842,20000,20005,20031,20221-20222,20828,21571,22939,23502,24444,24800,25734-25735,26214,27000,27352-27353,27355-27356,27715,28201,30000,30718,30951,31038,31337,32768-32785,33354,33899,34571-34573,35500,38292,40193,40911,41511,42510,44176,44442-44443,44501,45100,48080,49152-49161,49163,49165,49167,49175-49176,49400,49999-50003,50006,50300,50389,50500,50636,50800,51103,51493,52673,52822,52848,52869,54045,54328,55055-55056,55555,55600,56737-56738,57294,57797,58080,60020,60443,61532,61900,62078,63331,64623,64680,65000,65129,65389"/> | |
6 | +<verbose level="0"/> | |
7 | +<debugging level="0"/> | |
8 | +<host starttime="1412872886" endtime="1412872991"><status state="up" reason="localhost-response" reason_ttl="0"/> | |
9 | +<address addr="127.0.0.1" addrtype="ipv4"/> | |
10 | +<hostnames> | |
11 | +<hostname name="localhost" type="user"/> | |
12 | +<hostname name="localhost" type="PTR"/> | |
13 | +</hostnames> | |
14 | +<ports><extraports state="closed" count="990"> | |
15 | +<extrareasons reason="resets" count="990"/> | |
16 | +</extraports> | |
17 | +<port protocol="tcp" portid="22"><state state="open" reason="syn-ack" reason_ttl="64"/><service name="ssh" method="table" conf="3"/></port> | |
18 | +<port protocol="tcp" portid="25"><state state="open" reason="syn-ack" reason_ttl="64"/><service name="smtp" method="table" conf="3"/></port> | |
19 | +<port protocol="tcp" portid="80"><state state="open" reason="syn-ack" reason_ttl="64"/><service name="http" method="table" conf="3"/></port> | |
20 | +<port protocol="tcp" portid="111"><state state="open" reason="syn-ack" reason_ttl="64"/><service name="rpcbind" method="table" conf="3"/></port> | |
21 | +<port protocol="tcp" portid="443"><state state="open" reason="syn-ack" reason_ttl="64"/><service name="https" method="table" conf="3"/></port> | |
22 | +<port protocol="tcp" portid="631"><state state="open" reason="syn-ack" reason_ttl="64"/><service name="ipp" method="table" conf="3"/></port> | |
23 | +<port protocol="tcp" portid="3389"><state state="open" reason="syn-ack" reason_ttl="64"/><service name="ms-wbt-server" method="table" conf="3"/></port> | |
24 | +<port protocol="tcp" portid="5432"><state state="open" reason="syn-ack" reason_ttl="64"/><service name="postgresql" method="table" conf="3"/></port> | |
25 | +<port protocol="tcp" portid="5800"><state state="open" reason="syn-ack" reason_ttl="64"/><service name="vnc-http" method="table" conf="3"/></port> | |
26 | +<port protocol="tcp" portid="5900"><state state="open" reason="syn-ack" reason_ttl="64"/><service name="vnc" method="table" conf="3"/></port> | |
27 | +</ports> | |
28 | +<os><portused state="open" proto="tcp" portid="22"/> | |
29 | +<portused state="closed" proto="tcp" portid="1"/> | |
30 | +<portused state="closed" proto="udp" portid="38006"/> | |
31 | +<osmatch name="Linux 3.7 - 3.9" accuracy="98" line="48947"> | |
32 | +<osclass type="general purpose" vendor="Linux" osfamily="Linux" osgen="3.X" accuracy="98"><cpe>cpe:/o:linux:linux_kernel:3</cpe></osclass> | |
33 | +</osmatch> | |
34 | +<osmatch name="Netgear DG834G WAP or Western Digital WD TV media player" accuracy="95" line="63671"> | |
35 | +<osclass type="WAP" vendor="Netgear" osfamily="embedded" accuracy="95"><cpe>cpe:/h:netgear:dg834g</cpe></osclass> | |
36 | +<osclass type="media device" vendor="Western Digital" osfamily="embedded" accuracy="95"><cpe>cpe:/o:westerndigital:wd_tv</cpe></osclass> | |
37 | +</osmatch> | |
38 | +<osmatch name="Linux 3.8" accuracy="95" line="48965"> | |
39 | +<osclass type="general purpose" vendor="Linux" osfamily="Linux" osgen="3.X" accuracy="95"><cpe>cpe:/o:linux:linux_kernel:3</cpe></osclass> | |
40 | +</osmatch> | |
41 | +<osmatch name="Linux 3.1" accuracy="93" line="48343"> | |
42 | +<osclass type="general purpose" vendor="Linux" osfamily="Linux" osgen="3.X" accuracy="93"><cpe>cpe:/o:linux:linux_kernel:3</cpe></osclass> | |
43 | +</osmatch> | |
44 | +<osmatch name="Linux 3.2" accuracy="93" line="48506"> | |
45 | +<osclass type="general purpose" vendor="Linux" osfamily="Linux" osgen="3.X" accuracy="93"><cpe>cpe:/o:linux:linux_kernel:3</cpe></osclass> | |
46 | +</osmatch> | |
47 | +<osmatch name="AXIS 210A or 211 Network Camera (Linux 2.6)" accuracy="92" line="7356"> | |
48 | +<osclass type="webcam" vendor="AXIS" osfamily="Linux" osgen="2.6.X" accuracy="92"><cpe>cpe:/h:axis:210a_network_camera</cpe><cpe>cpe:/h:axis:211_network_camera</cpe><cpe>cpe:/o:axis:linux_kernel:2.6</cpe></osclass> | |
49 | +</osmatch> | |
50 | +<osmatch name="Linux 3.7" accuracy="92" line="48889"> | |
51 | +<osclass type="general purpose" vendor="Linux" osfamily="Linux" osgen="3.X" accuracy="92"><cpe>cpe:/o:linux:linux_kernel:3</cpe></osclass> | |
52 | +</osmatch> | |
53 | +<osmatch name="Linux 3.9" accuracy="91" line="49019"> | |
54 | +<osclass type="general purpose" vendor="Linux" osfamily="Linux" osgen="3.X" accuracy="91"><cpe>cpe:/o:linux:linux_kernel:3</cpe></osclass> | |
55 | +</osmatch> | |
56 | +<osmatch name="Linux 2.4.26 (Slackware 10.0.0)" accuracy="91" line="35315"> | |
57 | +<osclass type="general purpose" vendor="Linux" osfamily="Linux" osgen="2.4.X" accuracy="91"><cpe>cpe:/o:linux:linux_kernel:2.4.26</cpe></osclass> | |
58 | +</osmatch> | |
59 | +<osmatch name="Crestron XPanel control system" accuracy="91" line="15955"> | |
60 | +<osclass type="specialized" vendor="Crestron" osfamily="2-Series" accuracy="91"><cpe>cpe:/o:crestron:2_series</cpe></osclass> | |
61 | +</osmatch> | |
62 | +<osfingerprint fingerprint="OS:SCAN(V=6.46%E=4%D=10/9%OT=22%CT=1%CU=38006%PV=N%DS=0%DC=L%G=Y%TM=5436BB1
OS:F%P=x86_64-pc-linux-gnu)SEQ(SP=106%GCD=1%ISR=10A%TI=Z%CI=I%TS=8)OPS(O1=M
OS:FFD7ST11NW7%O2=MFFD7ST11NW7%O3=MFFD7NNT11NW7%O4=MFFD7ST11NW7%O5=MFFD7ST1
OS:1NW7%O6=MFFD7ST11)WIN(W1=AAAA%W2=AAAA%W3=AAAA%W4=AAAA%W5=AAAA%W6=AAAA)EC
OS:N(R=Y%DF=Y%T=40%W=AAAA%O=MFFD7NNSNW7%CC=Y%Q=)T1(R=Y%DF=Y%T=40%S=O%A=S+%F
OS:=AS%RD=0%Q=)T2(R=N)T3(R=N)T4(R=Y%DF=Y%T=40%W=0%S=A%A=Z%F=R%O=%RD=0%Q=)T5
OS:(R=Y%DF=Y%T=40%W=0%S=Z%A=S+%F=AR%O=%RD=0%Q=)T6(R=Y%DF=Y%T=40%W=0%S=A%A=Z
OS:%F=R%O=%RD=0%Q=)T7(R=Y%DF=Y%T=40%W=0%S=Z%A=S+%F=AR%O=%RD=0%Q=)U1(R=Y%DF=
OS:N%T=40%IPL=164%UN=0%RIPL=G%RID=G%RIPCK=G%RUCK=G%RUD=G)IE(R=Y%DFI=N%T=40%
OS:CD=S)
"/> | |
63 | +</os> | |
64 | +<uptime seconds="218130" lastboot="Tue Oct 7 01:07:41 2014"/> | |
65 | +<distance value="0"/> | |
66 | +<tcpsequence index="262" difficulty="Good luck!" values="9C961A5C,58573809,489579FD,59BCFDD9,DEF7CB58,27EC9FE2"/> | |
67 | +<ipidsequence class="All zeros" values="0,0,0,0,0,0"/> | |
68 | +<tcptssequence class="other" values="340183F,3401858,3401871,340188A,34018A3,34018BC"/> | |
69 | +<times srtt="27" rttvar="3" to="100000"/> | |
70 | +</host> | |
71 | +<runstats><finished time="1412872991" timestr="Thu Oct 9 13:43:11 2014" elapsed="105.42" summary="Nmap done at Thu Oct 9 13:43:11 2014; 1 IP address (1 host up) scanned in 105.42 seconds" exit="success"/><hosts up="1" down="0" total="1"/> | |
72 | +</runstats> | |
73 | +</nmaprun> | ... | ... |
... | ... | @@ -0,0 +1,264 @@ |
1 | +<?xml version="1.0"?> | |
2 | +<!DOCTYPE nmaprun PUBLIC "-//IDN nmap.org//DTD Nmap XML 1.04//EN" "https://svn.nmap.org/nmap/docs/nmap.dtd"> | |
3 | +<?xml-stylesheet href="file:///usr/bin/../share/nmap/nmap.xsl" type="text/xsl"?> | |
4 | +<nmaprun scanner="nmap" args="nmap -PE -PP -PS21,22,23,25,80,443,3306,3389,8080 -O -oX 192.168.0.0-24.xml 192.168.0.0/24" start="1412881282" startstr="Thu Oct 9 16:01:22 2014" version="6.46" xmloutputversion="1.04"> | |
5 | +<scaninfo type="syn" protocol="tcp" numservices="1000" services="1,3-4,6-7,9,13,17,19-26,30,32-33,37,42-43,49,53,70,79-85,88-90,99-100,106,109-111,113,119,125,135,139,143-144,146,161,163,179,199,211-212,222,254-256,259,264,280,301,306,311,340,366,389,406-407,416-417,425,427,443-445,458,464-465,481,497,500,512-515,524,541,543-545,548,554-555,563,587,593,616-617,625,631,636,646,648,666-668,683,687,691,700,705,711,714,720,722,726,749,765,777,783,787,800-801,808,843,873,880,888,898,900-903,911-912,981,987,990,992-993,995,999-1002,1007,1009-1011,1021-1100,1102,1104-1108,1110-1114,1117,1119,1121-1124,1126,1130-1132,1137-1138,1141,1145,1147-1149,1151-1152,1154,1163-1166,1169,1174-1175,1183,1185-1187,1192,1198-1199,1201,1213,1216-1218,1233-1234,1236,1244,1247-1248,1259,1271-1272,1277,1287,1296,1300-1301,1309-1311,1322,1328,1334,1352,1417,1433-1434,1443,1455,1461,1494,1500-1501,1503,1521,1524,1533,1556,1580,1583,1594,1600,1641,1658,1666,1687-1688,1700,1717-1721,1723,1755,1761,1782-1783,1801,1805,1812,1839-1840,1862-1864,1875,1900,1914,1935,1947,1971-1972,1974,1984,1998-2010,2013,2020-2022,2030,2033-2035,2038,2040-2043,2045-2049,2065,2068,2099-2100,2103,2105-2107,2111,2119,2121,2126,2135,2144,2160-2161,2170,2179,2190-2191,2196,2200,2222,2251,2260,2288,2301,2323,2366,2381-2383,2393-2394,2399,2401,2492,2500,2522,2525,2557,2601-2602,2604-2605,2607-2608,2638,2701-2702,2710,2717-2718,2725,2800,2809,2811,2869,2875,2909-2910,2920,2967-2968,2998,3000-3001,3003,3005-3007,3011,3013,3017,3030-3031,3052,3071,3077,3128,3168,3211,3221,3260-3261,3268-3269,3283,3300-3301,3306,3322-3325,3333,3351,3367,3369-3372,3389-3390,3404,3476,3493,3517,3527,3546,3551,3580,3659,3689-3690,3703,3737,3766,3784,3800-3801,3809,3814,3826-3828,3851,3869,3871,3878,3880,3889,3905,3914,3918,3920,3945,3971,3986,3995,3998,4000-4006,4045,4111,4125-4126,4129,4224,4242,4279,4321,4343,4443-4446,4449,4550,4567,4662,4848,4899-4900,4998,5000-5004,5009,5030,5033,5050-5051,5054,5060-5061,5080,5087,5100-5102,5120,5190,5200,5214,5221-5222,5225-5226,5269,5280,5298,5357,5405,5414,5431-5432,5440,5500,5510,5544,5550,5555,5560,5566,5631,5633,5666,5678-5679,5718,5730,5800-5802,5810-5811,5815,5822,5825,5850,5859,5862,5877,5900-5904,5906-5907,5910-5911,5915,5922,5925,5950,5952,5959-5963,5987-5989,5998-6007,6009,6025,6059,6100-6101,6106,6112,6123,6129,6156,6346,6389,6502,6510,6543,6547,6565-6567,6580,6646,6666-6669,6689,6692,6699,6779,6788-6789,6792,6839,6881,6901,6969,7000-7002,7004,7007,7019,7025,7070,7100,7103,7106,7200-7201,7402,7435,7443,7496,7512,7625,7627,7676,7741,7777-7778,7800,7911,7920-7921,7937-7938,7999-8002,8007-8011,8021-8022,8031,8042,8045,8080-8090,8093,8099-8100,8180-8181,8192-8194,8200,8222,8254,8290-8292,8300,8333,8383,8400,8402,8443,8500,8600,8649,8651-8652,8654,8701,8800,8873,8888,8899,8994,9000-9003,9009-9011,9040,9050,9071,9080-9081,9090-9091,9099-9103,9110-9111,9200,9207,9220,9290,9415,9418,9485,9500,9502-9503,9535,9575,9593-9595,9618,9666,9876-9878,9898,9900,9917,9929,9943-9944,9968,9998-10004,10009-10010,10012,10024-10025,10082,10180,10215,10243,10566,10616-10617,10621,10626,10628-10629,10778,11110-11111,11967,12000,12174,12265,12345,13456,13722,13782-13783,14000,14238,14441-14442,15000,15002-15004,15660,15742,16000-16001,16012,16016,16018,16080,16113,16992-16993,17877,17988,18040,18101,18988,19101,19283,19315,19350,19780,19801,19842,20000,20005,20031,20221-20222,20828,21571,22939,23502,24444,24800,25734-25735,26214,27000,27352-27353,27355-27356,27715,28201,30000,30718,30951,31038,31337,32768-32785,33354,33899,34571-34573,35500,38292,40193,40911,41511,42510,44176,44442-44443,44501,45100,48080,49152-49161,49163,49165,49167,49175-49176,49400,49999-50003,50006,50300,50389,50500,50636,50800,51103,51493,52673,52822,52848,52869,54045,54328,55055-55056,55555,55600,56737-56738,57294,57797,58080,60020,60443,61532,61900,62078,63331,64623,64680,65000,65129,65389"/> | |
6 | +<verbose level="0"/> | |
7 | +<debugging level="0"/> | |
8 | +<host starttime="1412881282" endtime="1412881504"><status state="up" reason="arp-response" reason_ttl="0"/> | |
9 | +<address addr="192.168.0.1" addrtype="ipv4"/> | |
10 | +<address addr="90:0D:CB:08:3B:32" addrtype="mac" vendor="Arris Group"/> | |
11 | +<hostnames> | |
12 | +</hostnames> | |
13 | +<ports><extraports state="filtered" count="991"> | |
14 | +<extrareasons reason="no-responses" count="991"/> | |
15 | +</extraports> | |
16 | +<port protocol="tcp" portid="22"><state state="closed" reason="reset" reason_ttl="64"/><service name="ssh" method="table" conf="3"/></port> | |
17 | +<port protocol="tcp" portid="23"><state state="closed" reason="reset" reason_ttl="64"/><service name="telnet" method="table" conf="3"/></port> | |
18 | +<port protocol="tcp" portid="80"><state state="open" reason="syn-ack" reason_ttl="64"/><service name="http" method="table" conf="3"/></port> | |
19 | +<port protocol="tcp" portid="199"><state state="closed" reason="reset" reason_ttl="64"/><service name="smux" method="table" conf="3"/></port> | |
20 | +<port protocol="tcp" portid="554"><state state="closed" reason="reset" reason_ttl="64"/><service name="rtsp" method="table" conf="3"/></port> | |
21 | +<port protocol="tcp" portid="587"><state state="closed" reason="reset" reason_ttl="64"/><service name="submission" method="table" conf="3"/></port> | |
22 | +<port protocol="tcp" portid="1025"><state state="closed" reason="reset" reason_ttl="64"/><service name="NFS-or-IIS" method="table" conf="3"/></port> | |
23 | +<port protocol="tcp" portid="5900"><state state="closed" reason="reset" reason_ttl="64"/><service name="vnc" method="table" conf="3"/></port> | |
24 | +<port protocol="tcp" portid="8080"><state state="open" reason="syn-ack" reason_ttl="64"/><service name="http-proxy" method="table" conf="3"/></port> | |
25 | +</ports> | |
26 | +<os><portused state="open" proto="tcp" portid="80"/> | |
27 | +<portused state="closed" proto="tcp" portid="22"/> | |
28 | +<portused state="closed" proto="udp" portid="37589"/> | |
29 | +<osmatch name="Linux 2.6.9 - 2.6.33" accuracy="97" line="46738"> | |
30 | +<osclass type="general purpose" vendor="Linux" osfamily="Linux" osgen="2.6.X" accuracy="97"><cpe>cpe:/o:linux:linux_kernel:2.6</cpe></osclass> | |
31 | +</osmatch> | |
32 | +<osmatch name="Linux 2.6.15 - 2.6.30" accuracy="97" line="37014"> | |
33 | +<osclass type="general purpose" vendor="Linux" osfamily="Linux" osgen="2.6.X" accuracy="97"><cpe>cpe:/o:linux:linux_kernel:2.6</cpe></osclass> | |
34 | +</osmatch> | |
35 | +<osmatch name="Linux 2.6.18 - 2.6.21" accuracy="96" line="38525"> | |
36 | +<osclass type="general purpose" vendor="Linux" osfamily="Linux" osgen="2.6.X" accuracy="96"><cpe>cpe:/o:linux:linux_kernel:2.6</cpe></osclass> | |
37 | +</osmatch> | |
38 | +<osmatch name="Linux 2.6.32" accuracy="96" line="42857"> | |
39 | +<osclass type="general purpose" vendor="Linux" osfamily="Linux" osgen="2.6.X" accuracy="96"><cpe>cpe:/o:linux:linux_kernel:2.6.32</cpe></osclass> | |
40 | +</osmatch> | |
41 | +<osmatch name="Linux 2.6.9 - 2.6.18" accuracy="96" line="46443"> | |
42 | +<osclass type="general purpose" vendor="Linux" osfamily="Linux" osgen="2.6.X" accuracy="96"><cpe>cpe:/o:linux:linux_kernel:2.6</cpe></osclass> | |
43 | +</osmatch> | |
44 | +<osmatch name="Linux 2.6.22 (embedded, ARM)" accuracy="96" line="40086"> | |
45 | +<osclass type="general purpose" vendor="Linux" osfamily="Linux" osgen="2.6.X" accuracy="96"><cpe>cpe:/o:linux:linux_kernel:2.6.22</cpe></osclass> | |
46 | +</osmatch> | |
47 | +<osmatch name="Linux 2.6.18 - 2.6.24" accuracy="96" line="38583"> | |
48 | +<osclass type="general purpose" vendor="Linux" osfamily="Linux" osgen="2.6.X" accuracy="96"><cpe>cpe:/o:linux:linux_kernel:2.6</cpe></osclass> | |
49 | +</osmatch> | |
50 | +<osmatch name="Citrix XenServer (Linux 2.6.18)" accuracy="96" line="15512"> | |
51 | +<osclass type="general purpose" vendor="Citrix" osfamily="Linux" osgen="2.6.X" accuracy="96"><cpe>cpe:/o:citrix:linux_kernel:2.6</cpe></osclass> | |
52 | +</osmatch> | |
53 | +<osmatch name="Linux 2.6.27 - 2.6.28" accuracy="96" line="41966"> | |
54 | +<osclass type="general purpose" vendor="Linux" osfamily="Linux" osgen="2.6.X" accuracy="96"><cpe>cpe:/o:linux:linux_kernel:2.6</cpe></osclass> | |
55 | +</osmatch> | |
56 | +<osmatch name="Netgear DG834G WAP or Western Digital WD TV media player" accuracy="95" line="63671"> | |
57 | +<osclass type="WAP" vendor="Netgear" osfamily="embedded" accuracy="95"><cpe>cpe:/h:netgear:dg834g</cpe></osclass> | |
58 | +<osclass type="media device" vendor="Western Digital" osfamily="embedded" accuracy="95"><cpe>cpe:/o:westerndigital:wd_tv</cpe></osclass> | |
59 | +</osmatch> | |
60 | +<osfingerprint fingerprint="OS:SCAN(V=6.46%E=4%D=10/9%OT=80%CT=22%CU=37589%PV=Y%DS=1%DC=D%G=Y%M=900DCB%
OS:TM=5436DC60%P=x86_64-pc-linux-gnu)SEQ(SP=CC%GCD=1%ISR=D1%TI=Z%CI=Z%TS=7)
OS:OPS(O1=M5B4ST11NW4%O2=M5B4ST11NW4%O3=M5B4NNT11NW4%O4=M5B4ST11NW4%O5=M5B4
OS:ST11NW4%O6=M5B4ST11)WIN(W1=16A0%W2=16A0%W3=16A0%W4=16A0%W5=16A0%W6=16A0)
OS:ECN(R=Y%DF=Y%T=40%W=16D0%O=M5B4NNSNW4%CC=N%Q=)T1(R=Y%DF=Y%T=40%S=O%A=S+%
OS:F=AS%RD=0%Q=)T2(R=N)T3(R=N)T4(R=Y%DF=Y%T=40%W=0%S=A%A=Z%F=R%O=%RD=0%Q=)T
OS:5(R=Y%DF=Y%T=40%W=0%S=Z%A=S+%F=AR%O=%RD=0%Q=)T6(R=Y%DF=Y%T=40%W=0%S=A%A=
OS:Z%F=R%O=%RD=0%Q=)T7(R=Y%DF=Y%T=40%W=0%S=Z%A=S+%F=AR%O=%RD=0%Q=)U1(R=Y%DF
OS:=N%T=40%IPL=164%UN=0%RIPL=G%RID=G%RIPCK=G%RUCK=G%RUD=G)IE(R=Y%DFI=N%T=40
OS:%CD=S)
"/> | |
61 | +</os> | |
62 | +<uptime seconds="198435" lastboot="Tue Oct 7 08:57:49 2014"/> | |
63 | +<distance value="1"/> | |
64 | +<tcpsequence index="204" difficulty="Good luck!" values="2E6D024F,2F3AE111,2EE75F17,2EA8DE55,2E8EC24A,2F384BB2"/> | |
65 | +<ipidsequence class="All zeros" values="0,0,0,0,0,0"/> | |
66 | +<tcptssequence class="100HZ" values="12EC90C,12EC916,12EC920,12EC92A,12EC934,12EC93E"/> | |
67 | +<times srtt="1112" rttvar="312" to="100000"/> | |
68 | +</host> | |
69 | +<host starttime="1412881282" endtime="1412881494"><status state="up" reason="arp-response" reason_ttl="0"/> | |
70 | +<address addr="192.168.0.2" addrtype="ipv4"/> | |
71 | +<address addr="78:1F:DB:18:D5:7E" addrtype="mac" vendor="Samsung Electronics Co."/> | |
72 | +<hostnames> | |
73 | +</hostnames> | |
74 | +<ports><extraports state="closed" count="1000"> | |
75 | +<extrareasons reason="resets" count="1000"/> | |
76 | +</extraports> | |
77 | +</ports> | |
78 | +<os><portused state="closed" proto="tcp" portid="1"/> | |
79 | +<portused state="closed" proto="udp" portid="35311"/> | |
80 | +</os> | |
81 | +<distance value="1"/> | |
82 | +<times srtt="2831" rttvar="1071" to="100000"/> | |
83 | +</host> | |
84 | +<host starttime="1412881282" endtime="1412881491"><status state="up" reason="arp-response" reason_ttl="0"/> | |
85 | +<address addr="192.168.0.8" addrtype="ipv4"/> | |
86 | +<address addr="54:42:49:71:D6:C5" addrtype="mac" vendor="Sony"/> | |
87 | +<hostnames> | |
88 | +</hostnames> | |
89 | +<ports><extraports state="filtered" count="995"> | |
90 | +<extrareasons reason="no-responses" count="995"/> | |
91 | +</extraports> | |
92 | +<port protocol="tcp" portid="135"><state state="open" reason="syn-ack" reason_ttl="128"/><service name="msrpc" method="table" conf="3"/></port> | |
93 | +<port protocol="tcp" portid="139"><state state="open" reason="syn-ack" reason_ttl="128"/><service name="netbios-ssn" method="table" conf="3"/></port> | |
94 | +<port protocol="tcp" portid="445"><state state="open" reason="syn-ack" reason_ttl="128"/><service name="microsoft-ds" method="table" conf="3"/></port> | |
95 | +<port protocol="tcp" portid="2869"><state state="open" reason="syn-ack" reason_ttl="128"/><service name="icslap" method="table" conf="3"/></port> | |
96 | +<port protocol="tcp" portid="49156"><state state="open" reason="syn-ack" reason_ttl="128"/><service name="unknown" method="table" conf="3"/></port> | |
97 | +</ports> | |
98 | +<os><portused state="open" proto="tcp" portid="135"/> | |
99 | +<osmatch name="Microsoft Windows Vista SP0 or SP1, Windows Server 2008 SP1, or Windows 7" accuracy="100" line="56574"> | |
100 | +<osclass type="general purpose" vendor="Microsoft" osfamily="Windows" osgen="Vista" accuracy="100"><cpe>cpe:/o:microsoft:windows_vista::-</cpe><cpe>cpe:/o:microsoft:windows_vista::sp1</cpe></osclass> | |
101 | +<osclass type="general purpose" vendor="Microsoft" osfamily="Windows" osgen="2008" accuracy="100"><cpe>cpe:/o:microsoft:windows_server_2008::sp1</cpe></osclass> | |
102 | +<osclass type="general purpose" vendor="Microsoft" osfamily="Windows" osgen="7" accuracy="100"><cpe>cpe:/o:microsoft:windows_7</cpe></osclass> | |
103 | +</osmatch> | |
104 | +</os> | |
105 | +<uptime seconds="721" lastboot="Thu Oct 9 15:53:03 2014"/> | |
106 | +<distance value="1"/> | |
107 | +<tcpsequence index="250" difficulty="Good luck!" values="1471FB3D,819A1AEC,FA2C7FB8,4E06EAE0,A3996351,50BA8F3"/> | |
108 | +<ipidsequence class="Incremental" values="2CE,2CF,2D0,2D1,2D2,2D3"/> | |
109 | +<tcptssequence class="100HZ" values="113EF,113F9,11403,1140D,11417,11421"/> | |
110 | +<times srtt="620" rttvar="57" to="100000"/> | |
111 | +</host> | |
112 | +<host starttime="1412881282" endtime="1412881504"><status state="up" reason="arp-response" reason_ttl="0"/> | |
113 | +<address addr="192.168.0.200" addrtype="ipv4"/> | |
114 | +<address addr="0C:EE:E6:C9:20:9E" addrtype="mac" vendor="Hon Hai Precision Ind. Co."/> | |
115 | +<hostnames> | |
116 | +<hostname name="server.lan" type="PTR"/> | |
117 | +</hostnames> | |
118 | +<ports><extraports state="closed" count="988"> | |
119 | +<extrareasons reason="resets" count="988"/> | |
120 | +</extraports> | |
121 | +<port protocol="tcp" portid="22"><state state="open" reason="syn-ack" reason_ttl="64"/><service name="ssh" method="table" conf="3"/></port> | |
122 | +<port protocol="tcp" portid="80"><state state="open" reason="syn-ack" reason_ttl="64"/><service name="http" method="table" conf="3"/></port> | |
123 | +<port protocol="tcp" portid="111"><state state="open" reason="syn-ack" reason_ttl="64"/><service name="rpcbind" method="table" conf="3"/></port> | |
124 | +<port protocol="tcp" portid="139"><state state="open" reason="syn-ack" reason_ttl="64"/><service name="netbios-ssn" method="table" conf="3"/></port> | |
125 | +<port protocol="tcp" portid="443"><state state="open" reason="syn-ack" reason_ttl="64"/><service name="https" method="table" conf="3"/></port> | |
126 | +<port protocol="tcp" portid="445"><state state="open" reason="syn-ack" reason_ttl="64"/><service name="microsoft-ds" method="table" conf="3"/></port> | |
127 | +<port protocol="tcp" portid="2049"><state state="open" reason="syn-ack" reason_ttl="64"/><service name="nfs" method="table" conf="3"/></port> | |
128 | +<port protocol="tcp" portid="3306"><state state="open" reason="syn-ack" reason_ttl="64"/><service name="mysql" method="table" conf="3"/></port> | |
129 | +<port protocol="tcp" portid="8001"><state state="open" reason="syn-ack" reason_ttl="64"/><service name="vcom-tunnel" method="table" conf="3"/></port> | |
130 | +<port protocol="tcp" portid="8080"><state state="open" reason="syn-ack" reason_ttl="64"/><service name="http-proxy" method="table" conf="3"/></port> | |
131 | +<port protocol="tcp" portid="9200"><state state="open" reason="syn-ack" reason_ttl="64"/><service name="wap-wsp" method="table" conf="3"/></port> | |
132 | +<port protocol="tcp" portid="49152"><state state="open" reason="syn-ack" reason_ttl="64"/><service name="unknown" method="table" conf="3"/></port> | |
133 | +</ports> | |
134 | +<os><portused state="open" proto="tcp" portid="22"/> | |
135 | +<portused state="closed" proto="tcp" portid="1"/> | |
136 | +<portused state="closed" proto="udp" portid="35016"/> | |
137 | +<osmatch name="Linux 2.6.32 - 3.9" accuracy="98" line="44376"> | |
138 | +<osclass type="general purpose" vendor="Linux" osfamily="Linux" osgen="2.6.X" accuracy="98"><cpe>cpe:/o:linux:linux_kernel:2.6</cpe></osclass> | |
139 | +<osclass type="general purpose" vendor="Linux" osfamily="Linux" osgen="3.X" accuracy="98"><cpe>cpe:/o:linux:linux_kernel:3</cpe></osclass> | |
140 | +</osmatch> | |
141 | +<osmatch name="Netgear DG834G WAP or Western Digital WD TV media player" accuracy="95" line="63671"> | |
142 | +<osclass type="WAP" vendor="Netgear" osfamily="embedded" accuracy="95"><cpe>cpe:/h:netgear:dg834g</cpe></osclass> | |
143 | +<osclass type="media device" vendor="Western Digital" osfamily="embedded" accuracy="95"><cpe>cpe:/o:westerndigital:wd_tv</cpe></osclass> | |
144 | +</osmatch> | |
145 | +<osmatch name="Linux 2.6.32 - 3.2" accuracy="95" line="44231"> | |
146 | +<osclass type="general purpose" vendor="Linux" osfamily="Linux" osgen="2.6.X" accuracy="95"><cpe>cpe:/o:linux:linux_kernel:2.6</cpe></osclass> | |
147 | +<osclass type="general purpose" vendor="Linux" osfamily="Linux" osgen="3.X" accuracy="95"><cpe>cpe:/o:linux:linux_kernel:3</cpe></osclass> | |
148 | +</osmatch> | |
149 | +<osmatch name="Linux 2.6.38 - 3.5" accuracy="95" line="45597"> | |
150 | +<osclass type="general purpose" vendor="Linux" osfamily="Linux" osgen="2.6.X" accuracy="95"><cpe>cpe:/o:linux:linux_kernel:2.6</cpe></osclass> | |
151 | +<osclass type="general purpose" vendor="Linux" osfamily="Linux" osgen="3.X" accuracy="95"><cpe>cpe:/o:linux:linux_kernel:3</cpe></osclass> | |
152 | +</osmatch> | |
153 | +<osmatch name="Linux 3.0 - 3.9" accuracy="95" line="48215"> | |
154 | +<osclass type="general purpose" vendor="Linux" osfamily="Linux" osgen="3.X" accuracy="95"><cpe>cpe:/o:linux:linux_kernel:3</cpe></osclass> | |
155 | +</osmatch> | |
156 | +<osmatch name="Linux 2.6.32" accuracy="95" line="43805"> | |
157 | +<osclass type="general purpose" vendor="Linux" osfamily="Linux" osgen="2.6.X" accuracy="95"><cpe>cpe:/o:linux:linux_kernel:2.6</cpe></osclass> | |
158 | +</osmatch> | |
159 | +<osmatch name="Linux 2.6.22" accuracy="95" line="39655"> | |
160 | +<osclass type="general purpose" vendor="Linux" osfamily="Linux" osgen="2.6.X" accuracy="95"><cpe>cpe:/o:linux:linux_kernel:2.6.22</cpe></osclass> | |
161 | +</osmatch> | |
162 | +<osmatch name="Linux 2.6.32 - 3.6" accuracy="94" line="44342"> | |
163 | +<osclass type="general purpose" vendor="Linux" osfamily="Linux" osgen="2.6.X" accuracy="94"><cpe>cpe:/o:linux:linux_kernel:2.6</cpe></osclass> | |
164 | +<osclass type="general purpose" vendor="Linux" osfamily="Linux" osgen="3.X" accuracy="94"><cpe>cpe:/o:linux:linux_kernel:3</cpe></osclass> | |
165 | +</osmatch> | |
166 | +<osmatch name="Linux 2.6.38 - 3.0" accuracy="94" line="45576"> | |
167 | +<osclass type="general purpose" vendor="Linux" osfamily="Linux" osgen="2.6.X" accuracy="94"><cpe>cpe:/o:linux:linux_kernel:2.6</cpe></osclass> | |
168 | +<osclass type="general purpose" vendor="Linux" osfamily="Linux" osgen="3.X" accuracy="94"><cpe>cpe:/o:linux:linux_kernel:3</cpe></osclass> | |
169 | +</osmatch> | |
170 | +<osmatch name="Linux 2.6.35" accuracy="94" line="44668"> | |
171 | +<osclass type="general purpose" vendor="Linux" osfamily="Linux" osgen="2.6.X" accuracy="94"><cpe>cpe:/o:linux:linux_kernel:2.6.35</cpe></osclass> | |
172 | +</osmatch> | |
173 | +<osfingerprint fingerprint="OS:SCAN(V=6.46%E=4%D=10/9%OT=22%CT=1%CU=35016%PV=Y%DS=1%DC=D%G=Y%M=0CEEE6%T
OS:M=5436DC60%P=x86_64-pc-linux-gnu)SEQ(SP=103%GCD=1%ISR=106%TI=Z%CI=I%TS=8
OS:)OPS(O1=M5B4ST11NW6%O2=M5B4ST11NW6%O3=M5B4NNT11NW6%O4=M5B4ST11NW6%O5=M5B
OS:4ST11NW6%O6=M5B4ST11)WIN(W1=3890%W2=3890%W3=3890%W4=3890%W5=3890%W6=3890
OS:)ECN(R=Y%DF=Y%T=40%W=3908%O=M5B4NNSNW6%CC=Y%Q=)T1(R=Y%DF=Y%T=40%S=O%A=S+
OS:%F=AS%RD=0%Q=)T2(R=N)T3(R=N)T4(R=Y%DF=Y%T=40%W=0%S=A%A=Z%F=R%O=%RD=0%Q=)
OS:T5(R=Y%DF=Y%T=40%W=0%S=Z%A=S+%F=AR%O=%RD=0%Q=)T6(R=Y%DF=Y%T=40%W=0%S=A%A
OS:=Z%F=R%O=%RD=0%Q=)T7(R=Y%DF=Y%T=40%W=0%S=Z%A=S+%F=AR%O=%RD=0%Q=)U1(R=Y%D
OS:F=N%T=40%IPL=164%UN=0%RIPL=G%RID=G%RIPCK=G%RUCK=G%RUD=G)IE(R=Y%DFI=N%T=4
OS:0%CD=S)
"/> | |
174 | +</os> | |
175 | +<uptime seconds="584413" lastboot="Thu Oct 2 21:44:51 2014"/> | |
176 | +<distance value="1"/> | |
177 | +<tcpsequence index="259" difficulty="Good luck!" values="4BE2E42B,549B6379,6CCA39F2,242E16A2,4A2D440,B1AFB4B5"/> | |
178 | +<ipidsequence class="All zeros" values="0,0,0,0,0,0"/> | |
179 | +<tcptssequence class="other" values="8B55A69,8B55A82,8B55A9B,8B55AB4,8B55ACD,8B55AE6"/> | |
180 | +<times srtt="188" rttvar="43" to="100000"/> | |
181 | +</host> | |
182 | +<host starttime="1412881504" endtime="1412881609"><status state="up" reason="localhost-response" reason_ttl="0"/> | |
183 | +<address addr="192.168.0.3" addrtype="ipv4"/> | |
184 | +<hostnames> | |
185 | +</hostnames> | |
186 | +<ports><extraports state="closed" count="993"> | |
187 | +<extrareasons reason="resets" count="993"/> | |
188 | +</extraports> | |
189 | +<port protocol="tcp" portid="22"><state state="open" reason="syn-ack" reason_ttl="64"/><service name="ssh" method="table" conf="3"/></port> | |
190 | +<port protocol="tcp" portid="80"><state state="open" reason="syn-ack" reason_ttl="64"/><service name="http" method="table" conf="3"/></port> | |
191 | +<port protocol="tcp" portid="111"><state state="open" reason="syn-ack" reason_ttl="64"/><service name="rpcbind" method="table" conf="3"/></port> | |
192 | +<port protocol="tcp" portid="443"><state state="open" reason="syn-ack" reason_ttl="64"/><service name="https" method="table" conf="3"/></port> | |
193 | +<port protocol="tcp" portid="3389"><state state="open" reason="syn-ack" reason_ttl="64"/><service name="ms-wbt-server" method="table" conf="3"/></port> | |
194 | +<port protocol="tcp" portid="5800"><state state="open" reason="syn-ack" reason_ttl="64"/><service name="vnc-http" method="table" conf="3"/></port> | |
195 | +<port protocol="tcp" portid="5900"><state state="open" reason="syn-ack" reason_ttl="64"/><service name="vnc" method="table" conf="3"/></port> | |
196 | +</ports> | |
197 | +<os><portused state="open" proto="tcp" portid="22"/> | |
198 | +<portused state="closed" proto="tcp" portid="1"/> | |
199 | +<portused state="closed" proto="udp" portid="44438"/> | |
200 | +<osmatch name="Linux 3.7 - 3.9" accuracy="98" line="48947"> | |
201 | +<osclass type="general purpose" vendor="Linux" osfamily="Linux" osgen="3.X" accuracy="98"><cpe>cpe:/o:linux:linux_kernel:3</cpe></osclass> | |
202 | +</osmatch> | |
203 | +<osmatch name="Netgear DG834G WAP or Western Digital WD TV media player" accuracy="95" line="63671"> | |
204 | +<osclass type="WAP" vendor="Netgear" osfamily="embedded" accuracy="95"><cpe>cpe:/h:netgear:dg834g</cpe></osclass> | |
205 | +<osclass type="media device" vendor="Western Digital" osfamily="embedded" accuracy="95"><cpe>cpe:/o:westerndigital:wd_tv</cpe></osclass> | |
206 | +</osmatch> | |
207 | +<osmatch name="Linux 3.8" accuracy="95" line="48965"> | |
208 | +<osclass type="general purpose" vendor="Linux" osfamily="Linux" osgen="3.X" accuracy="95"><cpe>cpe:/o:linux:linux_kernel:3</cpe></osclass> | |
209 | +</osmatch> | |
210 | +<osmatch name="Linux 3.1" accuracy="93" line="48343"> | |
211 | +<osclass type="general purpose" vendor="Linux" osfamily="Linux" osgen="3.X" accuracy="93"><cpe>cpe:/o:linux:linux_kernel:3</cpe></osclass> | |
212 | +</osmatch> | |
213 | +<osmatch name="Linux 3.2" accuracy="93" line="48506"> | |
214 | +<osclass type="general purpose" vendor="Linux" osfamily="Linux" osgen="3.X" accuracy="93"><cpe>cpe:/o:linux:linux_kernel:3</cpe></osclass> | |
215 | +</osmatch> | |
216 | +<osmatch name="AXIS 210A or 211 Network Camera (Linux 2.6)" accuracy="92" line="7356"> | |
217 | +<osclass type="webcam" vendor="AXIS" osfamily="Linux" osgen="2.6.X" accuracy="92"><cpe>cpe:/h:axis:210a_network_camera</cpe><cpe>cpe:/h:axis:211_network_camera</cpe><cpe>cpe:/o:axis:linux_kernel:2.6</cpe></osclass> | |
218 | +</osmatch> | |
219 | +<osmatch name="Linux 3.7" accuracy="92" line="48889"> | |
220 | +<osclass type="general purpose" vendor="Linux" osfamily="Linux" osgen="3.X" accuracy="92"><cpe>cpe:/o:linux:linux_kernel:3</cpe></osclass> | |
221 | +</osmatch> | |
222 | +<osmatch name="Linux 3.9" accuracy="91" line="49019"> | |
223 | +<osclass type="general purpose" vendor="Linux" osfamily="Linux" osgen="3.X" accuracy="91"><cpe>cpe:/o:linux:linux_kernel:3</cpe></osclass> | |
224 | +</osmatch> | |
225 | +<osmatch name="Linux 2.4.26 (Slackware 10.0.0)" accuracy="91" line="35315"> | |
226 | +<osclass type="general purpose" vendor="Linux" osfamily="Linux" osgen="2.4.X" accuracy="91"><cpe>cpe:/o:linux:linux_kernel:2.4.26</cpe></osclass> | |
227 | +</osmatch> | |
228 | +<osmatch name="Crestron XPanel control system" accuracy="91" line="15955"> | |
229 | +<osclass type="specialized" vendor="Crestron" osfamily="2-Series" accuracy="91"><cpe>cpe:/o:crestron:2_series</cpe></osclass> | |
230 | +</osmatch> | |
231 | +<osfingerprint fingerprint="OS:SCAN(V=6.46%E=4%D=10/9%OT=22%CT=1%CU=44438%PV=Y%DS=0%DC=L%G=Y%TM=5436DCC
OS:9%P=x86_64-pc-linux-gnu)SEQ(SP=102%GCD=1%ISR=10A%TI=Z%CI=I%TS=8)OPS(O1=M
OS:FFD7ST11NW7%O2=MFFD7ST11NW7%O3=MFFD7NNT11NW7%O4=MFFD7ST11NW7%O5=MFFD7ST1
OS:1NW7%O6=MFFD7ST11)WIN(W1=AAAA%W2=AAAA%W3=AAAA%W4=AAAA%W5=AAAA%W6=AAAA)EC
OS:N(R=Y%DF=Y%T=40%W=AAAA%O=MFFD7NNSNW7%CC=Y%Q=)T1(R=Y%DF=Y%T=40%S=O%A=S+%F
OS:=AS%RD=0%Q=)T2(R=N)T3(R=N)T4(R=Y%DF=Y%T=40%W=0%S=A%A=Z%F=R%O=%RD=0%Q=)T5
OS:(R=Y%DF=Y%T=40%W=0%S=Z%A=S+%F=AR%O=%RD=0%Q=)T6(R=Y%DF=Y%T=40%W=0%S=A%A=Z
OS:%F=R%O=%RD=0%Q=)T7(R=Y%DF=Y%T=40%W=0%S=Z%A=S+%F=AR%O=%RD=0%Q=)U1(R=Y%DF=
OS:N%T=40%IPL=164%UN=0%RIPL=G%RID=G%RIPCK=G%RUCK=G%RUD=G)IE(R=Y%DFI=N%T=40%
OS:CD=S)
"/> | |
232 | +</os> | |
233 | +<uptime seconds="226748" lastboot="Tue Oct 7 01:07:41 2014"/> | |
234 | +<distance value="0"/> | |
235 | +<tcpsequence index="258" difficulty="Good luck!" values="9D744BB5,DF6ECE6A,3246324B,6DBBDF6B,61633743,B7954D93"/> | |
236 | +<ipidsequence class="All zeros" values="0,0,0,0,0,0"/> | |
237 | +<tcptssequence class="other" values="360F877,360F890,360F8A9,360F8C2,360F8DB,360F8F4"/> | |
238 | +<times srtt="25" rttvar="4" to="100000"/> | |
239 | +</host> | |
240 | +<host starttime="1412798937" endtime="1412799130"><status state="up" reason="conn-refused" reason_ttl="0"/> | |
241 | +<address addr="192.168.0.150" addrtype="ipv4"/> | |
242 | +<hostnames> | |
243 | +</hostnames> | |
244 | +<ports><extraports state="closed" count="988"> | |
245 | +<extrareasons reason="conn-refused" count="988"/> | |
246 | +</extraports> | |
247 | +<port protocol="tcp" portid="22"><state state="filtered" reason="no-response" reason_ttl="0"/><service name="ssh" method="table" conf="3"/></port> | |
248 | +<port protocol="tcp" portid="80"><state state="open" reason="syn-ack" reason_ttl="0"/><service name="http" product="Jetty" version="6.1.x" method="probed" conf="10"><cpe>cpe:/a:mortbay:jetty:6.1.x</cpe></service></port> | |
249 | +<port protocol="tcp" portid="111"><state state="open" reason="syn-ack" reason_ttl="0"/><service name="rpcbind" version="2" extrainfo="RPC #100000" method="probed" conf="10"/></port> | |
250 | +<port protocol="tcp" portid="139"><state state="filtered" reason="no-response" reason_ttl="0"/><service name="netbios-ssn" method="table" conf="3"/></port> | |
251 | +<port protocol="tcp" portid="427"><state state="open" reason="syn-ack" reason_ttl="0"/><service name="svrloc" method="table" conf="3"/></port> | |
252 | +<port protocol="tcp" portid="445"><state state="filtered" reason="no-response" reason_ttl="0"/><service name="microsoft-ds" method="table" conf="3"/></port> | |
253 | +<port protocol="tcp" portid="515"><state state="open" reason="syn-ack" reason_ttl="0"/><service name="printer" method="table" conf="3"/></port> | |
254 | +<port protocol="tcp" portid="631"><state state="open" reason="syn-ack" reason_ttl="0"/><service name="http" product="Jetty" version="6.1.x" method="probed" conf="10"><cpe>cpe:/a:mortbay:jetty:6.1.x</cpe></service></port> | |
255 | +<port protocol="tcp" portid="5200"><state state="open" reason="syn-ack" reason_ttl="0"/><service name="targus-getdata" servicefp="SF-Port5200-TCP:V=6.40%I=7%D=10/8%Time=543599E1%P=x86_64-pc-linux-gnu%r(GetRequest,A8,"HTTP/1\.1\x20400\x20Bad\x20Request\r\nContent-Type:\x20text/html;\x20charset=\"utf-8\"\r\nServer:\x20Network\x20Printer\x20Server\x20UPnP/1\.0\x20\r\nContent-Length:\x200\r\nDate:\x20Thu,\x2001\x20Jan\x201970\x2009:40:56\x20GMT\r\n\r\n")%r(HTTPOptions,A8,"HTTP/1\.1\x20400\x20Bad\x20Request\r\nContent-Type:\x20text/html;\x20charset=\"utf-8\"\r\nServer:\x20Network\x20Printer\x20Server\x20UPnP/1\.0\x20\r\nContent-Length:\x200\r\nDate:\x20Thu,\x2001\x20Jan\x201970\x2009:40:56\x20GMT\r\n\r\n")%r(RTSPRequest,A8,"HTTP/1\.1\x20400\x20Bad\x20Request\r\nContent-Type:\x20text/html;\x20charset=\"utf-8\"\r\nServer:\x20Network\x20Printer\x20Server\x20UPnP/1\.0\x20\r\nContent-Length:\x200\r\nDate:\x20Thu,\x2001\x20Jan\x201970\x2009:40:56\x20GMT\r\n\r\n")%r(FourOhFourRequest,A8,"HTTP/1\.1\x20400\x20Bad\x20Request\r\nContent-Type:\x20text/html;\x20charset=\"utf-8\"\r\nServer:\x20Network\x20Printer\x20Server\x20UPnP/1\.0\x20\r\nContent-Length:\x200\r\nDate:\x20Thu,\x2001\x20Jan\x201970\x2009:41:38\x20GMT\r\n\r\n")%r(SIPOptions,A8,"HTTP/1\.1\x20400\x20Bad\x20Request\r\nContent-Type:\x20text/html;\x20charset=\"utf-8\"\r\nServer:\x20Network\x20Printer\x20Server\x20UPnP/1\.0\x20\r\nContent-Length:\x200\r\nDate:\x20Thu,\x2001\x20Jan\x201970\x2009:41:48\x20GMT\r\n\r\n");" method="table" conf="3"/></port> | |
256 | +<port protocol="tcp" portid="9000"><state state="filtered" reason="no-response" reason_ttl="0"/><service name="cslistener" method="table" conf="3"/></port> | |
257 | +<port protocol="tcp" portid="9100"><state state="open" reason="syn-ack" reason_ttl="0"/><service name="jetdirect" method="table" conf="3"/></port> | |
258 | +<port protocol="tcp" portid="30000"><state state="open" reason="syn-ack" reason_ttl="0"/><service name="unknown" servicefp="SF-Port30000-TCP:V=6.40%I=7%D=10/8%Time=543599E1%P=x86_64-pc-linux-gnu%r(NULL,71A,"GVDataChannel:Code=ffff;Value=ffff\nScanToStore:JobName=ScanToStore;Quality=Normal,Draft,Best;MultiPageOnOff=On,Off;FlatbedRepeat=1;Resolution=300,100,200,400,600;JobType=LOG_SUBTYPE_JOB_SCAN_SCAN2SMB;PaperType=Plain,Coated,Magazine,Newsprint,Photo,Trans;Brightness=Normal,Lightest,Lighter,Darker,Darkest;ColorMode=Color,Gray,Mono;UserName=admin;ContentType=Text,Photo,Mixed;StoreMethod=AutoName,New,Overwrite;ImageHeight=297;JobRepeat=1;InputDocPlex=Simplex,ShortEdge,LongEdge;FileFormat=PDF,TIFF,JPEG;EraseEdge=Off,On;EraseBackground=0,-80,-60,-40,-20,20,40,100;ImageWidth=210;CancelAfter=0;FileName=DOC\${PAGE_NUMBER:04d}\.\${EXTENSION}\nScan:JobName=ScanToStore;Quality=100,50,0;MultiPageOnOff=On,Off;FlatbedRepeat=3;Resolution=300,100,200,400,600;MechanicalType=ADF,Flatbed;JobType=LOG_SUBTYPE_JOB_SCAN_SCAN2SMB;PaperType=Plain,Coated,Magazine,Newsprint,Photo,Trans;Destination=file:/root/;Brightness")%r(GenericLines,71A,"GVDataChannel:Code=ffff;Value=ffff\nScanToStore:JobName=ScanToStore;Quality=Normal,Draft,Best;MultiPageOnOff=On,Off;FlatbedRepeat=1;Resolution=300,100,200,400,600;JobType=LOG_SUBTYPE_JOB_SCAN_SCAN2SMB;PaperType=Plain,Coated,Magazine,Newsprint,Photo,Trans;Brightness=Normal,Lightest,Lighter,Darker,Darkest;ColorMode=Color,Gray,Mono;UserName=admin;ContentType=Text,Photo,Mixed;StoreMethod=AutoName,New,Overwrite;ImageHeight=297;JobRepeat=1;InputDocPlex=Simplex,ShortEdge,LongEdge;FileFormat=PDF,TIFF,JPEG;EraseEdge=Off,On;EraseBackground=0,-80,-60,-40,-20,20,40,100;ImageWidth=210;CancelAfter=0;FileName=DOC\${PAGE_NUMBER:04d}\.\${EXTENSION}\nScan:JobName=ScanToStore;Quality=100,50,0;MultiPageOnOff=On,Off;FlatbedRepeat=3;Resolution=300,100,200,400,600;MechanicalType=ADF,Flatbed;JobType=LOG_SUBTYPE_JOB_SCAN_SCAN2SMB;PaperType=Plain,Coated,Magazine,Newsprint,Photo,Trans;Destination=file:/root/;Brightness")%r(GetRequest,71A,"GVDataChannel:Code=ffff;Value=ffff\nScanToStore:JobName=ScanToStore;Quality=Normal,Draft,Best;MultiPageOnOff=On,Off;FlatbedRepeat=1;Resolution=300,100,200,400,600;JobType=LOG_SUBTYPE_JOB_SCAN_SCAN2SMB;PaperType=Plain,Coated,Magazine,Newsprint,Photo,Trans;Brightness=Normal,Lightest,Lighter,Darker,Darkest;ColorMode=Color,Gray,Mono;UserName=admin;ContentType=Text,Photo,Mixed;StoreMethod=AutoName,New,Overwrite;ImageHeight=297;JobRepeat=1;InputDocPlex=Simplex,ShortEdge,LongEdge;FileFormat=PDF,TIFF,JPEG;EraseEdge=Off,On;EraseBackground=0,-80,-60,-40,-20,20,40,100;ImageWidth=210;CancelAfter=0;FileName=DOC\${PAGE_NUMBER:04d}\.\${EXTENSION}\nScan:JobName=ScanToStore;Quality=100,50,0;MultiPageOnOff=On,Off;FlatbedRepeat=3;Resolution=300,100,200,400,600;MechanicalType=ADF,Flatbed;JobType=LOG_SUBTYPE_JOB_SCAN_SCAN2SMB;PaperType=Plain,Coated,Magazine,Newsprint,Photo,Trans;Destination=file:/root/;Brightness");" method="table" conf="3"/></port> | |
259 | +</ports> | |
260 | +<times srtt="12901" rttvar="2164" to="100000"/> | |
261 | +</host> | |
262 | +<runstats><hosts up="5" down="251" total="256"/> | |
263 | +</runstats> | |
264 | +</nmaprun> | ... | ... |
... | ... | @@ -0,0 +1,31 @@ |
1 | +<?xml version="1.0"?> | |
2 | +<?xml-stylesheet href="file:///usr/bin/../share/nmap/nmap.xsl" type="text/xsl"?> | |
3 | +<nmaprun scanner="nmap" args="nmap -PE -PP -PS21,22,23,25,80,443,3306,3389,8080 -sV -oX printer.xml 10.72.168.3" start="1412798937" startstr="Wed Oct 8 17:08:57 2014" version="6.40" xmloutputversion="1.04"> | |
4 | +<scaninfo type="connect" protocol="tcp" numservices="1000" services="1,3-4,6-7,9,13,17,19-26,30,32-33,37,42-43,49,53,70,79-85,88-90,99-100,106,109-111,113,119,125,135,139,143-144,146,161,163,179,199,211-212,222,254-256,259,264,280,301,306,311,340,366,389,406-407,416-417,425,427,443-445,458,464-465,481,497,500,512-515,524,541,543-545,548,554-555,563,587,593,616-617,625,631,636,646,648,666-668,683,687,691,700,705,711,714,720,722,726,749,765,777,783,787,800-801,808,843,873,880,888,898,900-903,911-912,981,987,990,992-993,995,999-1002,1007,1009-1011,1021-1100,1102,1104-1108,1110-1114,1117,1119,1121-1124,1126,1130-1132,1137-1138,1141,1145,1147-1149,1151-1152,1154,1163-1166,1169,1174-1175,1183,1185-1187,1192,1198-1199,1201,1213,1216-1218,1233-1234,1236,1244,1247-1248,1259,1271-1272,1277,1287,1296,1300-1301,1309-1311,1322,1328,1334,1352,1417,1433-1434,1443,1455,1461,1494,1500-1501,1503,1521,1524,1533,1556,1580,1583,1594,1600,1641,1658,1666,1687-1688,1700,1717-1721,1723,1755,1761,1782-1783,1801,1805,1812,1839-1840,1862-1864,1875,1900,1914,1935,1947,1971-1972,1974,1984,1998-2010,2013,2020-2022,2030,2033-2035,2038,2040-2043,2045-2049,2065,2068,2099-2100,2103,2105-2107,2111,2119,2121,2126,2135,2144,2160-2161,2170,2179,2190-2191,2196,2200,2222,2251,2260,2288,2301,2323,2366,2381-2383,2393-2394,2399,2401,2492,2500,2522,2525,2557,2601-2602,2604-2605,2607-2608,2638,2701-2702,2710,2717-2718,2725,2800,2809,2811,2869,2875,2909-2910,2920,2967-2968,2998,3000-3001,3003,3005-3007,3011,3013,3017,3030-3031,3052,3071,3077,3128,3168,3211,3221,3260-3261,3268-3269,3283,3300-3301,3306,3322-3325,3333,3351,3367,3369-3372,3389-3390,3404,3476,3493,3517,3527,3546,3551,3580,3659,3689-3690,3703,3737,3766,3784,3800-3801,3809,3814,3826-3828,3851,3869,3871,3878,3880,3889,3905,3914,3918,3920,3945,3971,3986,3995,3998,4000-4006,4045,4111,4125-4126,4129,4224,4242,4279,4321,4343,4443-4446,4449,4550,4567,4662,4848,4899-4900,4998,5000-5004,5009,5030,5033,5050-5051,5054,5060-5061,5080,5087,5100-5102,5120,5190,5200,5214,5221-5222,5225-5226,5269,5280,5298,5357,5405,5414,5431-5432,5440,5500,5510,5544,5550,5555,5560,5566,5631,5633,5666,5678-5679,5718,5730,5800-5802,5810-5811,5815,5822,5825,5850,5859,5862,5877,5900-5904,5906-5907,5910-5911,5915,5922,5925,5950,5952,5959-5963,5987-5989,5998-6007,6009,6025,6059,6100-6101,6106,6112,6123,6129,6156,6346,6389,6502,6510,6543,6547,6565-6567,6580,6646,6666-6669,6689,6692,6699,6779,6788-6789,6792,6839,6881,6901,6969,7000-7002,7004,7007,7019,7025,7070,7100,7103,7106,7200-7201,7402,7435,7443,7496,7512,7625,7627,7676,7741,7777-7778,7800,7911,7920-7921,7937-7938,7999-8002,8007-8011,8021-8022,8031,8042,8045,8080-8090,8093,8099-8100,8180-8181,8192-8194,8200,8222,8254,8290-8292,8300,8333,8383,8400,8402,8443,8500,8600,8649,8651-8652,8654,8701,8800,8873,8888,8899,8994,9000-9003,9009-9011,9040,9050,9071,9080-9081,9090-9091,9099-9103,9110-9111,9200,9207,9220,9290,9415,9418,9485,9500,9502-9503,9535,9575,9593-9595,9618,9666,9876-9878,9898,9900,9917,9929,9943-9944,9968,9998-10004,10009-10010,10012,10024-10025,10082,10180,10215,10243,10566,10616-10617,10621,10626,10628-10629,10778,11110-11111,11967,12000,12174,12265,12345,13456,13722,13782-13783,14000,14238,14441-14442,15000,15002-15004,15660,15742,16000-16001,16012,16016,16018,16080,16113,16992-16993,17877,17988,18040,18101,18988,19101,19283,19315,19350,19780,19801,19842,20000,20005,20031,20221-20222,20828,21571,22939,23502,24444,24800,25734-25735,26214,27000,27352-27353,27355-27356,27715,28201,30000,30718,30951,31038,31337,32768-32785,33354,33899,34571-34573,35500,38292,40193,40911,41511,42510,44176,44442-44443,44501,45100,48080,49152-49161,49163,49165,49167,49175-49176,49400,49999-50003,50006,50300,50389,50500,50636,50800,51103,51493,52673,52822,52848,52869,54045,54328,55055-55056,55555,55600,56737-56738,57294,57797,58080,60020,60443,61532,61900,62078,63331,64623,64680,65000,65129,65389"/> | |
5 | +<verbose level="0"/> | |
6 | +<debugging level="0"/> | |
7 | +<host starttime="1412798937" endtime="1412799130"><status state="up" reason="conn-refused" reason_ttl="0"/> | |
8 | +<address addr="10.72.168.3" addrtype="ipv4"/> | |
9 | +<hostnames> | |
10 | +</hostnames> | |
11 | +<ports><extraports state="closed" count="988"> | |
12 | +<extrareasons reason="conn-refused" count="988"/> | |
13 | +</extraports> | |
14 | +<port protocol="tcp" portid="22"><state state="filtered" reason="no-response" reason_ttl="0"/><service name="ssh" method="table" conf="3"/></port> | |
15 | +<port protocol="tcp" portid="80"><state state="open" reason="syn-ack" reason_ttl="0"/><service name="http" product="Jetty" version="6.1.x" method="probed" conf="10"><cpe>cpe:/a:mortbay:jetty:6.1.x</cpe></service></port> | |
16 | +<port protocol="tcp" portid="111"><state state="open" reason="syn-ack" reason_ttl="0"/><service name="rpcbind" version="2" extrainfo="RPC #100000" method="probed" conf="10"/></port> | |
17 | +<port protocol="tcp" portid="139"><state state="filtered" reason="no-response" reason_ttl="0"/><service name="netbios-ssn" method="table" conf="3"/></port> | |
18 | +<port protocol="tcp" portid="427"><state state="open" reason="syn-ack" reason_ttl="0"/><service name="svrloc" method="table" conf="3"/></port> | |
19 | +<port protocol="tcp" portid="445"><state state="filtered" reason="no-response" reason_ttl="0"/><service name="microsoft-ds" method="table" conf="3"/></port> | |
20 | +<port protocol="tcp" portid="515"><state state="open" reason="syn-ack" reason_ttl="0"/><service name="printer" method="table" conf="3"/></port> | |
21 | +<port protocol="tcp" portid="631"><state state="open" reason="syn-ack" reason_ttl="0"/><service name="http" product="Jetty" version="6.1.x" method="probed" conf="10"><cpe>cpe:/a:mortbay:jetty:6.1.x</cpe></service></port> | |
22 | +<port protocol="tcp" portid="5200"><state state="open" reason="syn-ack" reason_ttl="0"/><service name="targus-getdata" servicefp="SF-Port5200-TCP:V=6.40%I=7%D=10/8%Time=543599E1%P=x86_64-pc-linux-gnu%r(GetRequest,A8,"HTTP/1\.1\x20400\x20Bad\x20Request\r\nContent-Type:\x20text/html;\x20charset=\"utf-8\"\r\nServer:\x20Network\x20Printer\x20Server\x20UPnP/1\.0\x20\r\nContent-Length:\x200\r\nDate:\x20Thu,\x2001\x20Jan\x201970\x2009:40:56\x20GMT\r\n\r\n")%r(HTTPOptions,A8,"HTTP/1\.1\x20400\x20Bad\x20Request\r\nContent-Type:\x20text/html;\x20charset=\"utf-8\"\r\nServer:\x20Network\x20Printer\x20Server\x20UPnP/1\.0\x20\r\nContent-Length:\x200\r\nDate:\x20Thu,\x2001\x20Jan\x201970\x2009:40:56\x20GMT\r\n\r\n")%r(RTSPRequest,A8,"HTTP/1\.1\x20400\x20Bad\x20Request\r\nContent-Type:\x20text/html;\x20charset=\"utf-8\"\r\nServer:\x20Network\x20Printer\x20Server\x20UPnP/1\.0\x20\r\nContent-Length:\x200\r\nDate:\x20Thu,\x2001\x20Jan\x201970\x2009:40:56\x20GMT\r\n\r\n")%r(FourOhFourRequest,A8,"HTTP/1\.1\x20400\x20Bad\x20Request\r\nContent-Type:\x20text/html;\x20charset=\"utf-8\"\r\nServer:\x20Network\x20Printer\x20Server\x20UPnP/1\.0\x20\r\nContent-Length:\x200\r\nDate:\x20Thu,\x2001\x20Jan\x201970\x2009:41:38\x20GMT\r\n\r\n")%r(SIPOptions,A8,"HTTP/1\.1\x20400\x20Bad\x20Request\r\nContent-Type:\x20text/html;\x20charset=\"utf-8\"\r\nServer:\x20Network\x20Printer\x20Server\x20UPnP/1\.0\x20\r\nContent-Length:\x200\r\nDate:\x20Thu,\x2001\x20Jan\x201970\x2009:41:48\x20GMT\r\n\r\n");" method="table" conf="3"/></port> | |
23 | +<port protocol="tcp" portid="9000"><state state="filtered" reason="no-response" reason_ttl="0"/><service name="cslistener" method="table" conf="3"/></port> | |
24 | +<port protocol="tcp" portid="9100"><state state="open" reason="syn-ack" reason_ttl="0"/><service name="jetdirect" method="table" conf="3"/></port> | |
25 | +<port protocol="tcp" portid="30000"><state state="open" reason="syn-ack" reason_ttl="0"/><service name="unknown" servicefp="SF-Port30000-TCP:V=6.40%I=7%D=10/8%Time=543599E1%P=x86_64-pc-linux-gnu%r(NULL,71A,"GVDataChannel:Code=ffff;Value=ffff\nScanToStore:JobName=ScanToStore;Quality=Normal,Draft,Best;MultiPageOnOff=On,Off;FlatbedRepeat=1;Resolution=300,100,200,400,600;JobType=LOG_SUBTYPE_JOB_SCAN_SCAN2SMB;PaperType=Plain,Coated,Magazine,Newsprint,Photo,Trans;Brightness=Normal,Lightest,Lighter,Darker,Darkest;ColorMode=Color,Gray,Mono;UserName=admin;ContentType=Text,Photo,Mixed;StoreMethod=AutoName,New,Overwrite;ImageHeight=297;JobRepeat=1;InputDocPlex=Simplex,ShortEdge,LongEdge;FileFormat=PDF,TIFF,JPEG;EraseEdge=Off,On;EraseBackground=0,-80,-60,-40,-20,20,40,100;ImageWidth=210;CancelAfter=0;FileName=DOC\${PAGE_NUMBER:04d}\.\${EXTENSION}\nScan:JobName=ScanToStore;Quality=100,50,0;MultiPageOnOff=On,Off;FlatbedRepeat=3;Resolution=300,100,200,400,600;MechanicalType=ADF,Flatbed;JobType=LOG_SUBTYPE_JOB_SCAN_SCAN2SMB;PaperType=Plain,Coated,Magazine,Newsprint,Photo,Trans;Destination=file:/root/;Brightness")%r(GenericLines,71A,"GVDataChannel:Code=ffff;Value=ffff\nScanToStore:JobName=ScanToStore;Quality=Normal,Draft,Best;MultiPageOnOff=On,Off;FlatbedRepeat=1;Resolution=300,100,200,400,600;JobType=LOG_SUBTYPE_JOB_SCAN_SCAN2SMB;PaperType=Plain,Coated,Magazine,Newsprint,Photo,Trans;Brightness=Normal,Lightest,Lighter,Darker,Darkest;ColorMode=Color,Gray,Mono;UserName=admin;ContentType=Text,Photo,Mixed;StoreMethod=AutoName,New,Overwrite;ImageHeight=297;JobRepeat=1;InputDocPlex=Simplex,ShortEdge,LongEdge;FileFormat=PDF,TIFF,JPEG;EraseEdge=Off,On;EraseBackground=0,-80,-60,-40,-20,20,40,100;ImageWidth=210;CancelAfter=0;FileName=DOC\${PAGE_NUMBER:04d}\.\${EXTENSION}\nScan:JobName=ScanToStore;Quality=100,50,0;MultiPageOnOff=On,Off;FlatbedRepeat=3;Resolution=300,100,200,400,600;MechanicalType=ADF,Flatbed;JobType=LOG_SUBTYPE_JOB_SCAN_SCAN2SMB;PaperType=Plain,Coated,Magazine,Newsprint,Photo,Trans;Destination=file:/root/;Brightness")%r(GetRequest,71A,"GVDataChannel:Code=ffff;Value=ffff\nScanToStore:JobName=ScanToStore;Quality=Normal,Draft,Best;MultiPageOnOff=On,Off;FlatbedRepeat=1;Resolution=300,100,200,400,600;JobType=LOG_SUBTYPE_JOB_SCAN_SCAN2SMB;PaperType=Plain,Coated,Magazine,Newsprint,Photo,Trans;Brightness=Normal,Lightest,Lighter,Darker,Darkest;ColorMode=Color,Gray,Mono;UserName=admin;ContentType=Text,Photo,Mixed;StoreMethod=AutoName,New,Overwrite;ImageHeight=297;JobRepeat=1;InputDocPlex=Simplex,ShortEdge,LongEdge;FileFormat=PDF,TIFF,JPEG;EraseEdge=Off,On;EraseBackground=0,-80,-60,-40,-20,20,40,100;ImageWidth=210;CancelAfter=0;FileName=DOC\${PAGE_NUMBER:04d}\.\${EXTENSION}\nScan:JobName=ScanToStore;Quality=100,50,0;MultiPageOnOff=On,Off;FlatbedRepeat=3;Resolution=300,100,200,400,600;MechanicalType=ADF,Flatbed;JobType=LOG_SUBTYPE_JOB_SCAN_SCAN2SMB;PaperType=Plain,Coated,Magazine,Newsprint,Photo,Trans;Destination=file:/root/;Brightness");" method="table" conf="3"/></port> | |
26 | +</ports> | |
27 | +<times srtt="12901" rttvar="2164" to="100000"/> | |
28 | +</host> | |
29 | +<runstats><finished time="1412799130" timestr="Wed Oct 8 17:12:10 2014" elapsed="193.69" summary="Nmap done at Wed Oct 8 17:12:10 2014; 1 IP address (1 host up) scanned in 193.69 seconds" exit="success"/><hosts up="1" down="0" total="1"/> | |
30 | +</runstats> | |
31 | +</nmaprun> | ... | ... |
cocar/tests/test_discover.py
... | ... | @@ -5,6 +5,7 @@ __author__ = 'eduardo' |
5 | 5 | import unittest |
6 | 6 | import os |
7 | 7 | import os.path |
8 | +import shutil | |
8 | 9 | from ..session import Host, SnmpSession, NmapSession |
9 | 10 | from .. import Cocar |
10 | 11 | from ..model import network |
... | ... | @@ -66,52 +67,30 @@ class TestDiscover(unittest.TestCase): |
66 | 67 | """ |
67 | 68 | Realiza busca em todos os IP's da rede e grava resultados num arquivo específico |
68 | 69 | """ |
69 | - ip_list = self.network.ip_list() | |
70 | - i = 0 | |
71 | - for ip in ip_list: | |
72 | - outfile = self.network.network_dir + "/" + str(ip) + ".xml" | |
73 | - #print(outfile) | |
74 | - session = NmapSession(ip, outfile=outfile) | |
75 | - session.scan() | |
76 | - i += 1 | |
77 | - if i > 10: | |
78 | - break | |
70 | + session = NmapSession(self.network.network_ip.cidr) | |
71 | + session.scan() | |
79 | 72 | |
80 | 73 | # List all IP's from directory |
81 | - onlyfiles = [ f for f in os.listdir(self.network.network_dir) if os.path.isfile(os.path.join(self.network.network_dir, f)) ] | |
74 | + self.assertTrue(os.path.isfile(session.outfile)) | |
82 | 75 | |
83 | - # Funciona se encontrar pelo menos um arquivo | |
84 | - self.assertGreater(len(onlyfiles), 0) | |
85 | - | |
86 | - # Apaga diretório | |
87 | - os.rmdir(self.network.network_dir) | |
76 | + # Apaga arquivo | |
77 | + os.unlink(session.outfile) | |
88 | 78 | |
89 | 79 | def test_scan_rede(self): |
90 | 80 | """ |
91 | 81 | Realiza busca rápida em todos os IP's da rede e grava resultados num arquivo específico |
92 | 82 | """ |
93 | - ip_list = self.network.ip_list() | |
94 | - i = 0 | |
95 | - for ip in ip_list: | |
96 | - outfile = self.network.network_dir + "/" + str(ip) + ".xml" | |
97 | - #print(outfile) | |
98 | - session = NmapSession(ip, outfile=outfile, full=False) | |
99 | - session.scan() | |
100 | - i += 1 | |
101 | - if i > 10: | |
102 | - break | |
83 | + session = NmapSession(self.network.network_ip.cidr, full=False) | |
84 | + session.scan() | |
103 | 85 | |
104 | 86 | # List all IP's from directory |
105 | - onlyfiles = [ f for f in os.listdir(self.network.network_dir) if os.path.isfile(os.path.join(self.network.network_dir, f)) ] | |
106 | - | |
107 | - # Funciona se encontrar pelo menos um arquivo | |
108 | - self.assertGreater(len(onlyfiles), 0) | |
87 | + self.assertTrue(os.path.isfile(session.outfile)) | |
109 | 88 | |
110 | - # Apaga diretório | |
111 | - os.rmdir(self.network.network_dir) | |
89 | + # Apaga arquivo | |
90 | + #os.unlink(session.outfile) | |
112 | 91 | |
113 | 92 | def tearDown(self): |
114 | 93 | """ |
115 | 94 | Apaga dados inicias |
116 | 95 | """ |
117 | - #os.rmdir(self.data_dir) | |
118 | 96 | \ No newline at end of file |
97 | + #shutil.rmtree(self.data_dir) | |
119 | 98 | \ No newline at end of file | ... | ... |
... | ... | @@ -0,0 +1,81 @@ |
1 | +#!/bin/env python | |
2 | +# -*- coding: utf-8 -*- | |
3 | +__author__ = 'eduardo' | |
4 | + | |
5 | +import unittest | |
6 | +import json | |
7 | +import cocar.tests | |
8 | +from ..xml_utils import NmapXML | |
9 | +from ..model.computer import Computer | |
10 | +from ..model.printer import Printer | |
11 | + | |
12 | + | |
13 | +class TestIdentify(unittest.TestCase): | |
14 | + """ | |
15 | + Testa identificação de ativos de rede | |
16 | + """ | |
17 | + def setUp(self): | |
18 | + """ | |
19 | + Carrega parâmetros iniciais | |
20 | + """ | |
21 | + self.data_dir = cocar.tests.cocar.cocar_data_dir | |
22 | + self.network_file = cocar.tests.test_dir + "/fixtures/192.168.0.0-24.xml" | |
23 | + self.localhost_file = cocar.tests.test_dir + "/fixtures/127.0.0.1.xml" | |
24 | + self.printer_file = cocar.tests.test_dir + "/fixtures/printer.xml" | |
25 | + | |
26 | + def test_parse_xml(self): | |
27 | + """ | |
28 | + Faz o parsing do XML da rede e transforma em dicionário | |
29 | + """ | |
30 | + nmap_xml = NmapXML(self.localhost_file) | |
31 | + host = nmap_xml.parse_xml() | |
32 | + assert host | |
33 | + | |
34 | + # Check for parsing keys | |
35 | + hostname = '127.0.0.1' | |
36 | + fd = open('/tmp/teste-network.json', 'w+') | |
37 | + fd.write(json.dumps(nmap_xml.hosts, )) | |
38 | + fd.close() | |
39 | + self.assertGreater(len(nmap_xml.hosts[hostname].keys()), 0) | |
40 | + print(nmap_xml.hosts[hostname].keys()) | |
41 | + self.assertGreater(len(nmap_xml.hosts[hostname]['hostname']), 0) | |
42 | + self.assertGreater(len(nmap_xml.hosts[hostname]['ports']), 0) | |
43 | + self.assertGreater(len(nmap_xml.hosts[hostname]['os']), 0) | |
44 | + #self.assertGreater(len(nmap_xml.hosts[hostname]['mac']), 0) | |
45 | + | |
46 | + def test_identify_computer(self): | |
47 | + """ | |
48 | + Testa identificação do host | |
49 | + """ | |
50 | + hostname = '127.0.0.1' | |
51 | + nmap_xml = NmapXML(self.localhost_file) | |
52 | + # Aqui tem que dar erro porque ainda não mandei carregar o XML | |
53 | + with self.assertRaises(AttributeError): | |
54 | + nmap_xml.identify_host(hostname) | |
55 | + | |
56 | + # Aqui eu verifico se foi possível identificar o host | |
57 | + host = nmap_xml.parse_xml() | |
58 | + assert host | |
59 | + computer = nmap_xml.identify_host(hostname) | |
60 | + self.assertIsInstance(computer, Computer) | |
61 | + | |
62 | + # Se é um computer, tenho que identificar o SO | |
63 | + os_elm = computer.so.items()[0] | |
64 | + self.assertEqual(os_elm[1]['osfamily'], 'Linux') | |
65 | + | |
66 | + def test_identify_printer(self): | |
67 | + """ | |
68 | + Identifica impressora a partir de arquivo XML | |
69 | + """ | |
70 | + hostname = '10.72.168.3' | |
71 | + nmap_xml = NmapXML(self.printer_file) | |
72 | + host = nmap_xml.parse_xml() | |
73 | + assert host | |
74 | + | |
75 | + printer = nmap_xml.identify_host(hostname) | |
76 | + self.assertIsInstance(printer, Printer) | |
77 | + | |
78 | + def tearDown(self): | |
79 | + """ | |
80 | + Apaga parâmetros de teste | |
81 | + """ | |
0 | 82 | \ No newline at end of file | ... | ... |
... | ... | @@ -0,0 +1,47 @@ |
1 | +#!/bin/env python | |
2 | +# -*- coding: utf-8 -*- | |
3 | +__author__ = 'eduardo' | |
4 | + | |
5 | +import unittest | |
6 | +import cocar.tests | |
7 | +from ..xml_utils import NmapXML | |
8 | +from ..model.computer import Computer | |
9 | + | |
10 | + | |
11 | +class TestPersistence(unittest.TestCase): | |
12 | + """ | |
13 | + Testa identificação de ativos de rede | |
14 | + """ | |
15 | + def setUp(self): | |
16 | + """ | |
17 | + Carrega parâmetros iniciais | |
18 | + """ | |
19 | + self.data_dir = cocar.tests.cocar.cocar_data_dir | |
20 | + self.network_file = cocar.tests.test_dir + "/fixtures/192.168.0.0-24.xml" | |
21 | + self.localhost_file = cocar.tests.test_dir + "/fixtures/127.0.0.1.xml" | |
22 | + self.printer_file = cocar.tests.test_dir + "/fixtures/printer.xml" | |
23 | + | |
24 | + def test_connect(self): | |
25 | + """ | |
26 | + Testa conexão do SQLAlchemy | |
27 | + """ | |
28 | + db_session = cocar.tests.cocar.session | |
29 | + self.assertIsNotNone(db_session) | |
30 | + | |
31 | + def test_persist_computer(self): | |
32 | + """ | |
33 | + Grava computador no banco de dados | |
34 | + """ | |
35 | + hostname = '127.0.0.1' | |
36 | + nmap_xml = NmapXML(self.localhost_file) | |
37 | + host = nmap_xml.parse_xml() | |
38 | + assert host | |
39 | + | |
40 | + computer = nmap_xml.identify_host(hostname) | |
41 | + self.assertIsInstance(computer, Computer) | |
42 | + | |
43 | + def tearDown(self): | |
44 | + """ | |
45 | + Remove dados | |
46 | + """ | |
47 | + pass | |
0 | 48 | \ No newline at end of file | ... | ... |
cocar/utils.py
... | ... | @@ -40,3 +40,25 @@ def get_local_network(myiface='eth0'): |
40 | 40 | # => IPAddress('192.168.1.0') |
41 | 41 | |
42 | 42 | return cidr |
43 | + | |
44 | + | |
45 | +def get_localhost(myiface='eth0'): | |
46 | + """ | |
47 | + Pega endereço do localhost | |
48 | + :param myiface: Interface local | |
49 | + :return: Ip do localhost | |
50 | + """ | |
51 | + ifaces = netifaces.interfaces() | |
52 | + # => ['lo', 'eth0', 'eth1'] | |
53 | + | |
54 | + addrs = netifaces.ifaddresses(myiface) | |
55 | + # {2: [{'addr': '192.168.1.150', | |
56 | + # 'broadcast': '192.168.1.255', | |
57 | + # 'netmask': '255.255.255.0'}], | |
58 | + # 10: [{'addr': 'fe80::21a:4bff:fe54:a246%eth0', | |
59 | + # 'netmask': 'ffff:ffff:ffff:ffff::'}], | |
60 | + # 17: [{'addr': '00:1a:4b:54:a2:46', 'broadcast': 'ff:ff:ff:ff:ff:ff'}]} | |
61 | + | |
62 | + # Get ipv4 stuff | |
63 | + ipinfo = addrs[socket.AF_INET][0] | |
64 | + return ipinfo['addr'] | ... | ... |
... | ... | @@ -0,0 +1,147 @@ |
1 | +#!/bin/env python | |
2 | +# -*- coding: utf-8 -*- | |
3 | +__author__ = 'eduardo' | |
4 | + | |
5 | +from lxml import etree | |
6 | +import model.computer | |
7 | +import model.printer | |
8 | +import model.host | |
9 | + | |
10 | + | |
11 | +class NmapXML(object): | |
12 | + """ | |
13 | + Classe para realizar o parsing do arquivo XML do NMAP | |
14 | + """ | |
15 | + def __init__(self, | |
16 | + xml): | |
17 | + self.xml = xml | |
18 | + self.hosts = dict() | |
19 | + | |
20 | + def parse_xml(self): | |
21 | + """ | |
22 | + Parse XML file | |
23 | + """ | |
24 | + infile = open(self.xml, 'r') | |
25 | + | |
26 | + for _, element in etree.iterparse(infile, events=('start', 'end'), tag='host'): | |
27 | + addr_list = element.findall('address') | |
28 | + | |
29 | + # MAC e IP | |
30 | + for addr in addr_list: | |
31 | + if addr.get('addrtype') == 'ipv4': | |
32 | + host = addr.get('addr') | |
33 | + elif addr.get('addrtype') == 'mac': | |
34 | + mac = { | |
35 | + 'address': addr.get('addr'), | |
36 | + 'vendor': addr.get('vendor') | |
37 | + } | |
38 | + | |
39 | + # A chave do dicionário é o IP | |
40 | + self.hosts[host] = dict() | |
41 | + if 'mac' in locals(): | |
42 | + self.hosts[host]['mac'] = mac | |
43 | + | |
44 | + # Hostname | |
45 | + self.hosts[host]['hostname'] = dict() | |
46 | + for tag in element.find('hostnames').findall('hostname'): | |
47 | + self.hosts[host]['hostname'][tag.get('type')] = tag.get('name') | |
48 | + | |
49 | + # Open ports | |
50 | + ports = element.find('ports') | |
51 | + self.hosts[host]['ports'] = dict() | |
52 | + for port_xml in ports.findall('port'): | |
53 | + self.hosts[host]['ports'][port_xml.get('portid')] = { | |
54 | + 'protocol': port_xml.get('protocol'), | |
55 | + 'state': port_xml.find('state').get('state'), | |
56 | + 'service': port_xml.find('service').get('name'), | |
57 | + } | |
58 | + | |
59 | + # OS Matches | |
60 | + os = element.find('os') | |
61 | + if os is not None: | |
62 | + self.hosts[host]['os'] = dict() | |
63 | + for osmatch in os.findall('osmatch'): | |
64 | + self.hosts[host]['os'][osmatch.get('name')] = dict() | |
65 | + self.hosts[host]['os'][osmatch.get('name')]['accuracy'] = osmatch.get('accuracy') | |
66 | + for osclass in osmatch.findall('osclass'): | |
67 | + self.hosts[host]['os'][osmatch.get('name')]['osclass'] = { | |
68 | + 'type': osclass.get('type'), | |
69 | + 'vendor': osclass.get('vendor'), | |
70 | + 'osfamily': osclass.get('osfamily'), | |
71 | + 'accuracy': osclass.get('accuracy'), | |
72 | + 'cpe': osclass.findtext('cpe') | |
73 | + } | |
74 | + | |
75 | + # General attributes | |
76 | + self.hosts[host]['starttime'] = element.get('starttime') | |
77 | + self.hosts[host]['endtime'] = element.get('endtime') | |
78 | + status = element.find('status') | |
79 | + self.hosts[host]['state'] = status.get('state') | |
80 | + | |
81 | + return True | |
82 | + | |
83 | + def identify_host(self, hostname): | |
84 | + if not self.hosts: | |
85 | + raise AttributeError("It is necessary do load XML file first") | |
86 | + | |
87 | + # Ordena os sistemas operacionais por accuracy | |
88 | + host = self.hosts[hostname] | |
89 | + accuracy = 0 | |
90 | + if host.get('os'): | |
91 | + # Nesse caso já sei que é computador. Precisa identificar o OS | |
92 | + for os in host['os'].keys(): | |
93 | + if int(host['os'][os]['accuracy']) > accuracy: | |
94 | + os_final = os | |
95 | + | |
96 | + scantime = int(host.get('endtime')) - int(host.get('starttime')) | |
97 | + computer = model.computer.Computer( | |
98 | + ip_address=hostname, | |
99 | + mac_address=host.get('mac'), | |
100 | + hostname=host.get('hostname'), | |
101 | + inclusion_date=host.get('endtime'), | |
102 | + scantime=scantime, | |
103 | + open_ports=host.get('ports'), | |
104 | + so=host['os'][os_final] | |
105 | + ) | |
106 | + | |
107 | + return computer | |
108 | + elif host.get('ports'): | |
109 | + scantime = int(host.get('endtime')) - int(host.get('starttime')) | |
110 | + #FIXME: Tem que encontrar uma forma melhor de identificar a impressora | |
111 | + for value in ['9100']: | |
112 | + if value in host['ports'].keys(): | |
113 | + # Regra temporária!!! As impressoras serão identificadas pela porta 9100 | |
114 | + printer = model.printer.Printer( | |
115 | + ip_address=hostname, | |
116 | + mac_address=host.get('mac'), | |
117 | + hostname=host.get('hostname'), | |
118 | + inclusion_date=host.get('endtime'), | |
119 | + scantime=scantime, | |
120 | + open_ports=host['ports'], | |
121 | + ) | |
122 | + | |
123 | + return printer | |
124 | + else: | |
125 | + host = model.host.Host( | |
126 | + ip_address=hostname, | |
127 | + mac_address=host.get('mac'), | |
128 | + hostname=host.get('hostname'), | |
129 | + inclusion_date=host.get('endtime'), | |
130 | + scantime=scantime, | |
131 | + open_ports=host['ports'], | |
132 | + ) | |
133 | + | |
134 | + return host | |
135 | + else: | |
136 | + # Não foi possível identificar. Só gera um host genérico | |
137 | + scantime = int(host.get('endtime')) - int(host.get('starttime')) | |
138 | + host = model.host.Host( | |
139 | + ip_address=hostname, | |
140 | + mac_address=host.get('mac'), | |
141 | + hostname=host.get('hostname'), | |
142 | + inclusion_date=host.get('endtime'), | |
143 | + scantime=scantime, | |
144 | + open_ports=host['ports'], | |
145 | + ) | |
146 | + | |
147 | + return host | |
0 | 148 | \ No newline at end of file | ... | ... |
development.ini-dist
1 | 1 | [cocar] |
2 | 2 | data_dir = /srv/cocar-agente/cocar_data |
3 | 3 | |
4 | +[sqlalchemy] | |
5 | +url = sqlite:////srv/cocar-agente/cocar-data/tests/cocar-test.db | |
6 | + | |
4 | 7 | # Begin logging configuration |
5 | 8 | [loggers] |
6 | -keys = root, cocar | |
9 | +keys = root, cocar, sqlalchemy | |
7 | 10 | |
8 | 11 | [handlers] |
9 | 12 | keys = console |
... | ... | @@ -20,6 +23,11 @@ level = DEBUG |
20 | 23 | handlers = |
21 | 24 | qualname = lbgenerator |
22 | 25 | |
26 | +[logger_sqlalchemy] | |
27 | +level = INFO | |
28 | +handlers = | |
29 | +qualname = sqlalchemy.engine | |
30 | + | |
23 | 31 | [handler_console] |
24 | 32 | class = StreamHandler |
25 | 33 | args = (sys.stderr,) | ... | ... |
setup.py
1 | -from distutils.core import setup | |
1 | +from setuptools import setup, find_packages | |
2 | 2 | |
3 | 3 | requires = [ |
4 | 4 | 'multiprocessing', |
5 | 5 | 'python-nmap', |
6 | 6 | 'ipy', |
7 | 7 | 'netaddr', |
8 | - 'netifaces' | |
8 | + 'netifaces', | |
9 | + 'lxml', | |
10 | + 'sqlalchemy' | |
9 | 11 | ] |
10 | 12 | |
11 | 13 | |
12 | 14 | setup( |
13 | 15 | name='cocar-agente', |
14 | 16 | version='1.0', |
15 | - packages=['cocar', 'cocar.tests'], | |
17 | + packages=find_packages(), | |
18 | + include_package_data=True, | |
16 | 19 | url='http://github.com/lightbase/cocar-agente', |
17 | 20 | license='CC-GPL v2.0', |
18 | 21 | author='Lightbase Consultoria', |
19 | 22 | author_email='info@lightbase.com.br', |
20 | 23 | description='Agente coletor do software Cocar', |
24 | + test_suite='cocar', | |
21 | 25 | install_requires=requires, |
22 | 26 | ) | ... | ... |