private void secondPass(IExtensionHelpers helpers) { publish("Second Pass..."); publish(0); Set<Map<String, CorrelatedParam>> allStats = new HashSet<>(); allStats.add(urlParameters); allStats.add(bodyParameters); allStats.add(cookieParameters); int x = 0; for (IHttpRequestResponse message : inScopeMessagesWithResponses) { publish(100 * x / inScopeMessagesWithResponses.size()); x += 1; String responseString = helpers.bytesToString(message.getResponse()); for (Map<String, CorrelatedParam> paramMap : allStats) { for (String paramName : paramMap.keySet()) { publish("Analyzing " + paramName + "..."); for (CorrelatedParam param : paramMap.values()) { for (String value : param.getUniqueValues()) { if (responseString.contains(value)) { param.putSeenParam(value, message); } } } } } } }
private void parameterFormatAnalysis() { publish("Parameter Format Analysis..."); int total = urlParameters.size() + bodyParameters.size() + cookieParameters.size() + jsonParameters.size(); int i = 0; publish(0); for (CorrelatedParam cp : urlParameters.values()) { cp.analyzeAll(callbacks); i += 1; publish(100 * i / total); } for (CorrelatedParam cp : bodyParameters.values()) { cp.analyzeAll(callbacks); i += 1; publish(100 * i / total); } for (CorrelatedParam cp : cookieParameters.values()) { cp.analyzeAll(callbacks); i += 1; publish(100 * i / total); } for (CorrelatedParam cp : jsonParameters.values()) { cp.analyzeAll(callbacks); i += 1; publish(100 * i / total); } }