Skip to content

Commit

Permalink
Upload 1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
F6JO committed Oct 18, 2022
1 parent b2bd66f commit 7dedff0
Show file tree
Hide file tree
Showing 9 changed files with 522 additions and 167 deletions.
88 changes: 65 additions & 23 deletions src/main/java/burp/Bfunc.java
Original file line number Diff line number Diff line change
@@ -1,40 +1,82 @@
package burp;





import yaml.YamlUtil;

import javax.swing.*;
import java.util.Hashtable;
import java.util.List;
import java.util.Map;

public class Bfunc {

public static void show_yaml(View view_class, List<View.LogEntry> log, String path){

synchronized (log) {
log.clear();
int row = log.size();
Map<String, Object> Dict_Yaml = YamlUtil.readYaml(path);
List<Map<String,Object>> rule_list = (List<Map<String, Object>>) Dict_Yaml.get("Load_List");
for (Map<String,Object> zidian : rule_list){
String id = String.valueOf(zidian.get("id"));
String name = (String) zidian.get("name");
String url = (String) zidian.get("url");
String re = (String) zidian.get("re");
String info = (String) zidian.get("info");
String state = (String) zidian.get("state");
String method = (String) zidian.get("method");
log.add(new View.LogEntry(id,name,method,url,re,info,state));
view_class.fireTableRowsInserted(row, row);
public static Map<String, View> Get_Views() {
Map<String, View> views = new Hashtable<String, View>();
Map<String, Object> jieguo = YamlUtil.readYaml(BurpExtender.Yaml_Path);
List<Map<String, Object>> rule_list = (List<Map<String, Object>>) jieguo.get("Load_List");
for (Map<String, Object> zidian : rule_list) {
String type = (String) zidian.get("type");
String id = String.valueOf(zidian.get("id"));
boolean loaded = Boolean.parseBoolean(String.valueOf(zidian.get("loaded")));
String name = (String) zidian.get("name");
String url = (String) zidian.get("url");
String re = (String) zidian.get("re");
String info = (String) zidian.get("info");
String state = (String) zidian.get("state");
String method = (String) zidian.get("method");
if (views.containsKey(type)) {
View view_one = views.get(type);
view_one.log.add(new View.LogEntry(id, type, loaded, name, method, url, re, info, state));
views.put(type, view_one);
} else {
View view_one = new View();
view_one.log.add(new View.LogEntry(id, type, loaded, name, method, url, re, info, state));
views.put(type, view_one);
}
}
return views;

}


public static void show_yaml_view(BurpExtender burp, View view,String type) {
if (view == null){
show_yaml(burp);
}else {
List<View.LogEntry> log = view.log;
synchronized (log) {
log.clear();
int row = log.size();
Map<String, Object> Dict_Yaml = YamlUtil.readYaml(BurpExtender.Yaml_Path);
List<Map<String, Object>> rule_list = (List<Map<String, Object>>) Dict_Yaml.get("Load_List");
for (Map<String, Object> zidian : rule_list) {
String type2 = String.valueOf(zidian.get("type"));
if (type2.equals(type)) {
String id = String.valueOf(zidian.get("id"));
boolean loaded = Boolean.parseBoolean(String.valueOf(zidian.get("loaded")));
String name = (String) zidian.get("name");
String url = (String) zidian.get("url");
String re = (String) zidian.get("re");
String info = (String) zidian.get("info");
String state = (String) zidian.get("state");
String method = (String) zidian.get("method");
log.add(new View.LogEntry(id, type, loaded, name, method, url, re, info, state));
view.fireTableRowsInserted(row, row);
}
}
}
burp.views = Get_Views();
}

}
public static void show_yaml (BurpExtender burp){
burp.views = Get_Views();
burp.Config_l.ruleTabbedPane.removeAll();
for (String key : burp.views.keySet()) {
burp.Config_l.ruleTabbedPane.addTab(key, burp.views.get(key).Get_View());
}
burp.Config_l.ruleTabbedPane.addTab("...", new JLabel());


}


}
}
44 changes: 18 additions & 26 deletions src/main/java/burp/BurpExtender.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ public class BurpExtender implements IBurpExtender, IScannerCheck, IContextMenuF
private UrlRepeat urlC;
public Collection<String> history_url = new LinkedList<String>();
public static String EXPAND_NAME = "Route Vulnerable Scanning";
public View view_class;
public List<View.LogEntry> log;
public Config Config_l;
public ExecutorService ThreadPool;
public boolean Carry_head = false;
Expand All @@ -40,33 +38,35 @@ public class BurpExtender implements IBurpExtender, IScannerCheck, IContextMenuF
public static String Download_Yaml_host = "raw.githubusercontent.com";
public static int Download_Yaml_port = 443;
public static String Download_Yaml_file = "/F6JO/RouteVulScan/main/Config_yaml.yaml";
// public boolean on_off = true;
public Map<String, View> views;
public JTextField Host_txtfield;




public void registerExtenderCallbacks(IBurpExtenderCallbacks callbacks) {
if (!new File(Yaml_Path).exists()) {
Map<String, Object> x = new HashMap<String, Object>();
Collection<Object> list1 = new ArrayList<Object>();
x.put("Load_List", list1);
YamlUtil.writeYaml(x, Yaml_Path);
}
this.call = callbacks;
this.help = call.getHelpers();
this.view_class = new View();
this.DomainName = new DomainNameRepeat();
this.urlC = new UrlRepeat();
this.log = this.view_class.log;
this.Config_l = new Config(view_class, log,this);
this.Config_l = new Config(this);
this.tags = new Tags(callbacks, Config_l);
if (!new File(Yaml_Path).exists()) {
Map<String,Object> x = new HashMap<String,Object>();
Collection<Object> list1 = new ArrayList<Object>();
x.put("Load_List",list1);
YamlUtil.writeYaml(x,Yaml_Path);
}
Bfunc.show_yaml(view_class, log, Yaml_Path);
this.views = Bfunc.Get_Views();
call.printOutput("@Info: Loading RouteVulScan success");
call.printOutput("@Version: RouteVulScan 1.2");
call.printOutput("@Version: RouteVulScan 1.3");
call.printOutput("@From: Code by F6JO");
call.printOutput("@Github: https://github.com/F6JO/RouteVulScan");
call.setExtensionName(EXPAND_NAME);
call.registerScannerCheck(this);
call.registerContextMenuFactory(this);


}

public List<IScanIssue> doPassiveScan(IHttpRequestResponse baseRequestResponse) {
Expand Down Expand Up @@ -98,12 +98,12 @@ public List<IScanIssue> doPassiveScan(IHttpRequestResponse baseRequestResponse)
} catch (MalformedURLException e3) {
throw new RuntimeException(e3);
}
}else {
} else {
return IssueList;
}


}else {
} else {
return IssueList;
}
}
Expand All @@ -129,8 +129,6 @@ public List<JMenuItem> createMenuItems(IContextMenuInvocation invocation) {
}




