2024-11-21 06:16:20 +00:00
|
|
|
package common
|
|
|
|
|
|
|
|
import (
|
2024-12-06 20:24:56 +00:00
|
|
|
flag "github.com/spf13/pflag"
|
2024-11-21 06:16:20 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
type Params struct {
|
2024-12-06 20:24:56 +00:00
|
|
|
List string
|
|
|
|
Cidr string
|
|
|
|
Pathlist string
|
|
|
|
UserAgent string
|
|
|
|
Threads int
|
|
|
|
Tmout int
|
|
|
|
Delay int
|
|
|
|
Silent bool
|
2024-11-21 06:16:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
var (
|
2024-12-06 20:24:56 +00:00
|
|
|
list = flag.StringP("list", "l", "", "")
|
|
|
|
cidr = flag.StringP("range", "r", "", "")
|
|
|
|
pathlist = flag.StringP("pathlist", "p", "", "")
|
|
|
|
ua = flag.StringP("useragent", "u", "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)", "")
|
|
|
|
threads = flag.IntP("threads", "t", 100, "") // concurrent workers (green threads) not full threads. semantic preference.
|
|
|
|
tmout = flag.Int("timeout", 1000, "")
|
|
|
|
delay = flag.Int("delay", 200, "")
|
|
|
|
silent = flag.BoolP("silent", "s", false, "")
|
|
|
|
Conf Params
|
2024-11-21 06:16:20 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func LoadParams() {
|
|
|
|
flag.Usage = Usage
|
|
|
|
flag.Parse()
|
|
|
|
Conf = Params{
|
2024-12-06 20:24:56 +00:00
|
|
|
List: *list,
|
|
|
|
Cidr: *cidr,
|
|
|
|
Pathlist: *pathlist,
|
|
|
|
UserAgent: *ua,
|
|
|
|
Threads: *threads,
|
|
|
|
Tmout: *tmout,
|
|
|
|
Delay: *delay,
|
|
|
|
Silent: *silent,
|
2024-11-21 06:16:20 +00:00
|
|
|
}
|
|
|
|
}
|