插件分析|Yaklang SQL Injection 检测启发式算法

插件分析|Yaklang SQL Injection 检测启发式算法


背景


sqlmap作为一个老牌的成熟的SQL漏洞扫描工具,在SQL注入自动化检测领域独占一壁江山。而现在的SQL注入检测往往是通过被动扫描检出,再通过sqlmap或者手工注入的方式进行进一步的漏洞确认和利用。在这种情形下,我们就需要开发一款应用于被动扫描场景下的SQL注入检测工具。而Yakit作为一个综合渗透测试平台,提供了用户友好型的API接口,可以很方便的实现SQL漏洞检测功能,和SQL注入启发式检测所需的核心功能。


sqlmap中一些概念的介绍


在sqlmap中有一个很重要的概念就是页面相似度,这个页面相似度基于python中自带的difflib模块


sqlmap 主要使用其 SequenceMatcher 这个类。以下是关于这个类的简单介绍:

This is a flexible class for comparing pairs of sequences of any type, so long as the sequence elements are hashable. The basic algorithm predates, and is a little fancier than, an algorithm published in the late 1980’s by Ratcliff and Obershelp under the hyperbolic name “gestalt pattern matching.” The idea is to find the longest contiguous matching subsequence that contains no “junk” elements (the Ratcliff and Obershelp algorithm doesn’t address junk). The same idea is then applied recursively to the pieces of the sequences to the left and to the right of the matching subsequence. This does not yield minimal edit sequences, but does tend to yield matches that “look right” to people.


简单来说这个类使用了 Ratcliff 和 Obershelp 提供的算法,匹配最长相同的字符串,设定无关字符(junk)。在实际使用中,他们应用最多的方法应该就是 ratio()

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值