当前位置:网站首页>Vulnhub target os-hacknos-1

Vulnhub target os-hacknos-1

2022-06-23 13:48:00 Bright moon and clear wind~~

Os-hackNos-1:

Target download https://www.vulnhub.com/entry/hacknos-os-hacknos,401

The environment is as follows :

KALI: 192.168.59.141/24
Drone aircraft :192.168.59.146/24

Target acquisition 2 individual flag

Set up the environment :

PS:(Vulnhub The target cannot detect IP
After revising ip Restart ok 了 )
 Insert picture description here The environment was built successfully !
 Insert picture description here

information gathering :

Scan directory

 ./gobuster dir -u http://192.168.59.146/ -w /usr/share/wordlists/dirbuster/directory-list-2.3-small.txt 

 Insert picture description here
The discovery service :
 Insert picture description here use kali Medium whatweb Let's detect Drupal Version of , See if there are corresponding vulnerabilities , Found to be Drupal7
 Insert picture description here stay GitHub Find out whether there are loopholes in the framework and exp, Or make use of msf Search for , I use this msf To search for , Then through online search Drupal Framework of the CVE-2018-7600 You can use , Choose here 1

 Insert picture description here
 Insert picture description here
 Insert picture description here
Set path and destination , And run (run)
 Insert picture description here
After a successful attack , No interactive shell, Need to be upgraded to interactive shell
python3 -c “import pty;pty.spawn(’/bin/bash’)”, Here you get the website permission
 Insert picture description here
Return to parent directory , Query to base64 The ciphertext of
 Insert picture description here

 Insert picture description here Look not to understand , Direct Baidu
 Insert picture description here Decrypt :james:[email protected]
 decode

Then try to use su Account password login , Found unable to log in
 Insert picture description here

Then try ssh Sign in , Still can't log in
 Insert picture description here
We can try suid Raise the right ( SUID (Set owner User ID up on execution) Is a special type of file permission given to files . stay Linux/Unix in , When a program is running , The program will inherit permissions from the logged in user .SUID Is defined as giving a user temporary ( Program / file ) The owner's permission to run a program / file . The user is executing the program / file / When ordered , The file owner's permissions and the owner's permissions will be obtained UID and GID.), And then it turns out that there's one wget, This can be used to download files
 Insert picture description here
Then another idea is to put /etc/passwd Download the file , Then add one with root Privileged user , Pass it back and cover it . Here we create a user
 Insert picture description here

openssl passwd -1 -salt myqf 123456
$1$myqf$wD2.LTxOJb7fsYoC1agE6/
└─# python2 -m SimpleHTTPServer 80

copy /etc/passwd Replace root Password and user name

myqf:$1$myqf$wD2.LTxOJb7fsYoC1agE6:0:0:root:/root:/bin/bash

 Insert picture description here

 Insert picture description here
Successfully wrote :
 Insert picture description here Successful claim :
 Insert picture description here
see root.txt
 Insert picture description here

Check it out. ssh, Find out ssh The protection is very good , Just enhance the directory .

 Insert picture description here
Reference resources :https://blog.csdn.net/Long_gone/article/details/104073135

原网站

版权声明
本文为[Bright moon and clear wind~~]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/174/202206231308353097.html