mirror of
https://github.com/chainreactors/spray.git
synced 2025-05-05 10:16:54 +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 != "" {
|
||||
bl.SameDomain = pool.checkHost(bl.RedirectURL)
|
||||
bl.SameRedirectDomain = pool.checkHost(bl.RedirectURL)
|
||||
pool.doRedirect(bl, unit.depth)
|
||||
}
|
||||
|
||||
@ -586,7 +586,7 @@ func (pool *BrutePool) BaseCompare(bl *pkg.Baseline) bool {
|
||||
|
||||
// 30x状态码的特殊处理
|
||||
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()
|
||||
return false
|
||||
}
|
||||
@ -709,9 +709,10 @@ func (pool *BrutePool) doRedirect(bl *pkg.Baseline, depth int) {
|
||||
if depth >= pool.MaxRedirect {
|
||||
return
|
||||
}
|
||||
if !bl.SameDomain {
|
||||
return // 不同域名的重定向不处理
|
||||
}
|
||||
|
||||
//if !bl.SameRedirectDomain {
|
||||
// return // 不同域名的重定向不处理
|
||||
//}
|
||||
reURL := pkg.FormatURL(bl.Url.Path, bl.RedirectURL)
|
||||
pool.wg.Add(1)
|
||||
go func() {
|
||||
|
@ -113,20 +113,20 @@ func NewInvalidBaseline(u, host string, resp *ihttp.Response, reason string) *Ba
|
||||
|
||||
type Baseline struct {
|
||||
*parsers.SprayResult
|
||||
Url *url.URL `json:"-"`
|
||||
Dir bool `json:"-"`
|
||||
Chunked bool `json:"-"`
|
||||
Body BS `json:"-"`
|
||||
Header BS `json:"-"`
|
||||
Raw BS `json:"-"`
|
||||
Response *http.Response `json:"-"`
|
||||
Recu bool `json:"-"`
|
||||
RecuDepth int `json:"-"`
|
||||
URLs []string `json:"-"`
|
||||
Collected bool `json:"-"`
|
||||
Retry int `json:"-"`
|
||||
SameDomain bool `json:"-"`
|
||||
IsBaseline bool `json:"-"`
|
||||
Url *url.URL `json:"-"`
|
||||
Dir bool `json:"-"`
|
||||
Chunked bool `json:"-"`
|
||||
Body BS `json:"-"`
|
||||
Header BS `json:"-"`
|
||||
Raw BS `json:"-"`
|
||||
Response *http.Response `json:"-"`
|
||||
Recu bool `json:"-"`
|
||||
RecuDepth int `json:"-"`
|
||||
URLs []string `json:"-"`
|
||||
Collected bool `json:"-"`
|
||||
Retry int `json:"-"`
|
||||
SameRedirectDomain bool `json:"-"`
|
||||
IsBaseline bool `json:"-"`
|
||||
}
|
||||
|
||||
func (bl *Baseline) IsDir() bool {
|
||||
|
Loading…
x
Reference in New Issue
Block a user