Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
bit4woo committed May 7, 2024
1 parent c44b6b2 commit e032ae5
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
3 changes: 3 additions & 0 deletions package.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
:: mvn dependency:resolve -U 重新下载依赖包,尤其针对java_utilbox
:: mvn clean package 重新打包构建
mvn dependency:resolve -U && mvn clean package
23 changes: 22 additions & 1 deletion src/knife/FindUrlAndRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@
import javax.swing.JMenuItem;
import javax.swing.JOptionPane;

import org.apache.commons.lang3.StringUtils;

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

import base.RequestTask;
Expand Down Expand Up @@ -99,6 +102,8 @@ public void run() {
if (null == baseurl) {
return;
}

urls = choseURLPath(urls);

for (String url : urls) {
if (UrlUtils.uselessExtension(url)) {
Expand Down Expand Up @@ -166,7 +171,10 @@ public void findUrls(IHttpRequestResponse message) {
if (referUrl.toLowerCase().startsWith(siteBaseUrl.toLowerCase())) {
byte[] respBody = HelperPlus.getBody(false, item);
String body = new String(respBody);
urls.addAll(UrlUtils.grepUrls(body));
urls.addAll(UrlUtils.grepUrlsWithProtocol(body));
urls.addAll(UrlUtils.grepUrlPathNotStartWithSlash(body));
urls.addAll(UrlUtils.grepUrlsInQuotes(body));
urls = TextUtils.deduplicate(urls);
baseUrls.addAll(findPossibleBaseURL(urls));
}
}
Expand Down Expand Up @@ -266,4 +274,17 @@ public static String choseAndEditBaseURL(Set<String> inputs) {
}
return selectedValue;
}


public static List<String> choseURLPath(List<String> urls) {

Collections.sort(urls);

String text = SwingUtils.showTextAreaDialog(String.join(System.lineSeparator(), urls));
if (StringUtils.isEmpty(text)) {
return new ArrayList<String>();
}else {
return TextUtils.textToLines(text);
}
}
}

0 comments on commit e032ae5

Please sign in to comment.