Skip to content

Commit 20a5137

Browse files
committed
Minor Edits
1 parent 7791c58 commit 20a5137

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

modules/auxiliary/scanner/http/epmp1000_web_login.rb

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ def run_host(ip)
4242
each_user_pass do |user, pass|
4343
do_login(user, pass)
4444
end
45-
4645
end
4746

4847
def report_cred(opts)
@@ -110,7 +109,6 @@ def is_app_epmp1000?
110109
#
111110

112111
def do_login(user, pass)
113-
114112
print_status("#{rhost}:#{rport} - Trying username:#{user.inspect} with password:#{pass.inspect}")
115113

116114
begin
@@ -119,7 +117,7 @@ def do_login(user, pass)
119117
{
120118
'uri' => '/cgi-bin/luci',
121119
'method' => 'POST',
122-
'headers' => { 'X-Requested-With' => 'XMLHttpRequest', 'Accept' => 'application/json, text/javascript, */*; q=0.01' },
120+
'headers' => { 'X-Requested-With' => 'XMLHttpRequest', 'Accept' => 'application/json, text/javascript, */*; q=0.01' },
123121
'vars_post' =>
124122
{
125123
'username' => 'dashboard',
@@ -137,9 +135,6 @@ def do_login(user, pass)
137135

138136
if (res && res.code == 200 && res.headers.include?('Set-Cookie') && res.headers['Set-Cookie'].include?('sysauth'))
139137

140-
get_cookie = res.headers['Set-Cookie']
141-
get_stok = res.headers['Set-Cookie'].match(/stok=(.*)/)
142-
stok_value = get_stok[1]
143138
sysauth_value = res.headers['Set-Cookie'].match(/((.*)[$ ])/)
144139
cookie1 = "#{sysauth_value}; " + "globalParams=%7B%22dashboard%22%3A%7B%22refresh_rate%22%3A%225%22%7D%2C%22#{user}%22%3A%7B%22refresh_rate%22%3A%225%22%7D%7D"
145140

@@ -163,9 +158,9 @@ def do_login(user, pass)
163158

164159
print_good("SUCCESSFUL LOGIN - #{rhost}:#{rport} - #{user.inspect}:#{pass.inspect}")
165160

166-
#
167-
# Extract ePMP version
168-
#
161+
#
162+
# Extract ePMP version
163+
#
169164
res = send_request_cgi(
170165
{
171166
'uri' => '/',

0 commit comments

Comments
 (0)