-
-
Notifications
You must be signed in to change notification settings - Fork 23
/
main.go
66 lines (55 loc) · 1.26 KB
/
main.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
package main
import (
"flag"
"fmt"
"strings"
"github.com/logrusorgru/aurora/v3"
log "github.com/projectdiscovery/gologger"
"github.com/projectdiscovery/gologger/levels"
)
func init() {
flag.StringVar(&baseURL, "u", "", "Target URL/list to scan")
flag.StringVar(&method, "m", "GET", "Request method")
flag.StringVar(&proxyURL, "p", "", "Proxy URL (HTTP/SOCKSv5)")
flag.BoolVar(&silent, "s", false, "Silent mode (Only display vulnerable/suppress errors)")
flag.Parse()
if silent {
log.DefaultLogger.SetMaxLevel(levels.LevelSilent)
}
}
func main() {
if strings.HasPrefix(baseURL, "http") {
if !isURL(baseURL) {
log.Fatal().Msg("invalid URL: " + baseURL)
}
target = []string{baseURL}
} else {
list, err := readList(baseURL)
if err != nil {
log.Fatal().Msg(err.Error())
}
target = list
}
for _, URL := range target {
wg.Add(1)
go func(u string) {
defer wg.Done()
req, err := request(u, method, proxyURL)
if err != nil {
log.Error().Msg(err.Error())
}
resp, err := client.Do(req)
if err != nil {
log.Error().Msgf("%s\n", err.Error())
return
}
defer resp.Body.Close()
if isVuln(resp) {
fmt.Printf("[%s] %s\n", aurora.Green("VLN"), u)
} else {
log.Error().Msg(u)
}
}(URL)
}
wg.Wait()
}