@@ -49,8 +49,8 @@ def initialize
49
49
50
50
register_options (
51
51
[
52
- OptString . new ( 'FILE' , [ false , 'File to retrieve (make sure path/file match OS (ie, /etc/passwd on Windows == dumb)) ' , '' ] ) ,
53
- OptBool . new ( 'FINGERPRINT' , [ true , 'Only fingerprint endpoints' , false ] ) ,
52
+ OptString . new ( 'FILE' , [ false , 'File to retrieve' , '' ] ) ,
53
+ OptBool . new ( 'FINGERPRINT' , [ true , 'Only fingerprint endpoints' , false ] )
54
54
] , self . class )
55
55
end
56
56
@@ -115,7 +115,8 @@ def run_host(ip)
115
115
'method' => 'GET' ,
116
116
'Connection' => "keep-alive" ,
117
117
'Accept-Encoding' => "zip,deflate" ,
118
- } , 10 )
118
+ } )
119
+
119
120
return if not res or not res . body or not res . code
120
121
121
122
if ( res . code . to_i == 200 )
@@ -172,31 +173,26 @@ def run_host(ip)
172
173
'Connection' => "keep-alive" ,
173
174
'Accept-Encoding' => "zip,deflate" ,
174
175
} ,
175
- } , - 1 )
176
+ } )
176
177
177
178
178
179
if ( res . nil? )
179
180
print_error ( "no response for #{ ip } :#{ rport } #{ url } " )
180
181
elsif ( res . code == 200 )
181
182
#print_error("#{res.body}")#debug
182
- out << "URL: #{ ip } #{ url } #{ locale } #{ trav } \n "
183
- if match = res . body . match ( /\< title\> (.*)\< \/ title\> /im )
183
+ print_status ( "URL: #{ ip } #{ url } #{ locale } #{ trav } " )
184
+ if res . body . match ( /\< title\> (.*)\< \/ title\> /im )
184
185
fileout = $1
185
186
if ( fileout !~ /Login$/ and fileout !~ /^Welcome to ColdFusion/ and fileout !~ /^Archives and Deployment/ )
186
- out << "#{ ip } FILE:\n #{ fileout } \r \n "
187
- break
187
+ print_good ( "#{ ip } FILE: #{ fileout } " )
188
+ break
188
189
end
189
190
end
190
191
else
191
192
next if ( res . code == 500 or res . code == 404 or res . code == 302 )
192
193
print_error ( "#{ ip } #{ res . inspect } " )
193
194
end
194
195
end
195
- if ( out =~ /FILE/ )
196
- print_good ( out )
197
- else
198
- print_status ( out )
199
- end
200
196
201
197
rescue ::Rex ::ConnectionRefused , ::Rex ::HostUnreachable , ::Rex ::ConnectionTimeout , ::ArgumentError
202
198
rescue ::Timeout ::Error , ::Errno ::EPIPE
0 commit comments