当前位置:网站首页>Vulnhub | dc: 4 | [actual combat]

Vulnhub | dc: 4 | [actual combat]

2022-06-23 08:10:00 sayo.

Write it at the front

Range link :
https://www.vulnhub.com/entry/dc-4,313/

Some knowledge points are DC:1 I mentioned , You can flip through

DC:1

information gathering

Routine survival scan
 Insert picture description here
here 115 For the attacker ,141 For physical machines ,61 Gateway . Drone aircraft ip by :192.168..201.204

General port scanning , One 80, One 22
 Insert picture description here
Get into 80 port , The tip is admin Information system login
 Insert picture description here
Try weak password ,sql Inject . Entering a regular probe statement does not respond , Redirect directly back to the login window , This point should not be sql Inject

Due to site title , Guess the username should be admin, Blasting
 Insert picture description here
Set the bursting point , Set up the dictionary , Start
 Insert picture description here
There are a lot of explosions , The setting of this blasting point is relatively simple ,happyman,hast,heaven Anything
 Insert picture description here
Backstage , It's a place to carry out orders , It is easiest to think of command injection .
 Insert picture description here
Grab the bag , Sure enough, you can command injection
 Insert picture description here
Test other commands
 Insert picture description here
lookup /etc/passwd There are three other users , Namely charles,jim,sam
 Insert picture description here
A small problem : I don't know why we can't rebound directly shell come out , Check that the echo is correct , Ask for an answer
 Insert picture description here
Query the... Of three users home Catalog , Check for sensitive files , breakthrough . see charles, It seems that there is nothing special
 Insert picture description here
sam It doesn't look special
 Insert picture description here
jim There is a backups Folder , There are also some scripts and files , obviously backups For backup , Let's have a look at
 Insert picture description here
Here is the basic command injection , Because of the above ls -al You can see backups It's a folder , So first cd go in . Check out a old-passwords.txt, It seems to be the breakthrough point ,cat Come out and see
 Insert picture description here
After opening, it looks like a codebook , Save it , We logged in backstage ? So where else can the codebook be used ? There is also a scan ahead 22 port , It seems that this is the breakthrough
 Insert picture description here
Save the user name in a text , Prepare for blasting
 Insert picture description here
Also save the password
 Insert picture description here
Use hydra Blast ssh, This tool is very classic , Support many online protocol cracking

Wait a moment , Blasting results appear
 Insert picture description here
Log in with the blasting results

jim jibril04

ssh [email protected] 

 Insert picture description here
Check other files under this account , There is one mbox file , Open it and see. , It's an email , By root Test email sent by the user
 Insert picture description here
Speaking of mail , I want to mention linux Mail system in

/var The directory mainly stores some frequently changing files , Such as cache files 、 Log files 、 Files generated when the program is running

  • /var/cache: Some caches generated during the operation of the application
    /var/lib: Store some data files used in the execution of the program 、 Under this directory, each software has its own directory
    /var/lock: Some resources or devices can only be used or accessed by one program at the same time , So when a program is used , Lock the resource (lock), To prevent it from being used by other programs , This directory places this relevant information
    /var/log: The directory where various log files are stored in the system
    /var/mail: Directory where personal email is placed
    /var/spool: This directory usually holds some queue data , It is usually deleted after use
  • /var/spool/mail/: Place incoming new mail ( and /var/mail For linked files )
    /var/spool/mqueue/: Put messages that have not been sent yet
    /var/spool/cron: Place scheduled task data crontab

Maybe this is a hint ,Linux Where e-mail is stored in the , Is in /var/mail Next . View the following message , yes charles It's from
 Insert picture description here
It says his password is this

^xHhA&hvim0y

Continue to follow up charles
 Insert picture description here
lookup suid file , Try to claim rights ( In the front jim Try to withdraw rights under the account , lookup suid file , But I didn't find anything useful )

 Insert picture description here
see sudo list, There is one teehee Things that are
 Insert picture description here
View the command help , This command can write files
 Insert picture description here
Try to /etc/passwd No password is written in the file admin Account

echo "admin::0:0:::/bin/bash" | sudo teehee -a /etc/passwd

Execute the above command , Check it out. passwd file , It has been written successfully
 Insert picture description here
Sign in admin
 Insert picture description here
find flag file
 Insert picture description here

原网站

版权声明
本文为[sayo.]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/174/202206230741030537.html