Backfire

Recon

nmap_scan.log

HTTP (8080)

Just 2 files available for download

Writeup.png

Havoc C2

Havocarrow-up-right: Havoc is a modern and malleable post-exploitation command and control framework, created by @C5piderarrow-up-right.

SSRF

Havoc-C2-SSRF-pocarrow-up-rightUnauthenticated SSRF (CVE-2024-41570) on Havoc C2 teamserver via spoofed demon agentarrow-up-right

PoC seems to have worked since we got a callback from the server itself

Writeup-1.png

Hmmm... but SSRF what exactly..

Vulnerabilities in Open Source C2 Frameworksarrow-up-right -> https://github.com/IncludeSecurity/c2-vulnerabilities/blob/main/havoc_auth_rce/havoc_rce.pyarrow-up-right

After many trials and errors we were able to combine SSRF with RCE to get command execution. Since Havoc is using websockets we must write our packets in raw format, no socket modules and whatnot (GPT was kind enough to provide code for that). First we upgrade communication to WebSockets, then start the injection of RCE commands which is in above repo.

SSRF + RCE

SSRF script was modified to match our needs, after Custom RCE starts.

Writeup-2.png

Since it's a Linux box I first tried busybox nc for reverse shell and it worked.

SSH (22)

Upgrade to SSH

User.txt

Privilege Escalation (sergej)

Passwords in havoc.yaotl doesn't work on the box users.

Googling about this C2 first post I see is HardHatC2 0-Days (RCE & AuthN Bypass)arrow-up-right

HardHatC2

HardHatC2 server is running on port 7096 internally

sergej is running this C2 server so we can't read files

Github repo mentions port 5000 which seems to be TeamServer listener

Writeup-3.png

Port forward

Writeup-4.png

Frontend is using Blazor, but I couldn't find any DLL in traffic.

Credentials from Havoc still didn't work.

I thought that 5000 was serving Havoc files, but it was 8000 which was serving them; Port forward both of them

Auth Bypass

Using blog's script we are able to create an account:

Writeup-5.png

RCE

Writeup-6.png

We are running commands as serjey

Upgrade to SSH, serjey doesn't have key

Hit SEND like 1000times to actually execute command....

Privilege Escalation (root)

IPTables

A Journey From sudo iptables To Local Privilege Escalationarrow-up-right

We are unable to write to /etc/passwd

The file has immutable attribute which means almost nothing can change this file, not even root unless it is removed.

Root.txt

Last updated