
The graph functionality of DeimosC2 v1.1.0-Beta is vulnerable to Stored Cross-Site Scripting (XSS), allowing the theft of session cookie and unauthorized access to the C2 server.
The code to exploit this vulnerability can be seen in 'spoof.go'. This imitates as an agent to the C2 server. In order to run this vulnerability we need to know:
We could obtain this information by reverse engineering a binary previously generated by the operator.
Currently, 'spoof.go' only works when both the listener and agent use the HTTPS protocol, however, if adapted this will likely work with the other protocols DeimosC2 supports.
You will need access to a HTTPS binary previously generated by the operator.
Extract the IP address, port, the public key and first time check in URL of the listener from the binary. Trend Micro provide scripts to aid in this.
Place the IP address, port, the public key and first time check in URL of the listener into the script.
Install the DeimosC2 Crypto Library
go install github.com/DeimosC2/DeimosC2/lib/crypto@latest
go run Spoof.go
If you only have access to a binary with one of the other protocols, spoof.go will need to be adapted to support the other protocols.
A full writeup on how I discovered this vulnerability can be seen on my blog here.