1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-06 12:41:29 +00:00

Make osclasses a substructure of osmatch.

This commit is contained in:
david
2012-05-05 18:02:41 +00:00
parent 56b7063aa9
commit cac71422e8
7 changed files with 68 additions and 76 deletions

View File

@@ -148,15 +148,14 @@ class HostSearch(object):
os = os.lower()
os_str = ""
osclasses = host.get_osclasses()
osmatches = host.get_osmatches()
for osclass in osclasses:
os_str += osclass['vendor'].lower() + " " +\
osclass['osfamily'].lower() + " " +\
osclass['type'].lower()
for osmatch in osmatches:
os_str += osmatch['name'].lower()
for osclass in osmatch['osmatches']:
os_str += osclass['vendor'].lower() + " " +\
osclass['osfamily'].lower() + " " +\
osclass['type'].lower()
if os in os_str:
return True
@@ -566,7 +565,6 @@ if __name__ == "__main__":
#port_filtered="",
#port_closed="",
#service="",
#osclass="Microsoft | Windows | 95/98/ME | General Purpose",
#osmatch="gentoo",
#product="Apache"\
# ):