Commit a44e39e
Improve reliability, output quality, and fix request-file query string bug
## Error Handling (graceful degradation)
- Replace all log.Fatalf calls with log.Printf + return so a single
technique failure no longer kills the entire scan
- Fix malformed error string log.Fatalf("{#err}") in response body close
- Rate limit (HTTP 429) now returns ErrRateLimited instead of crashing,
allowing remaining techniques to continue
- loadFlagsFromRequestFile no longer crashes on invalid/empty files
## Concurrency Safety
- Replace global _verbose and defaultCl with sync/atomic operations
(atomicVerbose, atomicDefaultCl, atomicDefaultSc, atomicCalibTolerance)
- Add thread-safe getter/setter functions for all shared state
## Request Robustness
- Add requestWithRetry() with up to 2 retries and exponential backoff
(500ms, 1s) for transient errors (timeouts, connection refused, EOF)
- Add isTransientError() to classify retryable vs permanent errors
- Check curl availability with exec.LookPath before HTTP versions technique
- Rate limiting retries with backoff instead of crashing
## Input Validation
- Add validateURI() checking scheme (http/https), host, and format
- Called at start of requester() before any requests are made
- Bounds checking on SplitAfterN in loadFlagsFromRequestFile
- Proxy parsing falls back to empty proxy instead of crashing
## Auto-Calibration (multi-sample with tolerance)
- runAutocalibrate() now sends 3 requests with different paths
- Calculates average content-length and dynamic tolerance range
- isCalibrationMatch() uses Β±max(50, 2*deviation) instead of exact match
- Reduces false positives on servers with dynamic content (CSRF tokens, etc.)
## Smart Output Filtering (non-verbose mode)
- Filter results matching default response signature (same status + similar CL)
- Per-technique dedup by status+CL group: show 3 examples + summary count
- "... and N more with STATUS/CL bytes (use -v to see all)" message
- Verbose mode (-v) remains unchanged, showing everything
## Progress Bar
- Inline progress bar on stderr for each technique (e.g. βββββββββ 48% (267/544))
- TTY detection: only renders on interactive terminals, invisible in pipes/redirects
- Coordinates with printMutex to avoid overlapping with result output
- Clears before each result print, redraws after
## UI Improvements
- Compact two-column configuration banner (8 lines vs 16)
- Dim labels + bold values, "-" for unset fields, flags on one line
- Content-length colored by divergence from default response:
green (>2x larger), cyan (1.2-2x), blue (similar), yellow (smaller), red (<50%)
## Bug Fix: --request-file query string (fixes #48)
- loadFlagsFromRequestFile no longer strips query parameters from URL
- Was: strings.Split(req.RequestURI, "?")[0] β now uses req.RequestURI directly
- URLs like /upload?action=get&user_id=123 are now processed in full
## Tests
- 17 new tests with httptest.Server covering all bypass techniques
- Tests for: verb tampering, headers, endpaths, midpaths, double-encoding,
path case switching, verb case switching, rate limiting, missing payloads,
URI validation, calibration tolerance, transient errors, auto-calibration,
request file query string preservation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent a43243f commit a44e39e
7 files changed
Lines changed: 1401 additions & 166 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | 7 | | |
9 | 8 | | |
10 | 9 | | |
| |||
17 | 16 | | |
18 | 17 | | |
19 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
20 | 22 | | |
21 | 23 | | |
22 | 24 | | |
| |||
51 | 53 | | |
52 | 54 | | |
53 | 55 | | |
54 | | - | |
55 | | - | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
56 | 119 | | |
57 | 120 | | |
58 | 121 | | |
| |||
89 | 152 | | |
90 | 153 | | |
91 | 154 | | |
92 | | - | |
93 | 155 | | |
94 | 156 | | |
95 | 157 | | |
| |||
113 | 175 | | |
114 | 176 | | |
115 | 177 | | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
120 | 181 | | |
121 | | - | |
| 182 | + | |
122 | 183 | | |
123 | 184 | | |
124 | 185 | | |
125 | 186 | | |
126 | 187 | | |
127 | 188 | | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | 189 | | |
133 | 190 | | |
134 | 191 | | |
| |||
137 | 194 | | |
138 | 195 | | |
139 | 196 | | |
140 | | - | |
| 197 | + | |
| 198 | + | |
141 | 199 | | |
142 | | - | |
| 200 | + | |
143 | 201 | | |
144 | | - | |
145 | | - | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
146 | 210 | | |
147 | 211 | | |
148 | 212 | | |
149 | 213 | | |
150 | | - | |
| 214 | + | |
| 215 | + | |
151 | 216 | | |
| 217 | + | |
152 | 218 | | |
153 | | - | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
154 | 223 | | |
155 | 224 | | |
156 | 225 | | |
157 | | - | |
158 | 226 | | |
159 | 227 | | |
160 | 228 | | |
161 | 229 | | |
162 | | - | |
| 230 | + | |
163 | 231 | | |
164 | | - | |
| 232 | + | |
165 | 233 | | |
166 | | - | |
167 | 234 | | |
168 | 235 | | |
169 | 236 | | |
170 | 237 | | |
171 | | - | |
172 | 238 | | |
173 | 239 | | |
174 | 240 | | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
179 | 251 | | |
180 | | - | |
181 | 252 | | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
186 | 274 | | |
| 275 | + | |
187 | 276 | | |
188 | | - | |
189 | | - | |
190 | | - | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
191 | 293 | | |
192 | 294 | | |
193 | | - | |
194 | | - | |
195 | | - | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
196 | 298 | | |
197 | | - | |
| 299 | + | |
198 | 300 | | |
0 commit comments