Show message at the end

bug/bundler_fix
root 2014-12-15 16:26:39 +01:00
parent 288954afa0
commit 6480ae2c03
1 changed files with 6 additions and 5 deletions

View File

@ -39,7 +39,7 @@ class Metasploit3 < Msf::Post
OptInt.new('MIN_TTL', [true, 'Starting TTL value.', 1]), OptInt.new('MIN_TTL', [true, 'Starting TTL value.', 1]),
OptString.new('PORTS', [true, 'Ports to test (e.g. 80,443,100-110).','80,443']), OptString.new('PORTS', [true, 'Ports to test (e.g. 80,443,100-110).','80,443']),
OptInt.new('TIMEOUT', [true, 'Timeout for the ICMP socket.', 3]), OptInt.new('TIMEOUT', [true, 'Timeout for the ICMP socket.', 3]),
OptBool.new('STOP', [true, 'Stop when it finds a public IP.', false]) OptBool.new('STOP', [true, 'Stop when it finds a public IP.', true])
], self.class) ], self.class)
end end
@ -161,6 +161,7 @@ class Metasploit3 < Msf::Post
ports = Rex::Socket.portspec_crack(datastore['PORTS']) ports = Rex::Socket.portspec_crack(datastore['PORTS'])
ports.each do |dport| ports.each do |dport|
pub_ip = false
print_status("Testing port #{dport}...") print_status("Testing port #{dport}...")
0.upto(datastore['HOPS'] - 1) { |i| 0.upto(datastore['HOPS'] - 1) { |i|
i = i + datastore['MIN_TTL'] i = i + datastore['MIN_TTL']
@ -172,17 +173,17 @@ class Metasploit3 < Msf::Post
hop = connections(remote, dport, h_icmp, h_tcp, to) hop = connections(remote, dport, h_icmp, h_tcp, to)
if hop != nil if hop != nil
print_good("#{i} #{hop}") print_good("#{i} #{hop}")
if datastore['STOP'] == true and !Rex::Socket.is_internal?(hop) if !Rex::Socket.is_internal?(hop)
print_good("Public IP reached. The port #{dport} is not filtered") pub_ip = true
break break if datastore['STOP'] == true
end end
else else
print_error("#{i} *") print_error("#{i} *")
end end
client.railgun.ws2_32.closesocket(h_tcp) client.railgun.ws2_32.closesocket(h_tcp)
client.railgun.ws2_32.closesocket(h_icmp) client.railgun.ws2_32.closesocket(h_icmp)
} }
print_good("Public IP reached. The TCP port #{dport} is not filtered") if pub_ip == true
end end
end end
end end