Standardize prints, clean up whitespace/warnings
parent
b822a41004
commit
68ee692c19
|
@ -69,9 +69,8 @@ class Metasploit3 < Msf::Auxiliary
|
||||||
|
|
||||||
while @run # Not exactly thrilled we can never turn this off XXX fix this sometime.
|
while @run # Not exactly thrilled we can never turn this off XXX fix this sometime.
|
||||||
packet, addr = @sock.recvfrom(512)
|
packet, addr = @sock.recvfrom(512)
|
||||||
vprint_status("Packet Received from #{addr[3]}")
|
|
||||||
|
|
||||||
rhost = addr[3]
|
rhost = addr[3]
|
||||||
|
|
||||||
break if packet.length == 0
|
break if packet.length == 0
|
||||||
|
|
||||||
nbnsq_transid = packet[0..1]
|
nbnsq_transid = packet[0..1]
|
||||||
|
@ -91,7 +90,7 @@ class Metasploit3 < Msf::Auxiliary
|
||||||
|
|
||||||
if (nbnsq_decodedname =~ /#{datastore['REGEX']}/i)
|
if (nbnsq_decodedname =~ /#{datastore['REGEX']}/i)
|
||||||
|
|
||||||
vprint_status("Regex matched #{nbnsq_decodedname} from #{rhost}. Sending reply...")
|
vprint_good("#{rhost.ljust 16} nbns - #{nbnsq_decodedname} matches regex, responding with #{datastore["SPOOFIP"]}")
|
||||||
|
|
||||||
if datastore['DEBUG']
|
if datastore['DEBUG']
|
||||||
print_status("transid: #{nbnsq_transid.unpack('H4')}")
|
print_status("transid: #{nbnsq_transid.unpack('H4')}")
|
||||||
|
@ -139,7 +138,7 @@ class Metasploit3 < Msf::Auxiliary
|
||||||
close_pcap
|
close_pcap
|
||||||
|
|
||||||
else
|
else
|
||||||
vprint_status("Packet received from #{rhost} with name #{nbnsq_decodedname} did not match regex")
|
vprint_status("#{rhost.ljust 16} nbns - #{nbnsq_decodedname} did not match regex")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -150,7 +150,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||||
|
|
||||||
print_status("Exploiting #{rhost} with target '#{target_info.name}' with #{pkt.length} bytes to port #{rport}...")
|
print_status("Exploiting #{rhost} with target '#{target_info.name}' with #{pkt.length} bytes to port #{rport}...")
|
||||||
|
|
||||||
r = udp_sock.sendto(pkt, rhost, rport, 0)
|
udp_sock.sendto(pkt, rhost, rport, 0)
|
||||||
|
|
||||||
1.upto(5) do
|
1.upto(5) do
|
||||||
::IO.select(nil, nil, nil, 1)
|
::IO.select(nil, nil, nil, 1)
|
||||||
|
@ -346,7 +346,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||||
|
|
||||||
# Generate a buffer that provides a starting point for exploit development
|
# Generate a buffer that provides a starting point for exploit development
|
||||||
def target_debug
|
def target_debug
|
||||||
buffer = Rex::Text.pattern_create(2000)
|
Rex::Text.pattern_create(2000)
|
||||||
end
|
end
|
||||||
|
|
||||||
def stage_real_payload(cli)
|
def stage_real_payload(cli)
|
||||||
|
@ -417,7 +417,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||||
|
|
||||||
res = nil
|
res = nil
|
||||||
1.upto(5) do
|
1.upto(5) do
|
||||||
res,addr,info = udp_sock.recvfrom(65535, 1.0)
|
res,_,_ = udp_sock.recvfrom(65535, 1.0)
|
||||||
break if res and res =~ /^(Server|Location)/mi
|
break if res and res =~ /^(Server|Location)/mi
|
||||||
udp_sock.sendto(msearch, rhost, rport, 0)
|
udp_sock.sendto(msearch, rhost, rport, 0)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue