Security is unarguably the most serious concern for Web applications, to which SQL injection (SQLi) attack is one of the most devastating attacks. Automatically testing SQLi vulnerabilities is of ultimate importance, yet is unfortunately far from trivial to implement. This is because the existence of a huge, or potentially infinite, number of variants and semantic possibilities of SQL leading to SQLi attacks on various Web applications. In this paper, we propose a deep natural language processing based tool, dubbed DeepSQLi, to generate test cases for detecting SQLi vulnerabilities. Through adopting deep learning based neural language model and sequence of words prediction, DeepSQLi is equipped with the ability to learn the semantic knowledge embedded in SQLi attacks, allowing it to translate user inputs (or a test case) into a new test case, which is semantically related and potentially more sophisticated. Experiments are conducted to compare DeepSQLi with SQLmap, a state-of-the-art SQLi testing automation tool, on six real-world Web applications that are of different scales, characteristics and domains. Empirical results demonstrate the effectiveness and the remarkable superiority of DeepSQLi over SQLmap, such that more SQLi vulnerabilities can be identified by using a less number of test cases, whilst running much faster.
翻译:SQL 输入 (SQLi) 攻击是最具破坏性的攻击之一。 自动测试 SQLi 弱点具有最终重要性, 但不幸的是远非执行无足轻重。 这是因为SQL 的变种数量巨大或潜在无限, SQL 的变种和语义可能性导致SQLi 攻击各种网络应用程序。 在本文中,我们提出了一个以深天然语言处理为基础的工具,称为DeepSQLi, 以生成检测 SQLi 弱点的测试案例。 通过采用基于深度学习的神经语言模型和字词预测序列, DeepSQLi 具备学习SQL 攻击中嵌入的语义知识的能力,使其能够将用户投入(或测试案例)转化为一个新的测试案例,这在语义上具有关联性,而且可能更为复杂。 我们进行了实验,将DeepSQLi 和SQL 测试工具的状态测试案例进行测试。 在六个真实世界的网络应用中,SQL 特征和测试性更显著的SQrvey 区域可以展示不同程度的Sral 。