#!/bin/bash
# Phase 6 — C2 & Post-Exploitation
source "$(dirname "$0")/lib.sh"

phase_header "PHASE 6 — C2 Frameworks & Post-Exploitation"

section "C2 Frameworks"
chk "msfconsole"        msfconsole
chk "msfvenom"          msfvenom
chk "sliver-client"     sliver-client
chk_dir "Empire"        /opt/Empire
chk_dir "Villain"       /opt/Villain
chk_dir "PoshC2"        /opt/PoshC2
chk_opt "Havoc"         /opt/Havoc   # GUI-only C2, not suitable for headless container

section "Tunneling & Pivoting"
chk "chisel"            chisel
chk "ligolo-proxy"      ligolo-proxy
chk "ligolo-agent"      ligolo-agent
chk "socat"             socat
chk "proxychains4"      proxychains4

section "DNS Tunneling"
chk "iodine"            iodine
chk_dir "dnscat2"       /opt/dnscat2

section "Payload Generation"
chk "msfvenom"          msfvenom
chk_dir "ScareCrow"     /opt/ScareCrow
chk_py "donut-shellcode" donut
chk_dir "Veil"          /opt/Veil
chk_dir "macro_pack"    /opt/macro_pack

section "Evasion"
chk_dir "SysWhispers3"  /opt/SysWhispers3
chk_py "pypykatz"       pypykatz

section "Persistence / AD"
chk_dir "DeathStar"     /opt/DeathStar
chk_dir "DonPAPI"       /opt/DonPAPI
chk "bloodyAD"          bloodyAD

section "Lateral Movement"
chk "evil-winrm"        evil-winrm
chk "netexec"           netexec
chk "crackmapexec"      crackmapexec
chk "impacket-wmiexec"  impacket-wmiexec
chk "impacket-psexec"   impacket-psexec
chk "impacket-smbexec"  impacket-smbexec

section "Credential Extraction"
chk_py "pypykatz"       pypykatz
chk_dir "DonPAPI"       /opt/DonPAPI

section "RDP"
chk_py "pyrdp"          pyrdp

section "Purple Team"
chk_dir "Atomic Red Team" /opt/atomic-red-team
chk_dir "Caldera"       /opt/caldera

phase_summary
