用于自动创建SQL注入攻击的SQL注入漏洞扫描工具外文翻译资料

 2023-06-26 10:05:52

SQL-injection vulnerability scanning tool for automatic creation of SQL-injection attacks

Abstract

Securing the web against frequent cyber attacks is a big concern as attackers usually intend to snitch private information, financial information, deface and damages websites to prove their hacking capabilities. This type of vandalism may drive many corporations that conduct their business through the web to suffer financial and reputation damages. One of the most dangerous cyber attacks is the Structured Query Language (SQL)-injection attack, whereby this type of attack can be launched through the web browsers. The vulnerability of SQL-injection attack can be attributed to inappropriate programming practice by the website developers, which leaves a lot of doors widely open for the attackers to exploit these and gaining access to confidential information that resides in the website server databases. In order to address this vulnerability, it must be feasible to detect the vulnerability and enhance the coding structure of the website to avoid being an easy victim to this type of cyber attacks. Detecting the SQL-injection vulnerability requires the development of a powerful tool that can automatically create SQL- injection attacks using efficient features (different attacking patters) to detect the vulnerability of the websites. This paper discuss the development of a new web scanning (MySQLlInjector) tool with enhanced features that will be able to conduct efficient penetration test on PHP (started as Personal Home Page but now widely used as Hypertext Preprocesses) based websites to detect SQL injection vulnerabilities. This tool will automate the penetration test process, to make it easy even for those who are not aware familiar about hacking techniques.

Keywords Database Security; SQL Injection; SQL Vulnerability;

Background

Penetration testing or web auditing is one of the most important topics that security researchers are concerned about. It aims to prove the effectiveness of the website security system because application level attacks rank at the top of nowadays cyber attacks as these are preferred by attackers/hackers. The philosophy behind web auditing is to ensure having a single entry point to web applications by performing penetration tests represented by conducting sophisticated attacks on websites. Having more than one entry point to the system will be considered as a security flaw that attracts potential hackers to exploit it. Moreover, penetration testing covers checking against a wide range of web vulnerabilities which are related to web application level vulnerabilities such as cross-site-scripting (XSS), SQL injection, IFRAME (Inline Frame) flaws, Domain Name Server (DNS) attacks, web authentication flaws, remote code execution, and remote file inclusion [1]. Exploiting any one of these vulnerabilities may enable remote attackers to gain administrative access to the infected website which enable them having the control to deface, damage and snitch credentials [2].

Penetration testing is recommended for those critical or popular websites as it is similar to trying to break into the organizationrsquo;s IT systems. The aim of penetration testing is to demonstrate the robustness of the security system in order to expose the vulnerabilities and giving advice on how to recover these flaws [3]. Conducting penetration testing is an essential requirement for organizations that deal with critical or huge amount of data that may belong to hundreds and thousands of clients through an automated system or a website [4]. One of the most dangerous attacks that should be recovered in the penetration testing is the SQL injection attack that injects a malicious Javascript or HTML tags into the victimrsquo;s website database, or in other words executing malicious SQL queries to inject malicious HTML tags [5,6,1], which is considered as IFRAME attack. On the other hand IFRAME attack can also be carried out through what is known as cross site scripting attack (XSS) as this kind of attack can embed one malicious website in the original website to snitch credentials and to download malware on the visitorrsquo;s computer [4,2,1].

Web applications usually interact with backend databases and when the application receives a request from the user, it fetches the database by generating and executing SQL queries to interact with the relational database. These queries look for the requested data to be displayed in generated HTML pages to the user. In this normal scenario, the user inputs are treated as lexical entities. However, when the user inserts unexpected inputs that are not addressed in the web applicationrsquo;s dictionary, they will lead the web server to react abnormally. This may cause the web application to display unexpected data which may be classified as confidential and may be useful for the attacker. This is known as command injection attack, and such commands could be SQL queries or operating system commands or Javascript amp; HTML tags. Command injection attack is wide spread and more commands injection vulnerabilities will be discovered in the future [7,5,8]

SQL Injection Vulnerability Problems

SQL injection vulnerability results from the fact that most web application developers do not apply user input validation and they are not aware about the consequences of such practices [6]. This inappropriate programming practices enable the attackers to trick the system by executing malicious SQL commands to manipulate the backend database [6, 1]. One of the most important properties of SQL injection attack is that it is easy to be launched and difficult to be avoided. These factors make this kind of attack preferred by most cyber criminals, and it is getting more attention in the recent years [1]. Furthermore, the available scanning tools have limited features in shaping efficient atta

剩余内容已隐藏,支付完成后下载完整资料


用于自动创建SQL注入攻击的SQL注入漏洞扫描工具

