You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -138,7 +138,7 @@ var checksumRegex *regexp.Regexp
138
138
139
139
// Command-line arguments and help
140
140
typeargumentsstruct {
141
-
Urls []string`arg:"positional,required" help:"url to scan (multiple URLs can be specified)" placeholder:"URL"`
141
+
Urls []string`arg:"positional,required" help:"url to scan (multiple URLs can be provided; a file containing URLs can be specified with an «at» prefix, for example: @urls.txt)" placeholder:"URL"`
142
142
Wordliststring`arg:"-w" help:"combined wordlist + rainbow table generated with shortutil" placeholder:"FILE"`
143
143
Headers []string`arg:"--header,-H,separate" help:"header to send with each request (use multiple times for multiple headers)"`
144
144
Concurrencyint`arg:"-c" help:"number of requests to make at once" default:"20"`
@@ -1047,6 +1047,41 @@ func Run() {
1047
1047
p.Fail("output must be one of: human, json")
1048
1048
}
1049
1049
1050
+
// Build the list of URLs to scan
1051
+
varurls []string
1052
+
for_, url:=rangeargs.Urls {
1053
+
1054
+
// If this is a filename rather than a URL
1055
+
ifstrings.HasPrefix(url, "@") {
1056
+
1057
+
// Open the file
1058
+
path:=strings.TrimPrefix(url, "@")
1059
+
fh, err:=os.Open(path)
1060
+
iferr!=nil {
1061
+
log.WithFields(log.Fields{"path": path, "err": err}).Fatal("Unable to open URL list file")
1062
+
}
1063
+
deferfh.Close()
1064
+
1065
+
// Add each line to the URL list
1066
+
sc:=bufio.NewScanner(fh)
1067
+
forsc.Scan() {
1068
+
urls=append(urls, sc.Text())
1069
+
}
1070
+
1071
+
// Check for file read errors
1072
+
iferr:=sc.Err(); err!=nil {
1073
+
log.WithFields(log.Fields{"path": path, "err": err}).Fatal("Error reading URL list file")
0 commit comments