PRAYING of VulnHub Shooting Range: 1

PRAYING of VulnHub Shooting Range: 1

Nmap scans survival and port:
Insert picture description here
visit port 80, find apache default page, scan directory:
Insert picture description here
visit, find mantis login page, find related vulnerabilities:
Insert picture description here
directly use the script to attack, download the script, modify the parameters (change the network connection on the way, So the IP is different from the above):
Insert picture description here
Run to get the shell:
Insert picture description here
Insert picture description here
view user:
Insert picture description here
no permission to enter the user directory, search for configuration files:
Insert picture description here
a user projman:
Insert picture description here
sudo -l view permission:
Insert picture description here
you can see the cp command, try to use the cp command to raise the privilege:

cat /etc/passwd >passwd
openssl passwd -1 -salt hack hack123
$1$hack$WTn0dk2QjNeKfl.DHOUue0
echo 'hack:$1$hack$WTn0dk2QjNeKfl.DHOUue0:0:0::/root/:/bin/bash' >> passwd
cp passwd /etc/passwd
su - hack

Unsuccessful use, search for suid file, found no cp,,,,
change the way,,, found that there is a .part1 file in the user directory:
Insert picture description here
get a string, suspected to be a user's password:
Insert picture description here
try to log in, and find that it is the user elevate Password, switch user:
Insert picture description here
sudo -l View authority:
Insert picture description here
Use the dd command to raise the authority and clear the root password:

sudo dd if=/etc/passwd of=passwd

Then modify the passwd file:
Insert picture description here
After: sudo dd if=1.txt of=/etc/passwd
Insert picture description here
get root privileges:
Insert picture description here

Guess you like

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