摘 要

保护网络免受频繁的网络攻击是一个大问题,因为攻击者通常会通过泄露私人信息、财务信息,破坏和破坏网站等行为来证明他们的黑客能力。这种破坏行为可能会使许多通过网络开展业务的公司遭受财务和声誉损失。最危险的网络攻击之一是结构化查询语言(SQL)注入攻击,这种类型的攻击可以通过web浏览器发起。SQL注入攻击的漏洞可以归因于网站开发人员的不适当编程实践,这为攻击者利用这些漏洞并获取驻留在网站服务器数据库中的机密信息提供了很大的便利。为了解决这一漏洞,必须切实可行地检测漏洞,并加强网站的编码结构,以避免容易成为这类网络攻击的受害者。检测SQL注入漏洞需要开发一种强大的工具,它可以使用高效的特性(不同的攻击模式)自动创建SQL注入攻击,以检测网站的漏洞。本文讨论了一种新的网页扫描工具(MySQL Injector)的开发,该工具具有增强数据库的功能,能够对基于PHP(开始作为个人主页,但现在广泛用于超文本预处理)的网站进行有效的渗透测试,以检测SQL注入漏洞。这个工具将自动化渗透测试过程,使它更容易测试到那些不为人知的漏洞。

关键字 数据库安全;SQL注入;SQL的脆弱性;

第一章 背景

渗透测试或网络审计是网络安全研究者关注的重要课题之一。它旨在证明网站安全系统的有效性,因为应用层攻击是当今网络攻击的首选,是攻击者或者黑客的首选。web审计背后的理念是,通过对网站进行复杂的攻击来执行渗透测试,确保web应用程序有一个单一的入口点。有多个进入系统的入口点将被认为是一个安全缺陷,会吸引潜在的黑客利用它。此外,渗透测试覆盖检查对范围广泛的web漏洞相关web应用程序级别的漏洞,如跨站脚本(XSS), SQL注入,IFRAME(内联框架)缺陷,域名服务器(DNS)攻击,web身份验证缺陷,远程代码执行,远程文件包含。利用这些漏洞中的任何一个都可能使远程攻击者获得对受感染网站的管理访问权,从而使他们能够控制涂污、破坏和泄露凭证。

渗透测试建议用于那些关键或流行的网站,因为它类似于试图侵入组织的it系统。渗透测试的目的是展示安全系统的健壮性,以便暴露漏洞,并提供如何恢复这些漏洞的建议。对于那些通过自动化系统或网站处理可能属于成百上千客户的关键或大量数据的组织来说,执行渗透测试是一项基本要求。最危险的攻击应该恢复渗透测试是SQL注入攻击,注入恶意JavaScript或HTML标记到受害者的网站数据库,或者换句话说执行恶意SQL查询注入恶意的HTML标记,这被认为是IFRAME的攻击。另一方面,IFRAME攻击也可以通过所谓的跨站脚本攻击(XSS)来进行,因为这种攻击可以在原始网站中嵌入一个恶意网站,以泄露证书,并在访问者的计算机上下载恶意软件。

Web应用程序通常与后端数据库进行交互,当应用程序收到用户的请求时,它通过生成和执行SQL查询来获取数据库,从而与关系数据库进行交互。这些查询查找要在生成的HTML页面中显示给用户的请求数据。在这个正常的场景中,用户输入被视为词汇实体。然而,当用户插入未在web应用程序字典中处理的意外输入时,它们将导致web服务器做出异常反应。这可能导致web应用程序显示意外的数据,这些数据可能被归类为机密,可能对攻击者有用。这就是所谓的命令注入攻击,这类命令可能是SQL查询、操作系统命令或JavaScript或者HTML标记。命令注入攻击广泛存在,未来还会发现更多的命令注入漏洞。

第二章 SQL注入漏洞问题

