@@ -17,8 +17,8 @@ def initialize(info = {})
17
17
This module performs DNS reverse lookup against a given IP range in order to
18
18
retrieve valid addresses and names.
19
19
} ,
20
- 'Author' => [ 'Carlos Perez <carlos_perez[at]darkoperator.com>' , # Base code
21
- 'Thanat0s <thanatos [at]trollprod[dot]org>' ] , # Output, Throttling & Db notes add
20
+ 'Author' => [ 'Carlos Perez <carlos_perez[at]darkoperator.com>' , # Base code
21
+ 'Thanat0s <thanspam [at]trollprod[dot]org>' ] , # Output, Throttling & Db notes add
22
22
'License' => BSD_LICENSE
23
23
) )
24
24
@@ -58,11 +58,11 @@ def reverselkp(iprange)
58
58
print_status ( "Running reverse lookup against IP range #{ iprange } " )
59
59
ar = Rex ::Socket ::RangeWalker . new ( iprange )
60
60
tl = [ ]
61
- # Basic Throttling
61
+ # Basic Throttling
62
62
sleep_time = 0.0
63
63
if ( datastore [ 'THROTTLE' ] != 0 )
64
64
sleep_time = ( 1.0 /datastore [ 'THROTTLE' ] ) /datastore [ 'THREADS' ]
65
- print_status ( "Throttle set to #{ datastore [ 'THROTTLE' ] } queries per seconds" )
65
+ print_status ( "Throttle set to #{ datastore [ 'THROTTLE' ] } queries per seconds" )
66
66
end
67
67
# Output..
68
68
if datastore [ 'OUT_FILE' ]
@@ -79,10 +79,10 @@ def reverselkp(iprange)
79
79
break if not ip
80
80
tl << framework . threads . spawn ( "Module(#{ self . refname } )-#{ ip } " , false , ip . dup ) do |tip |
81
81
begin
82
- sleep ( sleep_time )
82
+ Rex . sleep ( sleep_time )
83
83
query = @res . query ( tip )
84
84
query . each_ptr do |addresstp |
85
- print_status ( "# Host Name: #{ addresstp } , IP Address: #{ tip . to_s } " )
85
+ print_status ( "Host Name: #{ addresstp } , IP Address: #{ tip . to_s } " )
86
86
if datastore [ 'OUT_FILE' ]
87
87
open ( datastore [ 'OUT_FILE' ] , 'a' ) do |f |
88
88
f . puts "#{ tip . to_s } ,#{ addresstp } "
@@ -92,20 +92,17 @@ def reverselkp(iprange)
92
92
:host => tip . to_s ,
93
93
:name => addresstp
94
94
)
95
- if !hosts [ tip ]
95
+ if !hosts [ tip ]
96
96
hosts [ tip ] = Array . new
97
97
end
98
98
hosts [ tip ] . push addresstp
99
99
end
100
-
101
- if hosts [ tip ]
102
- if !hosts [ tip ] . empty?
103
- report_note (
104
- :host => tip . to_s ,
105
- :type => "RDNS_Record" ,
106
- :data => hosts [ tip ]
107
- )
108
- end
100
+ unless hosts [ tip ] . nil? or hosts [ tip ] . empty?
101
+ report_note (
102
+ :host => tip . to_s ,
103
+ :type => "RDNS_Record" ,
104
+ :data => hosts [ tip ]
105
+ )
109
106
end
110
107
rescue ::Interrupt
111
108
raise $!
0 commit comments