Greetings. This week, I am excited to unveil Hawk, a tool I developed specifically for monitoring /proc
for SSH, SU, Sudo, and Passwd credentials on Linux systems. Hawk is adept at escalating privileges within a network by capturing credentials in real time as they are used.
https://github.com/ProDefense/Hawk
For instance, if Hawk is deployed on a system and a legitimate user performs a password-based SSH login, Hawk can extract those credentials directly from memory and exfiltrate them to a designated web server. Crafted in Golang, Hawk not only captures administrative credentials used by sshd, sudo, passwd, and su services but also exfiltrates them back to a centralized web or C2 server.
This tool was initially created for the Western Regional Collegiate Cyber Defense Competition (WRCCDC) competition, where it performed exceptionally well, allowing our red team continuous access to all teams’ systems by capturing their active credentials.
Hawk operates by scanning the /proc
folder on Linux machines every 250 milliseconds for new processes. It specifically looks for processes related to ssh, su, sudo, or passwd commands. Upon identifying a relevant process, Hawk initiates a Go routine to trace it using the following method:
Once the credentials are intercepted, they are securely transmitted using the exfilPassword
function. Below is a simplified illustration of how credentials might be exfiltrated
using HTTP/HTTPS protocol in a controlled environment:
In practice, especially for red team operations, transferring sensitive data such as credentials would typically involve more secure and sophisticated methods to ensure the data’s integrity and confidentiality. The private version of Hawk includes a suite of diverse exfiltration techniques tailored to different operational requirements. If you are interested in exploring these advanced capabilities, I invite you to reach out via LinkedIn or Twitter for more information.
During the WRCCDC, teams gain access to an array of machines. From a red team perspective, the strategy is straightforward: secure access to one machine and leverage that foothold to compromise the rest of the network. While this approach seems direct, it’s typically at this juncture that many teams struggle, primarily due to credential reuse.
However, the blue teams often face an uphill battle against the private version of Hawk. In this enhanced version, Hawk operates as a kernel module, cleverly concealing itself from standard userland diagnostics. Moreover, it skillfully evades both Uncomplicated Firewall (UFW) and IPTables rules, making it a formidable tool in our arsenal.
During the competition, we utilized Hawk to intercept and relay credentials back to our base of operations. We then tested these credentials across the network to gain further access and establish Sliver shells — an advanced command and control framework. This strategic implementation led to significant network escalation, as illustrated in the following screenshot:
Yes, those are all sliver sessions :)
Implementing Hawk into red team tactics, techniques, and procedures (TTPs) offers a robust route for achieving persistent access and network escalation. By integrating Hawk, red teams can effectively bypass common defensive measures, extract critical authentication data silently, and use this information to systematically expand their control over networked environments.
For red teamers, Hawk not only serves as a tool for initial access but also supports sustained operations by providing continual data exfiltration and network testing capabilities. This dual utility makes Hawk an indispensable part of red team toolkits, especially in competitive environments like CCDC, where teams must rapidly adapt to evolving network defenses.
Hawk’s ability to remain undetected and its versatility in handling different network scenarios shows off its value in simulating sophisticated cyber threats. Such tools not only challenge the defensive strategies of blue teams but also push them towards adopting more advanced and resilient security measures.