SQL注入漏洞是由于大多数web应用程序开发人员没有应用用户输入验证,他们不知道这种做法的后果。这种不适当的编程实践使攻击者能够通过执行恶意SQL命令来操纵后端数据库来欺骗系统。SQL注入攻击最重要的特性之一是容易发起而难以避免。这些因素使得这类攻击受到大多数网络罪犯的青睐,近年来越来越受到关注。此外,现有的扫描工具在塑造有效的攻击模式方面功能有限,这需要检测隐藏的SQL注入漏洞。此外,可用的扫描工具使用蛮力技术从目标网站提取数据。这些工具不会显示有关检测到的漏洞的有意义和详细的信息。对于不了解黑客技术的web开发人员来说,获取这些关键的详细信息将非常有用,从而帮助他们修复漏洞,从而消除这些漏洞。缺少具有增强功能的渗透测试扫描工具是本研究要解决的主要问题。因此,本研究的目的是开发一种增强功能的web扫描工具,利用不同类型的攻击模式、攻击向量和攻击模式来检测网站数据库的SQL注入漏洞。SQL注入漏洞的问题可以通过开发一个新的web解决扫描(MySQL Injector)工具与增强的特性,能够进行有效的渗透测试基于PHP网站探测SQL注入漏洞,让web开发人员修复这些漏洞。该工具的开发基于以下步骤:

  1. 对当前针对数据库SQL注入攻击的渗透测试工具进行文献综述,识别攻击模式、攻击向量和攻击模式的重要类型;
  2. 根据文献信息,根据不同类型的攻击模式、攻击向量和攻击模式,开发针对数据库SQL注入攻击的渗透测试风格;
  3. 开发web扫描工具(MySQL Injector),根据识别出的风格检测SQL注入漏洞;
  4. 测试并验证MySQL Injector工具在不同网站上的渗透测试。

第三章 SQL注入器工具开发方法

用于检测SQL注入漏洞的新web扫描工具(MySQLInjector)的开发是基于由Heijstek和Choudron(2008)提出的用于安全软件系统开发的Rational统一过程(RUP)。RUP方法有四个阶段,它们是初始阶段、精化阶段、构建阶段和产品化阶段。第一个阶段是初始阶段,它强调在软件生命周期的开始阶段进行业务建模和需求收集。在本研究中,第一阶段从系统开发的角度对各种SQL注入漏洞进行收集和分析,开发一种web扫描工具,检测web应用程序中的SQL注入漏洞。第一阶段的另一个步骤是需求收集,通过研究来自不同供应商的支持web开发编程语言和环境的不同web框架和平台来理解它们的结构。第二阶段是细化阶段,它将从第一阶段收集到的工具需求和SQL注入攻击模型需求转换为软件设计模型。这是通过分析收集到的需求和开发工具的初始原型来实现的。第三个阶段是构建阶段,初始原型工具被开发成基于工具需求和设计的完全可操作的工具。在此阶段,在整个开发活动中对该工具进行了测试,以确保其正确性并符合SQL注入攻击模型。第四阶段,也是最后一个阶段是过渡阶段,它强调将工具部署到托管计算机或工具设计运行的环境(即web服务器)上进行最终测试。对该工具进行了攻击不同网站的测试,以确保该工具能够暴露必须修复的SQL注入漏洞。这些网站都是经营性网站,因此测试是对数据库服务器的真实攻击。

第四章 MySQL Injector工具

MySQL Injector是一款新的扫描工具,能够对基于PHP的网站进行有效的渗透测试,以检测隐藏的SQL注入漏洞。新工具在扫描过程中涉及更多的变量和功能,广泛的攻击向量被用于暴露目标网站的漏洞。这些变量和特性是由于在构建网站时使用的各种可用框架以及在开发过程中使用的各种数据库结构。这对于进行有效的侵彻测试,特别是自动化侵彻测试过程以创新一种新的扫描工具来说是一个挑战。该工具使用的攻击模式最重要的方面是,如果编程不当,可以欺骗web服务器显示错误通知。在这个工具中总共有10种这样的攻击模式。如果一个模式不能暴露漏洞,其他模式将成功地欺骗web服务器(如果它是脆弱的)。此外,这种策略不会让人怀疑存在可能的漏洞而不暴露它。此外,注入攻击模式分为不同的级别,第一级是检查web路径是否有SQL注入漏洞,第二级是确定网站是否存在漏洞,注入攻击向量的其他类型开始进行检查MYSQL的数据库版本使用正常和编码的攻击模式基于真/假的反应和对进一步分析网站补丁和保护等保护和过滤器来防止攻击者禁止执行SQL命令,并检查这些保护是否可以被打破,并通过向网站注入第三级攻击模式来执行。

