December 6, 2017
Everyday new methods and tools are being discovered that could be used during red team engagements. Special focus is given into command and control channels that can evade security products and can hide traffic by using non-conventional methods. Arno0x0x discovered that some web gateways doesn’t inspect web socket content. Therefore it could be used as a communication channel for execution of arbitrary commands to hosts.
Arno0x0x developed a command and control tool (WSC2) which implements this method. The tool is written in python and can be used for data exfiltration since it provides file transfer capability and shell functionality.
It is possible to clone a legitimate website that will be hosted in a webserver (attacker machine) and will contain the malicious websocket code. At the time being WSC2 can generate three different java script stagers.
When the stager will be executed on the target a connection will be established with the WSC2 controller.
Alternatively the HTML stager can be executed when the user visit the malicious URL.
From the connected agent (host) it is possible to get some basic shell functionality by using the cli command.
Commands can be executed from the shell.
Additionally WSC2 provides file transfer capability. Files that will be retrieved from the target will be stored in the incoming folder of the tool.
Files can be hosted also on the target to perform further post-exploitation activities.
The uploaded file will be stored on the folder which the stager has been executed initially.
From the perspective of a defender this will look like web traffic coming from Internet Explorer which will not raise any suspicion.