Skip to content

Commit

Permalink
Update FindUrlAndRequest.java
Browse files Browse the repository at this point in the history
  • Loading branch information
bit4woo committed May 7, 2024
1 parent e032ae5 commit 42e06c0
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/knife/FindUrlAndRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import java.util.concurrent.BlockingQueue;
Expand All @@ -19,6 +20,7 @@
import org.apache.commons.lang3.StringUtils;

import com.bit4woo.utilbox.burp.HelperPlus;
import com.bit4woo.utilbox.utils.SwingUtils;
import com.bit4woo.utilbox.utils.TextUtils;
import com.bit4woo.utilbox.utils.UrlUtils;

Expand Down Expand Up @@ -106,9 +108,6 @@ public void run() {
urls = choseURLPath(urls);

for (String url : urls) {
if (UrlUtils.uselessExtension(url)) {
continue;
}
if (!url.startsWith("http://") && !url.startsWith("https://")) {
if (url.startsWith("/")) {
url = url.replaceFirst("/", "");
Expand Down Expand Up @@ -172,9 +171,16 @@ public void findUrls(IHttpRequestResponse message) {
byte[] respBody = HelperPlus.getBody(false, item);
String body = new String(respBody);
urls.addAll(UrlUtils.grepUrlsWithProtocol(body));
urls.addAll(UrlUtils.grepUrlPathNotStartWithSlash(body));
urls.addAll(UrlUtils.grepUrlPathNotStartWithSlashInQuotes(body));
urls.addAll(UrlUtils.grepUrlsInQuotes(body));
urls = TextUtils.deduplicate(urls);
Iterator<String> it = urls.iterator();
while (it.hasNext()) {
String urlItem = it.next();
if (UrlUtils.uselessExtension(urlItem)) {
it.remove();;
}
}
baseUrls.addAll(findPossibleBaseURL(urls));
}
}
Expand Down

0 comments on commit 42e06c0

Please sign in to comment.