mirror of
https://github.com/chainreactors/spray.git
synced 2025-05-31 02:31:04 +00:00
Compare commits
24 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
fb63ed010c | ||
![]() |
0d700f8ea0 | ||
![]() |
c82f0564f5 | ||
![]() |
08ce95b43d | ||
![]() |
c746c26ff9 | ||
![]() |
b13903ea98 | ||
![]() |
e951b68e75 | ||
![]() |
72720a942d | ||
![]() |
7621514bd9 | ||
![]() |
2a68d0b49b | ||
![]() |
2f28b0ec3c | ||
![]() |
2e8a923bac | ||
![]() |
f6037d7a1e | ||
![]() |
bf6d1c5f0b | ||
![]() |
8bf4b374ac | ||
![]() |
3791b765ea | ||
![]() |
bb98110292 | ||
![]() |
0d4a3652ce | ||
![]() |
c4d4efe6b7 | ||
![]() |
4e28fb59b4 | ||
![]() |
be19895446 | ||
![]() |
63b39cead1 | ||
![]() |
c5bbe36289 | ||
![]() |
1eddc5fcd3 |
@ -1,5 +1,10 @@
|
|||||||
# SPRAY
|
# SPRAY
|
||||||
|
|
||||||
|
blog posts:
|
||||||
|
|
||||||
|
- https://chainreactors.github.io/wiki/blog/2024/07/24/fingers-introduce/
|
||||||
|
- https://chainreactors.github.io/wiki/blog/2024/08/25/spray-best-practices/
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
@ -11,6 +16,8 @@
|
|||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
|
**最好用最智能最可控的目录爆破工具**
|
||||||
|
|
||||||
* 超强的性能, 在本地测试极限性能的场景下, 能超过ffuf与feroxbruster的性能50%以上. 实际情况受到网络的影响, 感受没有这么明确. 但在多目标下可以感受到明显的区别.
|
* 超强的性能, 在本地测试极限性能的场景下, 能超过ffuf与feroxbruster的性能50%以上. 实际情况受到网络的影响, 感受没有这么明确. 但在多目标下可以感受到明显的区别.
|
||||||
* 基于掩码的字典生成
|
* 基于掩码的字典生成
|
||||||
* 基于规则的字典生成
|
* 基于规则的字典生成
|
||||||
@ -125,4 +132,4 @@ go build .
|
|||||||
* [fuzzuli](https://github.com/musana/fuzzuli) 提供了一个备份文件字典生成思路
|
* [fuzzuli](https://github.com/musana/fuzzuli) 提供了一个备份文件字典生成思路
|
||||||
* [fingerprinthub](https://github.com/0x727/FingerprintHub) 作为指纹库的补充
|
* [fingerprinthub](https://github.com/0x727/FingerprintHub) 作为指纹库的补充
|
||||||
* [wappalyzer](https://github.com/projectdiscovery/wappalyzergo) 作为指纹库补充
|
* [wappalyzer](https://github.com/projectdiscovery/wappalyzergo) 作为指纹库补充
|
||||||
* [dirsearch](https://github.com/maurosoria/dirsearch) 提供了默认字典
|
* [dirsearch](https://github.com/maurosoria/dirsearch) 提供了默认字典
|
||||||
|
@ -31,26 +31,18 @@ type Request struct {
|
|||||||
ClientType int
|
ClientType int
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *Request) SetHeaders(header map[string]string, RandomUA bool) {
|
func (r *Request) SetHeaders(header http.Header, RandomUA bool) {
|
||||||
if header["User-Agent"] == "" {
|
if RandomUA {
|
||||||
if RandomUA {
|
r.SetHeader("User-Agent", pkg.RandomUA())
|
||||||
header["User-Agent"] = pkg.RandomUA()
|
|
||||||
} else {
|
|
||||||
header["User-Agent"] = pkg.DefaultUserAgent
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if header["Accept"] == "" {
|
|
||||||
header["Accept"] = "*/*"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if r.StandardRequest != nil {
|
if r.StandardRequest != nil {
|
||||||
for k, v := range header {
|
r.StandardRequest.Header = header
|
||||||
r.StandardRequest.Header.Set(k, v)
|
|
||||||
}
|
|
||||||
} else if r.FastRequest != nil {
|
} else if r.FastRequest != nil {
|
||||||
for k, v := range header {
|
for k, v := range header {
|
||||||
r.FastRequest.Header.Set(k, v)
|
for _, i := range v {
|
||||||
|
r.FastRequest.Header.Set(k, i)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -99,7 +99,7 @@ type OutputOptions struct {
|
|||||||
|
|
||||||
type RequestOptions struct {
|
type RequestOptions struct {
|
||||||
Method string `short:"X" long:"method" default:"GET" description:"String, request method, e.g.: --method POST" config:"method"`
|
Method string `short:"X" long:"method" default:"GET" description:"String, request method, e.g.: --method POST" config:"method"`
|
||||||
Headers []string `long:"header" description:"Strings, custom headers, e.g.: --header 'Auth: example_auth'" config:"headers"`
|
Headers []string `short:"H" long:"header" description:"Strings, custom headers, e.g.: --header 'Auth: example_auth'" config:"headers"`
|
||||||
UserAgent string `long:"user-agent" description:"String, custom user-agent, e.g.: --user-agent Custom" config:"useragent"`
|
UserAgent string `long:"user-agent" description:"String, custom user-agent, e.g.: --user-agent Custom" config:"useragent"`
|
||||||
RandomUserAgent bool `long:"random-agent" description:"Bool, use random with default user-agent" config:"random-useragent"`
|
RandomUserAgent bool `long:"random-agent" description:"Bool, use random with default user-agent" config:"random-useragent"`
|
||||||
Cookie []string `long:"cookie" description:"Strings, custom cookie" config:"cookies"`
|
Cookie []string `long:"cookie" description:"Strings, custom cookie" config:"cookies"`
|
||||||
|
@ -394,7 +394,6 @@ func (pool *BrutePool) NoScopeInvoke(v interface{}) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
req.SetHeaders(pool.Headers, pool.RandomUserAgent)
|
req.SetHeaders(pool.Headers, pool.RandomUserAgent)
|
||||||
req.SetHeader("User-Agent", pkg.RandomUA())
|
|
||||||
resp, reqerr := pool.client.Do(req)
|
resp, reqerr := pool.client.Do(req)
|
||||||
if pool.ClientType == ihttp.FAST {
|
if pool.ClientType == ihttp.FAST {
|
||||||
defer fasthttp.ReleaseResponse(resp.FastResponse)
|
defer fasthttp.ReleaseResponse(resp.FastResponse)
|
||||||
|
@ -36,7 +36,7 @@ func NewCheckPool(ctx context.Context, config *Config) (*CheckPool, error) {
|
|||||||
processCh: make(chan *baseline.Baseline, config.Thread),
|
processCh: make(chan *baseline.Baseline, config.Thread),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
pool.Headers = map[string]string{"Connection": "close"}
|
pool.Headers.Set("Connection", "close")
|
||||||
p, _ := ants.NewPoolWithFunc(config.Thread, pool.Invoke)
|
p, _ := ants.NewPoolWithFunc(config.Thread, pool.Invoke)
|
||||||
|
|
||||||
pool.Pool = p
|
pool.Pool = p
|
||||||
|
@ -7,6 +7,7 @@ import (
|
|||||||
"github.com/chainreactors/words"
|
"github.com/chainreactors/words"
|
||||||
"github.com/chainreactors/words/rule"
|
"github.com/chainreactors/words/rule"
|
||||||
"github.com/expr-lang/expr/vm"
|
"github.com/expr-lang/expr/vm"
|
||||||
|
"net/http"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
@ -27,7 +28,7 @@ type Config struct {
|
|||||||
BreakThreshold int32
|
BreakThreshold int32
|
||||||
Method string
|
Method string
|
||||||
Mod SprayMod
|
Mod SprayMod
|
||||||
Headers map[string]string
|
Headers http.Header
|
||||||
ClientType int
|
ClientType int
|
||||||
MatchExpr *vm.Program
|
MatchExpr *vm.Program
|
||||||
FilterExpr *vm.Program
|
FilterExpr *vm.Program
|
||||||
|
@ -15,6 +15,7 @@ import (
|
|||||||
"github.com/panjf2000/ants/v2"
|
"github.com/panjf2000/ants/v2"
|
||||||
"github.com/vbauerster/mpb/v8"
|
"github.com/vbauerster/mpb/v8"
|
||||||
"github.com/vbauerster/mpb/v8/decor"
|
"github.com/vbauerster/mpb/v8/decor"
|
||||||
|
"net/http"
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
@ -67,7 +68,7 @@ func (r *Runner) PrepareConfig() *pool.Config {
|
|||||||
Thread: r.Threads,
|
Thread: r.Threads,
|
||||||
Timeout: time.Duration(r.Timeout) * time.Second,
|
Timeout: time.Duration(r.Timeout) * time.Second,
|
||||||
RateLimit: r.RateLimit,
|
RateLimit: r.RateLimit,
|
||||||
Headers: r.Headers,
|
Headers: make(http.Header),
|
||||||
Method: r.Method,
|
Method: r.Method,
|
||||||
Mod: pool.ModMap[r.Mod],
|
Mod: pool.ModMap[r.Mod],
|
||||||
OutputCh: r.outputCh,
|
OutputCh: r.outputCh,
|
||||||
@ -109,6 +110,18 @@ func (r *Runner) PrepareConfig() *pool.Config {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for k, v := range r.Headers {
|
||||||
|
config.Headers.Set(k, v)
|
||||||
|
}
|
||||||
|
|
||||||
|
if config.Headers.Get("User-Agent") == "" {
|
||||||
|
config.Headers.Set("User-Agent", pkg.DefaultUserAgent)
|
||||||
|
}
|
||||||
|
|
||||||
|
if config.Headers.Get("Accept") == "" {
|
||||||
|
config.Headers.Set("Accept", "*/*")
|
||||||
|
}
|
||||||
|
|
||||||
return config
|
return config
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user