在检查web服务器是否存在保护后,MySQL Injector试图通过注入第四阶段攻击来预测数据库中受感染列的数量,攻击者可以利用这些有缺陷的列执行一些SQL查询,从数据库中提取数据并显示在网页上。这个预测过程可能需要几秒钟,因为MySQL Injector打算在使用HTML解析器技术注入模式后计算每个HTML页面源的字节大小,并开始比较结果,以找到最接近原始页面源的那个总是真实的响应。随后是,然后将有问题的列的数量添加到URL,这将返回一个真值或总是返回一个假值或一个错误通知。然后,MySQL Injector工具会根据有缺陷的列数来识别网站数据库中可能存在的漏洞,并认为这是一个严重的安全漏洞。MySQL Injector在塑造攻击向量时整合了有价值的特性,以提高欺骗web服务器的能力,并在注入攻击模式后利用web服务器的响应来暴露SQL注入漏洞。这些特性是使用true/false响应的盲SQL注入,使用true/error响应的盲SQL注入,以及使用order by的盲SQL注入,这些特性在表1中列出的扫描工具中没有使用。此外,利用HTML解析器在利用和分析web服务器响应方面的高灵敏度,在多个层次上根据三种运动特性形成的各种攻击向量和类型,肯定会暴露隐藏的SQL注入漏洞。此外,使用MySQL Injector不会被认为是web服务器上的额外负载,因为它是作为一个远程客户端工具来操作的,并且MySQL Injector的使用也不会像入侵检测系统(IDS)那样频繁地进行。IDS系统在运行时执行每一个网页请求,并将其视为服务器端代码。下表4-1展示了上述扫描工具及其特性和属性。

表4-1 SQL扫描工具

已经进行了几项研究,以方便检测和测量web漏洞,如SQL注入漏洞,并提出了用于这些目的的工具和技术,以帮助保护web免受严重威胁。其中一些工具用于检测SQL注入漏洞,如SecuBat、ARDILLA工具。另一方面,一些工具被用来实时检测SQL注入攻击,如SQL- ids、SAFELI和AMNESIA技术。

图4-1、图4-2和图4-3显示了如何手动执行SQL攻击。14提交订单会产生网站错误(见图1)。似乎该网站很容易受到SQL注入攻击,现在是时候看看受感染的网站能收集到多少数据了。提取数据库中受感染列的数量足以操纵后端数据库,并使渗透测试人员能够获得关于数据库版本、数据库名称、系统用户、表和列名称的更多信息。为了获得受感染列的数量,需要应用受攻击的顺序。按值排列的顺序将增加,直到返回一个假值,如图1所示。在这里,很容易知道有缺陷的列数是13,因为在达到值14之前它是13,并且页面是正常加载的。现在,在所有受感染列的所有语句上使用union with select将使渗透测试人员能够提取有关网站的关键信息,这将返回真值,页面将正常加载。如图2所示,使用联合语句将允许添加其他SQL语句,其中网站为变量id执行选择语句,渗透测试人员使用联合语句添加另一个选择语句。现在,为了知道可以从哪个列读取数据,在变量id的值之前添加一个“-”减号操作符。可以通过用受感染的列之一替换VERSION()或user()或database()来提取更多数据,例如服务器的用户和数据库名称。此外,还可以利用数据库版本5,使用信息模式作为数据库的默认模式,提取表名和列名,如图3所示。现在,通过使用MySQL Injector自动化渗透测试过程将节省时间和精力,并且不需要一个知识渊博的渗透测试人员。MySQL Injector用户唯一需要的是一个可疑的URL,它开始塑造攻击模式并注入它们。攻击完成后,将返回结果,如图4-4所示。

图4-1 使用14提交订单时产生错误

图4-2 暴露受感染的列

图4-3 显示表和列的结构

图4-4 使用MySQL Injector进行渗透测试来检测SQL注入漏洞

第五章 结论与未来工作

MySQL Injector是一款新的扫描工具,能够对基于PHP的网站进行有效的渗透测试,以检测web服务器数据库中隐藏的SQL漏洞。这些工具结合了攻击模式、向量和模式,使得对黑客技术一无所知的web开发人员能够在他们的web数据库服务器上进行渗透测试。该领域的未来工作包括扩展工具在基于活动服务器页面(ASP)和基于Java服务器页面(JSP)的网站上进行渗透测试的能力。

参 考 文 献

      1. Kiezun, A., Guo, P. J., Jayaraman, K., amp; Ernst, M. D. (2009). Automatic Creation of SQL Injection and Cross- Site Scripting Attacks. ICSE rsquo;09. 199-209. Vancouver, Canada.
      2. Wright, C., Freedman, B., amp; Liu, D. (2008). The IT Regulatory and Standards Compliance Handbook. Burlington, MA, USA: Syngress.
      3. Midian, P. (2003). How to ensure effective penetration test. Information Security Technical Report, 8(4), 65- 77.
      4. Basta, A., amp; Halton, W. (2008). Computer Security a

        剩余内容已隐藏,支付完成后下载完整资料


        资料编号:[603424],资料为PDF文档或Word文档,PDF文档可免费转换为Word

您需要先支付 30元 才能查看全部内容!立即支付

课题毕业论文、外文翻译、任务书、文献综述、开题报告、程序设计、图纸设计等资料可联系客服协助查找。