vulhub-Kioptrix Level 3
Tools:
- netdiscover
- Nmap
- Nikto
- Metasploit
- Wfuzz
- Hashcat
Use netdiscover to detect target IP address
netdiscover -i eth0 -r 192.168.79.0/24
![[title manually exploit [alt text]]](/images/blog/vulhub/kioptrix3/Selection_001.png)
192.168.79.184 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.79.184 -p-
![[title manually exploit [alt text]]](/images/blog/vulhub/kioptrix3/Selection_002.png)
Ports 22 and 80 are opening.
Now use Nikto to scan:
nikto -h 192.168.79.184
![[title manually exploit [alt text]]](/images/blog/vulhub/kioptrix3/Selection_003.png)
Nothing excited.
Now lets browser the web page in the target.
![[title manually exploit [alt text]]](/images/blog/vulhub/kioptrix3/Selection_004.png)
![[title manually exploit [alt text]]](/images/blog/vulhub/kioptrix3/Selection_005.png)
Find the target may use LotusCMS.
In msfconsole:
search LotusCMS
![[title manually exploit [alt text]]](/images/blog/vulhub/kioptrix3/Selection_006.png)
find one exploit
1 2 3 4 5 6 | |
![[title manually exploit [alt text]]](/images/blog/vulhub/kioptrix3/Selection_007.png)
Got the shell, next step is try to get root.
In this step, I tried to enumeration all kinds of shit and use serveral vernerable kernel exploits to get the root but failed. During the emumeration. I found a ffile gconfig.php is interesting. Then I found that:
![[title manually exploit [alt text]]](/images/blog/vulhub/kioptrix3/Selection_009.png)
maybe the username/password for ssh, but no. Thats too easy.
So that I go back to use wfuzz the scan the http services.
![[title manually exploit [alt text]]](/images/blog/vulhub/kioptrix3/Selection_008.png)
Looks like it has phpmyadmin. Try that:
![[title manually exploit [alt text]]](/images/blog/vulhub/kioptrix3/Selection_010.png)
Log in using the username/password that just found. Successed.
review the content, found this:
![[title manually exploit [alt text]]](/images/blog/vulhub/kioptrix3/Selection_011.png)
now found two users and the hashed passwords:
![[title manually exploit [alt text]]](/images/blog/vulhub/kioptrix3/Selection_012.png)
Copy the passwords to a file use hashcat to crack it:
hashcat hash.txt /user/share/wordlists/rockyou.txt
get both passwords:
![[title manually exploit [alt text]]](/images/blog/vulhub/kioptrix3/Selection_013.png)
![[title manually exploit [alt text]]](/images/blog/vulhub/kioptrix3/Selection_014.png)
ssh to the target, search the SUID binaries:
find / -perm +6000 -type f -exec ls -ld {} \;
found an interesting file /uss/local/bin/ht, I googled it and found it is a hex editor.
now try to use it to open /etc/sudoers file, get error message. to fix it:
export TERM=xterm
change the loneferret permission:
![[title manually exploit [alt text]]](/images/blog/vulhub/kioptrix3/Selection_020.png)
get the root
![[title manually exploit [alt text]]](/images/blog/vulhub/kioptrix3/Selection_021.png)
DONE