Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
bit4woo committed Jul 13, 2024
1 parent cf74a18 commit 489e4b9
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 40 deletions.
53 changes: 30 additions & 23 deletions src/base/FindUrlAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,25 +48,25 @@ public class FindUrlAction implements ActionListener {
+ "sheetjs.openxmlformats.org\r\n"
+ "www.w3.org");

public static final List<String> blackPath = TextUtils.textToLines("application/zip\r\n"
+ "application/x-www-form-urlencoded\r\n"
public static final List<String> blackPath = TextUtils.textToLines("application/json\r\n"
+ "application/octet-stream\r\n"
+ "application/pdf\r\n"
+ "application/vnd.\r\n"
+ "application/x-mso\r\n"
+ "application/x-www-form-urlencoded\r\n"
+ "application/xml\r\n"
+ "application/vnd.\r\n"
+ "application/pdf\r\n"
+ "application/octet-stream\r\n"
+ "application/json\r\n"
+ "text/css\r\n"
+ "text/html\r\n"
+ "text/plain\r\n"
+ "application/zip\r\n"
+ "image/bmp\r\n"
+ "image/gif\r\n"
+ "image/jpeg\r\n"
+ "image/pdf\r\n"
+ "image/x-wmf\r\n"
+ "image/x-emf\r\n"
+ "image/tiff\r\n"
+ "image/png\r\n"
+ "image/jpeg\r\n"
+ "image/gif\r\n"
+ "image/bmp");
+ "image/tiff\r\n"
+ "image/x-\r\n"
+ "text/css\r\n"
+ "text/html\r\n"
+ "text/javascript\r\n"
+ "text/plain");


public static Proxy CurrentProxy;
Expand All @@ -83,16 +83,23 @@ public static List<String> buildUrls(String baseurl, List<String> urlPath){
List<String> result = new ArrayList<>();

for (String url : urlPath) {
if (!url.startsWith("http://") && !url.startsWith("https://")) {
if (url.startsWith("/")) {
url = url.replaceFirst("/", "");
}
if (url.startsWith("./")) {
url = url.replaceFirst("\\./", "");
}
url = baseurl + url; //baseurl统一以“/”结尾;url统一删除“/”的开头
if (StringUtils.isBlank(baseurl)) {
continue;
}
url = url.toLowerCase();
if (url.startsWith("http://") || url.startsWith("https://")) {
result.add(url);
continue;
}

if (url.startsWith("/")) {
url = url.replaceFirst("/", "");
}
if (url.startsWith("./")) {
url = url.replaceFirst("\\./", "");
}
url = baseurl + url; //baseurl统一以“/”结尾;url统一删除“/”的开头
result.add(url);
}
return result;
}
Expand Down
30 changes: 15 additions & 15 deletions src/base/blackPath.txt
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
application/zip
application/x-www-form-urlencoded
application/json
application/octet-stream
application/pdf
application/vnd.
application/x-mso
application/x-www-form-urlencoded
application/xml
application/vnd.
application/pdf
application/octet-stream
application/json
text/css
text/html
text/plain
application/zip
image/bmp
image/gif
image/jpeg
image/pdf
image/x-wmf
image/x-emf
image/tiff
image/png
image/jpeg
image/gif
image/bmp
image/tiff
image/x-
text/css
text/html
text/javascript
text/plain
22 changes: 20 additions & 2 deletions src/messageTab/Info/InfoTable.java
Original file line number Diff line number Diff line change
Expand Up @@ -201,13 +201,31 @@ public void doRequestUrl(List<String> urlsToRequest) {
}

public void doOpenUrlInBrowser(List<String> urlsToRequest) {
String targetBaseUrl = getOrFindBaseUrl();
List<String> full_urls = FindUrlAction.buildUrls(targetBaseUrl, urlsToRequest);
List<String> full_urls;
if (needBaseUrl(urlsToRequest)) {
String targetBaseUrl = getOrFindBaseUrl();
full_urls = FindUrlAction.buildUrls(targetBaseUrl, urlsToRequest);
}else {
full_urls = urlsToRequest;
}

String browserPath = BurpExtender.getConfigTableModel().getConfigValueByKey("browserPath");
for (String url:full_urls) {
SystemUtils.browserOpen(url, browserPath);
}
}

public boolean needBaseUrl(List<String> urlsToRequest) {

for (String urlOrPath:urlsToRequest) {
if (StringUtils.isNotBlank(urlOrPath)) {
if (!urlOrPath.toLowerCase().startsWith("http://") && !urlOrPath.toLowerCase().startsWith("https://")) {
return true;
}
}
}
return false;
}

public List<String> getSelectedUrls() {
int[] rows = this.getSelectedRows();
Expand Down

0 comments on commit 489e4b9

Please sign in to comment.