MCPcopy Create free account
hub / github.com/chainreactors/spray / PrepareConfig

Method PrepareConfig

core/runner.go:104–175  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

102}
103
104func (r *Runner) PrepareConfig() *pool.Config {
105 // 准备HTTP请求配置
106 headers := make(http.Header)
107 for k, v := range r.Headers {
108 headers.Set(k, v)
109 }
110
111 if headers.Get("User-Agent") == "" {
112 headers.Set("User-Agent", pkg.DefaultUserAgent)
113 }
114
115 if headers.Get("Accept") == "" {
116 headers.Set("Accept", "*/*")
117 }
118
119 requestConfig := &ihttp.RequestConfig{
120 Method: r.Method,
121 Headers: headers,
122 Host: r.Host,
123 Path: r.Path,
124 Body: r.Body,
125 RandomUserAgent: r.RandomUserAgent,
126 }
127
128 config := &pool.Config{
129 Thread: r.Threads,
130 Timeout: time.Duration(r.Timeout) * time.Second,
131 RateLimit: r.RateLimit,
132 Mod: pool.ModMap[r.Mod],
133 Request: requestConfig,
134 OutputCh: r.OutputCh,
135 FuzzyCh: r.FuzzyCh,
136 Outwg: r.OutWg,
137 Fuzzy: r.Fuzzy,
138 CheckPeriod: r.CheckPeriod,
139 ErrPeriod: int32(r.ErrPeriod),
140 BreakThreshold: int32(r.BreakThreshold),
141 MatchExpr: r.MatchExpr,
142 FilterExpr: r.FilterExpr,
143 RecuExpr: r.RecursiveExpr,
144 AppendRule: r.AppendRules, // 对有效目录追加规则, 根据rule生成
145 AppendWords: r.AppendWords, // 对有效目录追加字典
146 Fns: r.Fns,
147 //IgnoreWaf: r.IgnoreWaf,
148 Crawl: r.CrawlPlugin,
149 Scope: r.Scope,
150 Active: r.Finger,
151 Bak: r.BakPlugin,
152 Fuzzuli: r.FuzzuliPlugin,
153 Common: r.CommonPlugin,
154 Poc: r.PocPlugin,
155 RetryLimit: r.RetryCount,
156 ClientType: r.ClientType,
157 Random: r.Random,
158 Index: r.Index,
159 MaxRecursionDepth: r.Depth,
160 MaxRedirect: 3,
161 MaxAppendDepth: r.AppendDepth,

Callers 2

RunWithBruteMethod · 0.95
RunWithCheckMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected