Skip to content

Commit

Permalink
update 1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
F6JO committed Apr 10, 2024
1 parent c2abca3 commit 6bc4990
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 48 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,10 @@ scan面板用来展示请求的内容以及扫描的内容,此面板不会自

## 提示

​ Recursion-Scan功能一定要注意PATH中的路由数量,没用的删一删再扫,递归扫描的请求数量是根据目录层级而指数级增长的哦
​ Recursion-Scan功能一定要注意PATH中的路由数量,没用的删一删再扫,递归扫描的请求数量是 目录层级*路由数量 的哦
## 更新计划
* 2024-04-10 自定义head头 √
* 自定义head头 2024-04-10 √
* 添加自定义post或get参数
* 配置文件在线更新?

## 开心值
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/burp/BurpExtender.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class BurpExtender implements IBurpExtender {
public static String EXPAND_NAME = "JsRouteScan";
public static String AUTHOR = "F6JO";
public static String LINK = "https://github.com/F6JO/JsRouteScan";
public static String VERSION = "1.0";
public static String VERSION = "1.1";
public static String CONFIGPATH = System.getProperty("user.home") + "/.config/JsRouteScan/config.yaml";
public LaunchRequest launchRequest;

Expand All @@ -29,6 +29,7 @@ private void printBanner(){
this.call.printOutput("@Version: " + EXPAND_NAME + " v" + VERSION);
this.call.printOutput("@From: Code by " + AUTHOR);
this.call.printOutput("@Github: " + LINK);
this.call.printOutput("");
}
@Override
public void registerExtenderCallbacks(IBurpExtenderCallbacks iBurpExtenderCallbacks) {
Expand Down
8 changes: 2 additions & 6 deletions src/main/java/common/BurpListening.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public void processHttpMessage(int i, boolean b, IHttpRequestResponse iHttpReque
boolean contains = this.burpExtender.config.ExSuffix.stream().anyMatch(url::endsWith);
// Determine whether the blacklist suffix is not included in the request path
if (!contains) {

boolean isFirstMatch = true;
for (String regex : this.burpExtender.config.REGEXS) {
Pattern p = Pattern.compile(regex, Pattern.DOTALL);
Expand All @@ -40,6 +41,7 @@ public void processHttpMessage(int i, boolean b, IHttpRequestResponse iHttpReque
int findStart = 0;
while (m.find(findStart)) {
if (isFirstMatch) {
this.burpExtender.call.printOutput("Route found in: " + url);
if (findhost == null) {
findhost = (HostContent) this.burpExtender.tab.reqDisplay.hosttab.add(host);
}
Expand All @@ -66,12 +68,6 @@ public void processHttpMessage(int i, boolean b, IHttpRequestResponse iHttpReque
if (burpExtender.config.PassiveScan) {
this.burpExtender.launchRequest.fuckGO(iHttpRequestResponse.getHttpService(), route, headers, findhost, this.burpExtender.config.PassiveScanPath);
}
// try {
// Thread.sleep(1000);
// } catch (InterruptedException ignored) {
//
// }


}
}
Expand Down
8 changes: 0 additions & 8 deletions src/main/java/ui/ConfigTag.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,7 @@
import ui.tab.RightConfigTab;

import javax.swing.*;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;

public class ConfigTag implements TagInterface {
private BurpExtender burp;
Expand Down
25 changes: 6 additions & 19 deletions src/main/java/ui/MainTag.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,6 @@
import javax.swing.*;
import java.awt.*;

//class MyRunnable implements Runnable {
// private MainTag myClass;
//
// public MyRunnable(MainTag myClass) {
// this.myClass = myClass;
// }
//
// @Override
// public void run() {
// while (true) {
// myClass.updateUI();
// try {
// Thread.sleep(1000);
// } catch (InterruptedException ignored) {
//
// }
// }
// }
//}
public class MainTag implements ITab {

private BurpExtender burp;
Expand Down Expand Up @@ -72,6 +53,12 @@ public void prompt(String message){
JOptionPane.showMessageDialog(this.getUiComponent(), message);
}

public Boolean promptSelect(String message){
int result = JOptionPane.showConfirmDialog(this.getUiComponent(), message, "title", JOptionPane.OK_CANCEL_OPTION);
return result == JOptionPane.OK_OPTION;

}

@Override
public String getTabCaption() {
return this.TAGNAME;
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/ui/tab/LeftConfigTab.java
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ public void stateChanged(ChangeEvent e) {
intSpinner.setValue(10);
}else {
burp.config.RequestThread = (int) value;
burp.launchRequest.updateThreadPoolSize();
new Thread(() -> burp.launchRequest.updateThreadPoolSize()).start();
// burp.launchRequest.updateThreadPoolSize();
}
}
});
Expand Down
1 change: 1 addition & 0 deletions src/main/java/ui/tab/path/RightTab.java
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ public JPanel packaging(Component... components){
public void scanButtonFunc(){
this.scanButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
burp.tab.prompt(burp.launchRequest.executor.getMaximumPoolSize() + "");
String scanRootPathText = scanRootPathField.getText();
if (scanRootPathText.equals("")){
burp.tab.prompt("Wrong scan root path!");
Expand Down
38 changes: 27 additions & 11 deletions src/main/java/utils/LaunchRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,35 @@
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.*;

public class LaunchRequest {
private BurpExtender burp;
public ThreadPoolExecutor executor;

public LaunchRequest(BurpExtender burpExtender) {
this.burp = burpExtender;
this.executor = (ThreadPoolExecutor) Executors.newFixedThreadPool(this.burp.config.RequestThread);;
BlockingQueue<Runnable> workQueue = new LinkedBlockingQueue<>();
this.executor = new ThreadPoolExecutor(this.burp.config.RequestThread, this.burp.config.RequestThread, 0L, TimeUnit.MILLISECONDS, workQueue);
// this.executor = (ThreadPoolExecutor) Executors.newFixedThreadPool(this.burp.config.RequestThread);;
}
public void updateThreadPoolSize() {
int newSize = this.burp.config.RequestThread;
this.executor.setMaximumPoolSize(newSize);
this.executor.setCorePoolSize(newSize);
synchronized (this.executor) {
try {
int newSize = this.burp.config.RequestThread;
if (newSize > this.executor.getMaximumPoolSize()) {
this.executor.setMaximumPoolSize(newSize);
this.executor.setCorePoolSize(newSize);
}else if (newSize < this.executor.getCorePoolSize()) {
this.executor.setCorePoolSize(newSize);
this.executor.setMaximumPoolSize(newSize);
}

}catch (Exception e) {
this.burp.call.printError("ThreadPool Size Error: " + e.getMessage());
}

}

}

Expand Down Expand Up @@ -104,11 +117,14 @@ public void recursionScan(HostContent hostContent, List<IHttpRequestResponse> iH

}
}
burp.tab.prompt(hostContent.routeContents.size() * paths.size() + " requests in total");
for (String i : paths) {
for (RouteContent routeContent : hostContent.routeContents) {
this.fuckGO(hostContent.getHttpService(), routeContent.getRoute(), hostContent.getHeaders(), hostContent, i);
Boolean aBoolean = burp.tab.promptSelect("A total of " + hostContent.routeContents.size() * paths.size() + " requests, are you sure?");
if (aBoolean){
for (String i : paths) {
for (RouteContent routeContent : hostContent.routeContents) {
this.fuckGO(hostContent.getHttpService(), routeContent.getRoute(), hostContent.getHeaders(), hostContent, i);
}
}
}

}
}

0 comments on commit 6bc4990

Please sign in to comment.