HA of VulnHub Shooting Range: NARAK

HA of VulnHub Shooting Range: NARAK

First scan the surviving host ip:
Insert picture description here

Execution command: nmap -sV -p 1-65535 192.168.198.148
Insert picture description here
First check port 80, which is a web page:
Insert picture description here
Directory scan:
Insert picture description here
Found a 401 login page, use cewl to generate a dictionary:
Insert picture description here
Use hydra to blast it, hydra -L woldlist.txt -P woldlist.txt 192.168.198.148 http-get /webdav
get the account password yamdoot:Swarg:
Insert picture description here
Successfully entered:
Insert picture description here
There is no idea behind,,,emmmm , I searched webdav: It
Insert picture description here
seems that you can read and write directly to the web server? ? ? ? How to use it? ? ? ? Find a tool cadaver client program:
Insert picture description here

Upload shell.php:
Insert picture description here
monitor, access it, and get the shell:
Insert picture description here

Insert picture description here
Get interactive shell: python3 -c 'import pty;pty.spawn("/bin/bash")':
Insert picture description here
The next step is how to enhance the authority of the newer ,,, like:
Insert picture description here
after a look at the various documents found before we broke login password account, it seems no use:
Insert picture description here
and then found a hell.sh ?? Check:
Insert picture description here
brainfuck~~ Decode and get something similar to the account password chitragupt::
Insert picture description here
Check the user, three:
Insert picture description here
try to log in to ssh separately, luck is good, the first inferno goes in:
Insert picture description here
Check the file content, it is not root authority : I
Insert picture description here
was at a loss for a while, and I found write up on the back! After seeing the original use of the motd, is to modify the root password by modifying the banner displayed when ssh Online:
Insert picture description here
Go to the directory, modify the 00-header files echo "echo 'root:admin' | sudo chpasswd" >> 00-header:
Insert picture description here
Log again, su root just change the password:
Insert picture description here
mention the right Success, read the flag:
Insert picture description here

summary

I also learned a method of escalation of rights,,, but here is because the file can be written to lead to the success of the escalation of rights.
If 00-header is not writable, then,,,, but because of the shooting range, there are still gains. ! ! !

Guess you like

Origin blog.csdn.net/qq_42967398/article/details/108887914