Handy Commands & Payloads

Commands and Payloads that I use the most to get the basics covered.

Nmap

Initial Port Scan and Service Scan with Evasive Techniques:

nmap -f -D RND:10 -p- -Pn $TARGET

nmap -sC -sV -p $(nmap -f -D RND:10 -p- -Pn $TARGET | grep '^[0-9]' | cut -d '/' -f 1 | tr '\n' ',') $TARGET

Other nmap scans:

sudo nmap -Pn -p 3389 -ff -send-eth -script rdp-enum-encryption $IP

Test SSL

testssl $URL

Nikto

nikto -host $URL
nikto -h $URL -O STATIC-COOKIE="Authorization: Bearer..."

Nuclei

nuclei -u $URL
nuclei -u $URL -H "cookie: "

# Use secrets.yaml file for other authentication mechanisms

Nuclei Fuzzer

Directory Fuzzing

  1. Gobuster:

  2. ffuf (Basic):

  3. Ffuf (API):

VHOST Fuzzing

SQLi

XSS Best Payloads

SQL Injection Payloads

NoSQL Injection Payloads

SSRF Payloads

XXE Payloads

SSTI Payloads

File Inclusion Payloads

CRLF Injection Payloads

Easy Vulnerabilities & Security Misconfigurations to Report

Vulnerabilities that could be found in the early stages (first few hours) of a pentest.

Security Headers

  • Misconfigured Security Headers:

    • X-Frame-Options

    • X-XSS-Protection

    • X-Content-Type-Options

    • Strict-Transport-Security

    • Content-Security-Policy (CSP)

    • Referrer-Policy

Cross-Origin Resource Sharing (CORS)

  • Insecure CORS Configuration:

    • Allowing wildcard (*) origin

    • Allowing untrusted origins

    • Lack of proper validation

  • Insecure Cookie Attributes:

    • Missing HttpOnly flag

    • Missing Secure flag

    • Missing SameSite attribute

Authentication & Session Management

  • Concurrent Logins Allowed:

    • Multiple sessions from different IPs

  • Improper Session Timeout:

    • Long or no session expiration

  • Improper Invalidation of Cookie Post Logout:

    • Session remains active after logout

  • Weak Password Policies:

    • No complexity requirements

    • Lack of rate limiting

File Handling

  • Unrestricted File Upload:

    • No file type validation

    • No file size restrictions

    • No scanning for malware

Access Controls

  • Staging Environment Accessible from External Network:

    • Exposed internal environments

  • Sensitive Directories Accessible:

    • /.git/, /.svn/, /backup/, /config/

Web Server Configuration

  • Clickjacking:

    • Missing X-Frame-Options header

  • Weak SSL Ciphers:

    • Use of deprecated SSL/TLS versions

    • Weak cipher suites enabled

  • Web Server Fingerprinting:

    • Banner Grabbing revealing server information

Information Disclosure

  • Verbose Error Messages:

    • Detailed stack traces

    • Application/Server details in error messages

  • Directory Listing Enabled:

    • Ability to list files in web directories

Business Logic & Other Issues

  • Lack of Rate Limiting:

    • Brute force or DoS vulnerabilities

  • No Account Lockout:

    • Unlimited login attempts

  • Weak Default Credentials:

    • Use of default passwords for admin accounts

  • HTTP Methods:

    • TRACE/TRACK methods enabled

  • Referrer Policy:

    • No Referrer Policy header

  • API Security:

    • Lack of authentication

    • Lack of rate limiting

    • Exposed sensitive endpoints

  • Insecure Direct Object References (IDOR):

    • Direct access to unauthorized resources

  • Lack of Input Validation:

    • No sanitization of user input

Additional Points

  • Backup Files Accessible:

    • .bak, .old, .save files accessible

  • Exposed API Keys or Tokens:

    • API keys or tokens in URLs, JavaScript, etc.

  • Insufficient Logging and Monitoring:

    • Lack of logging for security events

  • Cross-Site Request Forgery (CSRF):

    • Missing or incorrect CSRF tokens

  • Insufficient Transport Layer Security:

    • HTTP instead of HTTPS

  • Autocomplete Enabled for Sensitive Fields:

    • Sensitive form fields have autocomplete enabled

  • Insecure Directories:

    • /admin/, /config/, /backup/ directories exposed

  • Insecure Third-Party Integrations:

    • Unpatched or outdated third-party libraries and frameworks

Last updated