Windows Shells

Most commonly exploited vulnerabilities
  • Vulnerability: Description
  • MS08-067: SMB flaw exploited by Conficker and Stuxnet to infiltrate Windows systems
  • Eternal Blue: SMBv1 protocol exploit used by WannaCry and NotPetya
  • PrintNightmare: Remote execution in the Print Spooler that allows access as SYSTEM
  • BlueKeep MS17-010: Remote execution in RDP, affecting versions up to Windows Server 2008 R2 - 2016
  • Sigred: DNS vulnerability that grants domain administrator privileges
  • SeriousSam: Reading the SAM file to extract credentials
  • Zerologon: Critical Netlogon vulnerability that allows Active Directory accounts to be altered

System Detection

When the TTL is 32 or 128, we are usually dealing with Windows systems. In Nmap, we can use the -O -A flags

File Types for Windows Payloads

  • DLL: Dynamic library injection to execute malicious code.
  • Batch (.bat): Script files that execute multiple commands in CMD.
  • VBS: Lightweight scripts, although disabled in modern browsers, useful for phishing.
  • MSI: Installation files that can contain malicious payloads.
  • PowerShell: Powerful tool for executing advanced commands and scripts on modern systems.

Generate Payloads

  • MSFVenom & Metasploit-Framework: To create specific payloads according to the operating system and protocol
  • Payloads All The Things: Repo with various things
  • Mythic C2 Framework: Alternative Command and Control framework to Metasploit and toolbox for payload generation.
  • Nishang: Offensive PowerShell scripts
  • Darkarmour: Obfuscated binary generator

Windows System Compromise Process (example)

  • System enumeration:
  • Use nmap to detect open ports and services.
  • Identify specific vulnerabilities (such as MS17-010).
  • Vulnerability validation:
  • Use Metasploit modules such as auxiliary/scanner/smb/smb_ms17_010.
  • Exploitation:
  • Configure the exploit (ms17_010_psexec) with a payload (e.g., windows/meterpreter/reverse_tcp).
  • Execution and shell access:
  • Gain access as NT AUTHORITY\SYSTEM through Meterpreter