-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
47 lines (40 loc) · 804 Bytes
/
Copy pathmain.go
File metadata and controls
47 lines (40 loc) · 804 Bytes
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
package main
import (
"bufio"
"flag"
"fmt"
"os"
"sync"
)
var wg sync.WaitGroup
var URL = flag.String("url", "", "输入url")
var Urlfile = flag.String("urlfile", "", "输入url的文件名")
func main() {
sign.Banner()
if *URL != "" {
Run.Run(*URL)
}
if *Urlfile != "" {
file, err := os.Open(*Urlfile)
if err != nil {
fmt.Println(err)
return
}
defer file.Close()
scanner := bufio.NewScanner(file)
scanner.Split(bufio.ScanLines)
var lines []string
for scanner.Scan() {
lines = append(lines, scanner.Text())
}
wg.Add(3)
for _, line := range lines {
go Run.Run(line)
}
}
if *URL == "" && *Urlfile == "" {
fmt.Println("请使用-url 或 -urlfile 来指定目标")
os.Exit(0)
}
fmt.Println("Done")
}