MCPcopy Index your code
hub / github.com/secdev/scapy / nmap_search

Function nmap_search

scapy/modules/nmap.py:201–215  ·  view source on GitHub ↗
(sigs)

Source from the content-addressed store, hash-verified

199
200
201def nmap_search(sigs):
202 # type: (Dict) -> Tuple[Union[int, float], List]
203 guess = 0, [] # type: Tuple[Union[int, float], List]
204 conf.nmap_kdb = cast(NmapKnowledgeBase, conf.nmap_kdb)
205 for osval, fprint in conf.nmap_kdb.get_base():
206 score = 0.0
207 for test, values in fprint.items():
208 if test in sigs:
209 score += nmap_match_one_sig(sigs[test], values)
210 score /= len(sigs)
211 if score > guess[0]:
212 guess = score, [osval]
213 elif score == guess[0]:
214 guess[1].append(osval)
215 return guess
216
217
218@conf.commands.register

Callers 1

nmap_fpFunction · 0.85

Calls 4

nmap_match_one_sigFunction · 0.85
itemsMethod · 0.80
get_baseMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected