Skip to content

Commit 9238d80

Browse files
committed
Use correct source port for NBNS spoofer
137 is only correct for systems that use this as their source port. Systems running Samba, for example, don't use this. So use the port taken from the original request, not 137 or 1337
1 parent 96ba6da commit 9238d80

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

modules/auxiliary/spoof/nbns/nbns_response.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ def run
6767

6868
while @run # Not exactly thrilled we can never turn this off XXX fix this sometime.
6969
packet, addr = @sock.recvfrom(512)
70+
src_port = addr[1]
7071
rhost = addr[3]
7172

7273
break if packet.length == 0
@@ -127,7 +128,7 @@ def run
127128
p.ip_daddr = rhost
128129
p.ip_ttl = 255
129130
p.udp_sport = 137
130-
p.udp_dport = 137
131+
p.udp_dport = src_port
131132
p.payload = response
132133
p.recalc
133134

0 commit comments

Comments
 (0)