class Right_click_monitor implements ActionListener {
private IContextMenuInvocation invocation;
private BurpExtender burp;
Expand All @@ -147,28 +145,22 @@ public void actionPerformed(ActionEvent e) {
for (IHttpRequestResponse i : RequestResponses) {
try {
IHttpService Http_Service = i.getHttpService();
IRequestInfo RequestInfo = burp.help.analyzeRequest(Http_Service,i.getRequest());
IRequestInfo RequestInfo = burp.help.analyzeRequest(Http_Service, i.getRequest());
String host_url = RequestInfo.getUrl().getProtocol() + "://" + RequestInfo.getUrl().getHost();
IHttpRequestResponse[] aaaa = burp.call.getSiteMap(host_url);
for (IHttpRequestResponse xxx : aaaa){
for (IHttpRequestResponse xxx : aaaa) {
String Root_Url = Http_Service.getProtocol() + "://" + Http_Service.getHost() + ":" + String.valueOf(Http_Service.getPort());
URL url = new URL(Root_Url + burp.help.analyzeRequest(xxx).getUrl().getPath());
BurpAnalyzedRequest Root_Request = new BurpAnalyzedRequest(burp.call, xxx);
start_send send = new start_send(burp, Root_Request);
send.start();
}

// String Root_Url = Http_Service.getProtocol() + "://" + Http_Service.getHost() + ":" + String.valueOf(Http_Service.getPort());
// URL url = new URL(Root_Url + burp.help.analyzeRequest(i).getUrl().getPath());
// BurpAnalyzedRequest Root_Request = new BurpAnalyzedRequest(burp.call, i);
// start_send send = new start_send(burp, Root_Request);
// send.start();
} catch (Exception exception) {
exception.printStackTrace();
}

}
// burp.call.printOutput(String.valueOf(RequestResponses[0]));
}
}

Expand Down
Loading

0 comments on commit 7dedff0

Please sign in to comment.