mirror of
https://github.com/chainreactors/spray.git
synced 2025-09-15 11:40:13 +00:00
修复check-only失效的bug
This commit is contained in:
parent
680d18a573
commit
296bea96a0
@ -56,7 +56,7 @@ func NewCheckPool(ctx context.Context, config *pkg.Config) (*CheckPool, error) {
|
|||||||
bl = pkg.NewBaseline(req.URI(), req.Host(), resp)
|
bl = pkg.NewBaseline(req.URI(), req.Host(), resp)
|
||||||
bl.Collect()
|
bl.Collect()
|
||||||
}
|
}
|
||||||
|
bl.Source = unit.source
|
||||||
bl.Spended = time.Since(start).Milliseconds()
|
bl.Spended = time.Since(start).Milliseconds()
|
||||||
pool.OutputCh <- bl
|
pool.OutputCh <- bl
|
||||||
pool.reqCount++
|
pool.reqCount++
|
||||||
|
@ -32,10 +32,10 @@ type InputOptions struct {
|
|||||||
ResumeFrom string `long:"resume"`
|
ResumeFrom string `long:"resume"`
|
||||||
URL []string `short:"u" long:"url" description:"Strings, input baseurl, e.g.: http://google.com"`
|
URL []string `short:"u" long:"url" description:"Strings, input baseurl, e.g.: http://google.com"`
|
||||||
URLFile string `short:"l" long:"list" description:"File, input filename"`
|
URLFile string `short:"l" long:"list" description:"File, input filename"`
|
||||||
Raw string `long:"raw" description:"File, input raw request filename"`
|
//Raw string `long:"raw" description:"File, input raw request filename"`
|
||||||
|
Dictionaries []string `short:"d" long:"dict" description:"Files, Multi,dict files, e.g.: -d 1.txt -d 2.txt"`
|
||||||
Offset int `long:"offset" description:"Int, wordlist offset"`
|
Offset int `long:"offset" description:"Int, wordlist offset"`
|
||||||
Limit int `long:"limit" description:"Int, wordlist limit, start with offset. e.g.: --offset 1000 --limit 100"`
|
Limit int `long:"limit" description:"Int, wordlist limit, start with offset. e.g.: --offset 1000 --limit 100"`
|
||||||
Dictionaries []string `short:"d" long:"dict" description:"Files, Multi,dict files, e.g.: -d 1.txt -d 2.txt"`
|
|
||||||
Word string `short:"w" long:"word" description:"String, word generate dsl, e.g.: -w test{?ld#4}"`
|
Word string `short:"w" long:"word" description:"String, word generate dsl, e.g.: -w test{?ld#4}"`
|
||||||
Rules []string `short:"r" long:"rules" description:"Files, rule files, e.g.: -r rule1.txt -r rule2.txt"`
|
Rules []string `short:"r" long:"rules" description:"Files, rule files, e.g.: -r rule1.txt -r rule2.txt"`
|
||||||
AppendRule []string `long:"append-rule" description:"Files, when found valid path , use append rule generator new word with current path"`
|
AppendRule []string `long:"append-rule" description:"Files, when found valid path , use append rule generator new word with current path"`
|
||||||
@ -369,11 +369,13 @@ func (opt *Option) PrepareRunner() (*Runner, error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
urls := strings.Split(strings.TrimSpace(string(content)), "\n")
|
urls = strings.Split(strings.TrimSpace(string(content)), "\n")
|
||||||
for _, u := range urls {
|
for i, u := range urls {
|
||||||
tasks = append(tasks, &Task{baseUrl: strings.TrimSpace(u)})
|
urls[i] = strings.TrimSpace(u)
|
||||||
|
tasks = append(tasks, &Task{baseUrl: urls[i]})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if opt.CheckOnly {
|
if opt.CheckOnly {
|
||||||
r.URLList = urls
|
r.URLList = urls
|
||||||
r.Total = len(r.URLList)
|
r.Total = len(r.URLList)
|
||||||
|
@ -468,7 +468,7 @@ func (pool *Pool) PreCompare(resp *ihttp.Response) error {
|
|||||||
// 如果为白名单状态码则直接返回
|
// 如果为白名单状态码则直接返回
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
if pool.random != nil && pool.random.Status != 200 && pool.random.Status == status {
|
if pool.random.Status != 200 && pool.random.Status == status {
|
||||||
return ErrSameStatus
|
return ErrSameStatus
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -137,6 +137,7 @@ func (r *Runner) Prepare(ctx context.Context) error {
|
|||||||
r.poolwg.Done()
|
r.poolwg.Done()
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
|
// spray 完整探测模式
|
||||||
go func() {
|
go func() {
|
||||||
for _, t := range r.Tasks {
|
for _, t := range r.Tasks {
|
||||||
r.taskCh <- t
|
r.taskCh <- t
|
||||||
|
@ -70,6 +70,7 @@ func RemoveDuplication(arr []string) []string {
|
|||||||
return arr[:j]
|
return arr[:j]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 判断是否存在标准输入数据
|
||||||
func HasStdin() bool {
|
func HasStdin() bool {
|
||||||
stat, err := os.Stdin.Stat()
|
stat, err := os.Stdin.Stat()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user