Skip to content

Commit 80a9fa4

Browse files
author
Peregrino Gris
committed
Ports default values added, is_internal REX function added, reference added
1 parent 529f749 commit 80a9fa4

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

modules/post/windows/recon/outbound_ports.rb

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,17 @@ def initialize(info={})
2727
'License' => MSF_LICENSE,
2828
'Author' => [ 'Borja Merino <bmerinofe[at]gmail.com>' ],
2929
'Platform' => [ 'win' ],
30-
'SessionTypes' => [ 'meterpreter' ]
30+
'SessionTypes' => [ 'meterpreter' ],
31+
'References' => [
32+
[ 'URL', 'http://www.shelliscoming.com/2014/11/getting-outbound-filtering-rules-by.html' ]
33+
]
3134
))
3235
register_options(
3336
[
3437
OptAddress.new("ADDRESS" , [ true, 'Destination IP address.']),
3538
OptInt.new('HOPS', [true, 'Number of hops to get.', 3]),
3639
OptInt.new('MIN_TTL', [true, 'Starting TTL value.', 1]),
37-
OptString.new('PORTS', [true, 'Ports to test (e.g. 80,443,100-110).']),
40+
OptString.new('PORTS', [true, 'Ports to test (e.g. 80,443,100-110).','80,443']),
3841
OptInt.new('TIMEOUT', [true, 'Timeout for the ICMP socket.', 3]),
3942
OptBool.new('STOP', [true, 'Stop when it finds a public IP.', false])
4043
], self.class)
@@ -165,7 +168,7 @@ def run
165168
hop = connections(remote, dport, h_icmp, h_tcp, to)
166169
if hop != nil
167170
print_good("#{i} #{hop}")
168-
if datastore['STOP'] == true and hop !~ /^\s*(?:10\.|192\.168|172.(?:1[6-9]|2[0-9]|3[01])\.|169\.254)/
171+
if datastore['STOP'] == true and not Rex::Socket.is_internal?(hop)
169172
print_good("Public IP reached. The port #{dport} is not filtered")
170173
break
171174
end

0 commit comments

Comments
 (0)