Skip to content

Commit

Permalink
Merge pull request #40 from pajswigger/master
Browse files Browse the repository at this point in the history
Make URL checks ignore default port specifications
  • Loading branch information
gangelino committed May 10, 2018
2 parents 0fca0b5 + 48819f3 commit dea95f6
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -182,11 +182,14 @@ public boolean scan(String baseUrl)
for (IHttpRequestResponse iHttpRequestResponse : siteMapInScope) {
URL url = BurpExtender.getInstance().getHelpers().analyzeRequest(iHttpRequestResponse)
.getUrl();
if(url.getPort() == url.getDefaultPort()) {
url = new URL(url.getProtocol(), url.getHost(), url.getFile());
}
if (url.toExternalForm().startsWith(baseUrl)) {
boolean useHttps = url.getProtocol().equalsIgnoreCase("HTTPS");
log.debug("Submitting Active Scan for the URL {}", url.toExternalForm());
IScanQueueItem iScanQueueItem = BurpExtender.getInstance().getCallbacks()
.doActiveScan(url.getHost(), url.getPort(), useHttps,
.doActiveScan(url.getHost(), url.getPort() != -1 ? url.getPort() : url.getDefaultPort(), useHttps,
iHttpRequestResponse.getRequest());
scans.addItem(url.toExternalForm(), iScanQueueItem);
}
Expand Down

0 comments on commit dea95f6

Please sign in to comment.