Droopy:V0.2
Tools:
- netdiscover
- Nmap
- Wfuzz
- Nikto
- Metasploit
- droopescan
Vulnerabilities:
- Drupal HTTP Parameter Key/Value SQL Injection
- Linux Kernel 3.13.0 < 3.19 ‘overlayfs’ Local Root Shell
Use netdiscover to detect target IP address
netdiscover -i eth0 -r 192.168.41.0/24
![[title manually exploit [alt text]]](/images/blog/vulhub/drooy2/Selection_001.png)
192.168.41.155 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.155 -p-
![[title manually exploit [alt text]]](/images/blog/vulhub/drooy2/Selection_002.png)
Only port 80 is opening.
use nikto to scan
nikto -h 192.168.41.155
![[title manually exploit [alt text]]](/images/blog/vulhub/drooy2/Selection_003.png)
No useful info come out.
1
| |
![[title manually exploit [alt text]]](/images/blog/vulhub/drooy2/Selection_004.png)
still same thing.
check the http://192.168.41.155
![[title manually exploit [alt text]]](/images/blog/vulhub/drooy2/Selection_005.png)
Find the target use Drupal
Use Metasploit
in msfconsole, search drupal, find an interesting exploit exploit/multi/http/drupal_drupageddon
1 2 3 | |
![[title manually exploit [alt text]]](/images/blog/vulhub/drooy2/Selection_006.png)
get meterpreter, do command shell to get shell.
use python -c 'import pty; pty.spawn("/bin/bash")' get bash
user is www-data, next try to get root
uname -a
Linux droopy 3.13.0-43-generic #72-Ubuntu SMP Mon Dec 8 19:35:06 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
the kernel is 3.1.30
searchsploit 3.1.30
![[title manually exploit [alt text]]](/images/blog/vulhub/drooy2/Selection_007.png)
upload the exploit, compile and run it, get the root:
![[title manually exploit [alt text]]](/images/blog/vulhub/drooy2/Selection_008.png)
Another way
use droopescan to scan
droopescan scan drupal -u http://192.168.41.155/ -t 8
![[title manually exploit [alt text]]](/images/blog/vulhub/drooy2/Selection_009.png)
now I know the version is 7.30
searchsploit drupal
find the 34992.txt exploit works.
![[title manually exploit [alt text]]](/images/blog/vulhub/drooy2/Selection_010.png)
./34992.py -t http://192.168.41.155 -u test -p test
![[title manually exploit [alt text]]](/images/blog/vulhub/drooy2/Selection_011.png)
this exploit creates an admin account test/test, then in Modules, make sure the PHP filter is selected.
![[title manually exploit [alt text]]](/images/blog/vulhub/drooy2/Selection_012.png)
Also in People -> Permissions, check Use the PHP code text format
![[title manually exploit [alt text]]](/images/blog/vulhub/drooy2/Selection_013.png)
In configuration -> Content authoring -> Text formats, need to check administrator box.
![[title manually exploit [alt text]]](/images/blog/vulhub/drooy2/Selection_014.png)
Then create a new content (copy and paste reverse shell php code) and use PhP Code in the format, save it, then netcat will get the shell.
![[title manually exploit [alt text]]](/images/blog/vulhub/drooy2/Selection_015.png)
Then use same method in the first part of this post to get the root.
DONE