Relevant of VulnHub Shooting Range: 1

Relevant of VulnHub Shooting Range: 1

Scan ip and port:
Insert picture description here
Insert picture description here
first look at port 80, and visit the three websites. Visit
Insert picture description here
one by one, emmm, it looks like you have to go over the wall~~, look over him! ! ! : The
first one is a video, I don’t understand:
Insert picture description here

The second one, it seems that the username and password should be kept first:
Insert picture description here

The third one is the QR code: I
Insert picture description here
scanned something similar to a web site, I don’t know what it is otpauth://totp/patsy@relevant?secret=BTVB3SSDD4SZYUV7DXFPBCIFKY&issuer=relevant:
Insert picture description here
OK, there are so many things on the main page,,, scan the directory:
Insert picture description here
visit wp-admin and see that the database connection fails, it seems to be used I
Insert picture description here
started wpscan with a WordPress plug-in , and found that it couldn't connect to the external network, so I switched to a bridge connection~ By the way, vritualbox is really not as easy to use as vmware! ! !
But it seems to say that the service is not running, but there is indeed wordpress!
Insert picture description here
Add a –force parameter and scan again:
Insert picture description here
Well, there is something, although there is no plug-in or something, but the version is out~~~ I
found a lot of information afterwards, and successfully found a loophole. You need to add a token. It just came out. Not long after the vulnerability, the command is as follows:
Insert picture description here

Insert picture description here
Visit the link to download the rec file:
Insert picture description here

Write the payload.php file, and then run:
Insert picture description here
path: ip/wp-content/plugins/wp-file-manager/lib/files/payload.php
visit, monitor and get the shell:
Insert picture description here
shell:
Insert picture description here
get the interactive shell: python3 -c 'import pty; pty.spawn("/bin/bash")'
Insert picture description here
next is the privilege escalation part again,,, sudo -l look at the command running permissions, nothing can be done :
Insert picture description here
Suid view command:, find / -perm -u=s -type f 2>/dev/nullnothing,,,
let's check the users, three users:
Insert picture description here
check the contents of the user file:, find / -user h4x0rfind a file hidden so trivially:
Insert picture description here
go in and check: it
Insert picture description here
looks like a username and password , Check /etc/passwd, it does exist:
Insert picture description here

Md5 solved it and found that it was sha1:
Insert picture description here
got the user password of new, and su, and ssh seemed to be unable to connect:
Insert picture description here
sudo -l to check:
Insert picture description here
node? What the hell , go to GTFOBins to check:
Insert picture description here

Execute the command to get root authority:
Insert picture description here
check the flag:
Insert picture description here

summary

I have gained a lot. First of all, I know how to use wpscan. You can’t give up just because you didn’t scan out. You have to look at the command manual
and learn more about the usual cve. The wider the knowledge, the more you attack. The stronger, study hard! !

Guess you like

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