@@ -42,7 +42,6 @@ def run_host(ip)
42
42
each_user_pass do |user , pass |
43
43
do_login ( user , pass )
44
44
end
45
-
46
45
end
47
46
48
47
def report_cred ( opts )
@@ -110,7 +109,6 @@ def is_app_epmp1000?
110
109
#
111
110
112
111
def do_login ( user , pass )
113
-
114
112
print_status ( "#{ rhost } :#{ rport } - Trying username:#{ user . inspect } with password:#{ pass . inspect } " )
115
113
116
114
begin
@@ -119,7 +117,7 @@ def do_login(user, pass)
119
117
{
120
118
'uri' => '/cgi-bin/luci' ,
121
119
'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' } ,
123
121
'vars_post' =>
124
122
{
125
123
'username' => 'dashboard' ,
@@ -137,9 +135,6 @@ def do_login(user, pass)
137
135
138
136
if ( res && res . code == 200 && res . headers . include? ( 'Set-Cookie' ) && res . headers [ 'Set-Cookie' ] . include? ( 'sysauth' ) )
139
137
140
- get_cookie = res . headers [ 'Set-Cookie' ]
141
- get_stok = res . headers [ 'Set-Cookie' ] . match ( /stok=(.*)/ )
142
- stok_value = get_stok [ 1 ]
143
138
sysauth_value = res . headers [ 'Set-Cookie' ] . match ( /((.*)[$ ])/ )
144
139
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"
145
140
@@ -163,9 +158,9 @@ def do_login(user, pass)
163
158
164
159
print_good ( "SUCCESSFUL LOGIN - #{ rhost } :#{ rport } - #{ user . inspect } :#{ pass . inspect } " )
165
160
166
- #
167
- # Extract ePMP version
168
- #
161
+ #
162
+ # Extract ePMP version
163
+ #
169
164
res = send_request_cgi (
170
165
{
171
166
'uri' => '/' ,
0 commit comments