| 9 | } |
| 10 | |
| 11 | @Override |
| 12 | List<IScanIssue> doScan(byte[] baseReq, IHttpService service) { |
| 13 | baseReq = BulkUtilities.appendToQuery(baseReq, "cb="+BulkUtilities.generateCanary()); |
| 14 | |
| 15 | Resp base = request(service, BulkUtilities.appendToQuery(baseReq, "cbx=zxcv")); |
| 16 | short baseCode = base.getStatus(); |
| 17 | |
| 18 | byte[] poisonReq = BulkUtilities.replaceFirst(baseReq, "?".getBytes(), "%3f".getBytes()); |
| 19 | |
| 20 | Resp resp = request(service, poisonReq); |
| 21 | short poisonedCode = resp.getStatus(); |
| 22 | |
| 23 | if (baseCode != poisonedCode) { |
| 24 | BulkScanLauncher.getTaskEngine().candidates.incrementAndGet(); |
| 25 | |
| 26 | for (int i=0; i<5; i++) { |
| 27 | request(service, poisonReq); |
| 28 | } |
| 29 | |
| 30 | Resp victimResp = request(service, baseReq); |
| 31 | short victimCode = victimResp.getStatus(); |
| 32 | |
| 33 | if (victimCode == poisonedCode) { |
| 34 | report("Web Cache Poisoning: URL-decoded path", "The application appears to URL-decode the path before placing it in the cache key, which may enable DoS attacks and also makes other vulnerabilities more exploitable. <br>For further information on this technique, please refer to https://portswigger.net/research/web-cache-entanglement", base, resp, victimResp); |
| 35 | } |
| 36 | } |
| 37 | |
| 38 | |
| 39 | return null; |
| 40 | } |
| 41 | } |