MCPcopy Create free account
hub / github.com/albinowax/ActiveScanPlusPlus / interestingFileScan

Method interestingFileScan

src/burp/PerHostScans.java:44–69  ·  view source on GitHub ↗
(IHttpRequestResponse basePair)

Source from the content-addressed store, hash-verified

42 };
43
44 private List<IScanIssue> interestingFileScan(IHttpRequestResponse basePair) {
45 List<IScanIssue> issues = new ArrayList<>();
46 for (Object[] mapping : interestingFileMappings) {
47 String url = (String) mapping[0];
48 String expect = (String) mapping[1];
49 String reason = (String) mapping[2];
50
51 IHttpRequestResponse attack = fetchURL(basePair, url);
52 if (safeBytesToString(attack.getResponse()).contains(expect)) {
53 // prevent false positives by tweaking the URL and confirming the expected string goes away
54 IHttpRequestResponse baseline = fetchURL(basePair, url.substring(0, url.length() - 1));
55 if (!safeBytesToString(baseline.getResponse()).contains(expect)) {
56 issues.add(new CustomScanIssue(
57 basePair.getHttpService(),
58 Utilities.helpers.analyzeRequest(attack).getUrl(),
59 new IHttpRequestResponse[]{attack, baseline},
60 "Interesting response",
61 "The response to <b>" + htmlEncode(url) + "</b> contains <b>'" + htmlEncode(expect) + "'</b><br/><br/>This may be interesting. Here's a clue why: <b>" + htmlEncode(reason) + "</b>",
62 "Firm",
63 CustomScanIssue.severity.Information
64 ));
65 }
66 }
67 }
68 return issues;
69 }
70
71 private IHttpRequestResponse fetchURL(IHttpRequestResponse basePair, String url) {
72 String path = Utilities.helpers.analyzeRequest(basePair).getUrl().getPath();

Callers 1

doActiveScanMethod · 0.95

Calls 5

fetchURLMethod · 0.95
safeBytesToStringMethod · 0.95
htmlEncodeMethod · 0.95
getHttpServiceMethod · 0.80
getUrlMethod · 0.80

Tested by

no test coverage detected