解决利用SQLInjection遇到的500出错

王朝mssql·作者佚名  2008-05-19
窄屏简体版  字體: |||超大  

在SQL Injection脚本的时候.

输入:http://ip/abc.asp?id=1 and 1=1 返回文章.

http://ip/abc.asp?id=1 and 1=2 返回500内部服务器出错!

http://ip/abc.asp?id=1 一样返回500出错.

这个当然存在Sql Injection 漏洞. 但是我们无法了解他是用的什么数据库.

看这个图:

提交 and 1=1

提交 and 1=2

提交 Nclassid=1

好了大家都看到了吗?

我们还是有办法得到他的返回结果的。

用抓包工具可以看到他出错的信息。

我这里写了一个小程序专门来查看远程服务器返回的结果。

如图:

我们看到了返回的结果了吧!

这个程用DELPHI 6.0写的代码只有也很少基本上没有用到什么技术。

代码:

unit MainUnit;

interface

uses

Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,

Dialogs, StdCtrls, Psock, NMHttp, ExtCtrls, Buttons;

type

TMainForm = class(TForm)

ServerInfo: TMemo;

UrlET: TEdit;

NMHTTP1: TNMHTTP;

Label1: TLabel;

SourCodeBT: TSpeedButton;

Label2: TLabel;

Bevel1: TBevel;

Bevel2: TBevel;

procedure SourCodeBTClick(Sender: TObject);

private

{ Private declarations }

public

{ Public declarations }

end;

var

MainForm: TMainForm;

implementation

{$R *.dfm}

procedure TMainForm.SourCodeBTClick(Sender: TObject);

begin

IF Trim(UrlET.Text) = Then Exit;

Try

nmhttp1.Get(UrlEt.text);

ServerInfo.Text := nmhttp1.Body;

Except

End;

end;

end.

程序下载地址:

www.xren.net 搜索这个名字LookServerInfo

注:程序用的时候请把IE上的URL,COPY到程序中的URL输入框中.点击我要看代码就OK了

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
 
© 2005- 王朝網路 版權所有 導航