segofensiva / OSfooler-ng

OSfooler-ng prevents remote active/passive OS fingerprinting by tools like nmap or p0f
GNU General Public License v3.0
200 stars 74 forks source link

Getting error during running nmap #5

Open Sfinx opened 4 years ago

Sfinx commented 4 years ago
Exception NameError: "global name 'payload' is not defined" in 'netfilterqueue.global_callback' ignored
Exception NameError: "global name 'payload' is not defined" in 'netfilterqueue.global_callback' ignored
Exception NameError: "global name 'payload' is not defined" in 'netfilterqueue.global_callback' ignored
Exception NameError: "global name 'payload' is not defined" in 'netfilterqueue.global_callback' ignored

nmap says:

No exact OS matches for host (If you know what OS is running on it, see https://nmap.org/submit/ ).
Sfinx commented 4 years ago

Verbose mode gives this:

 [+] Modifying packet in real time (total length 148)
      [+] IP:   source 10.1.1.203 destination 10.1.1.242 tos 0 id 51870
      [+] ICMP: code 9 type 8 len 120 id 17893 seq 295
Exception NameError: "global name 'payload' is not defined" in 'netfilterqueue.global_callback' ignored

Every IP/ICMP entry throws exception

Sfinx commented 4 years ago

Seems like typo

diff --git a/osfooler_ng/osfooler_ng.py b/osfooler_ng/osfooler_ng.py
index 000cee2..81ae46e 100644
--- a/osfooler_ng/osfooler_ng.py
+++ b/osfooler_ng/osfooler_ng.py
@@ -767,7 +767,7 @@ def cb_nmap( pl):
             print_icmp_packet(pl)
             pl.drop() 
             if (base["IE"][0][0] != "R"):
-                send_icmp_response(payload, "IE")
+                send_icmp_response(pl, "IE")
         elif (pkt.icmp.code == 0) and (pkt.icmp.type == 8) and (len(pkt.icmp.data.data) == 150):
             # nmap packet detected: Packet ICMP #2
             print_icmp_packet(pl)

But nmap still prints "No exact OS matches for host"

prashantvidja commented 4 years ago

Thanks to @Sfinx. for fixing the payload issue. for "No exact OS matches for host" you need to search specific os using -s flag and pass that os using -m for Nmap same as you get in the search result.