Skip to content

Commit 505de0b

Browse files
committed
Use vars_post instead of direct body construction
1 parent a5db933 commit 505de0b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

modules/auxiliary/scanner/openvas/openvas_gsad_login.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,18 @@ def run_host(ip)
7575
def do_login(user='openvas', pass='openvas')
7676
vprint_status("#{msg} - Trying username:'#{user}' with password:'#{pass}'")
7777
headers = {}
78-
data = 'cmd=' << datastore['OMP_cmd'] << '&text=' << datastore['OMP_text'] << '&login=' << user << '&password=' << pass
7978
begin
8079
res = send_request_cgi({
8180
'encode' => true,
8281
'uri' => datastore['URI'],
8382
'method' => 'POST',
8483
'headers' => headers,
85-
'data' => data
84+
'vars_post' => {
85+
'cmd' => datastore['OMP_cmd'],
86+
'text' => datastore['OMP_text'],
87+
'login' => user,
88+
'password' => pass
89+
}
8690
}, 25)
8791

8892
rescue ::Rex::ConnectionError, Errno::ECONNREFUSED, Errno::ETIMEDOUT

0 commit comments

Comments
 (0)