mirror of
https://github.com/chainreactors/spray.git
synced 2025-09-15 19:50:18 +00:00
revert: not same redirect banned
This commit is contained in:
parent
9e74a17096
commit
02162cffd6
@ -315,7 +315,7 @@ func (pool *BrutePool) Invoke(v interface{}) {
|
|||||||
|
|
||||||
// 手动处理重定向
|
// 手动处理重定向
|
||||||
if bl.IsValid && unit.source != parsers.CheckSource && bl.RedirectURL != "" {
|
if bl.IsValid && unit.source != parsers.CheckSource && bl.RedirectURL != "" {
|
||||||
bl.SameDomain = pool.checkHost(bl.RedirectURL)
|
bl.SameRedirectDomain = pool.checkHost(bl.RedirectURL)
|
||||||
pool.doRedirect(bl, unit.depth)
|
pool.doRedirect(bl, unit.depth)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -586,7 +586,7 @@ func (pool *BrutePool) BaseCompare(bl *pkg.Baseline) bool {
|
|||||||
|
|
||||||
// 30x状态码的特殊处理
|
// 30x状态码的特殊处理
|
||||||
if bl.RedirectURL != "" {
|
if bl.RedirectURL != "" {
|
||||||
if bl.SameDomain && strings.HasSuffix(bl.RedirectURL, bl.Url.Path+"/") {
|
if bl.SameRedirectDomain && strings.HasSuffix(bl.RedirectURL, bl.Url.Path+"/") {
|
||||||
bl.Reason = pkg.ErrFuzzyRedirect.Error()
|
bl.Reason = pkg.ErrFuzzyRedirect.Error()
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
@ -709,9 +709,10 @@ func (pool *BrutePool) doRedirect(bl *pkg.Baseline, depth int) {
|
|||||||
if depth >= pool.MaxRedirect {
|
if depth >= pool.MaxRedirect {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if !bl.SameDomain {
|
|
||||||
return // 不同域名的重定向不处理
|
//if !bl.SameRedirectDomain {
|
||||||
}
|
// return // 不同域名的重定向不处理
|
||||||
|
//}
|
||||||
reURL := pkg.FormatURL(bl.Url.Path, bl.RedirectURL)
|
reURL := pkg.FormatURL(bl.Url.Path, bl.RedirectURL)
|
||||||
pool.wg.Add(1)
|
pool.wg.Add(1)
|
||||||
go func() {
|
go func() {
|
||||||
|
@ -125,7 +125,7 @@ type Baseline struct {
|
|||||||
URLs []string `json:"-"`
|
URLs []string `json:"-"`
|
||||||
Collected bool `json:"-"`
|
Collected bool `json:"-"`
|
||||||
Retry int `json:"-"`
|
Retry int `json:"-"`
|
||||||
SameDomain bool `json:"-"`
|
SameRedirectDomain bool `json:"-"`
|
||||||
IsBaseline bool `json:"-"`
|
IsBaseline bool `json:"-"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user