Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2ce57f8ee1 | ||
|
|
7b5027a528 | ||
|
|
c632782bc6 | ||
|
|
503fea6f55 | ||
|
|
db1f8b9cc9 | ||
|
|
1e22b48001 | ||
|
|
9cb5c93fd7 | ||
|
|
8f18079ea6 | ||
|
|
ad8ebefb63 |
12
README.md
12
README.md
@@ -6,7 +6,7 @@ Read Chinese simplified version ([README_zh](README_zh.md)).
|
||||
|
||||
## Introduction
|
||||
|
||||
**HaE** is used to highlight HTTP requests and extract information from HTTP response messages.
|
||||
**HaE** is used to highlight HTTP requests and extract information from HTTP `response messages` or `request messages`.
|
||||
|
||||

|
||||
|
||||
@@ -41,7 +41,7 @@ HaE supports three actions:
|
||||
3. Color upgrade algorithm: **Two regulars expression, the colors are both orange, if the request are matched these, it will be upgraded to red.**
|
||||
4. The configuration file format uses JSON format, the format is
|
||||
```
|
||||
{name: {"loaded": isLoaded,"regex": regexText, "highlight": isHighlight, "extract": isExtract, "color": colorText}}
|
||||
{name: {"loaded": isLoaded,"regex": regexText, "scope": request/response/any, "action": extract/highlight/any, "color": colorText}}
|
||||
```
|
||||
5. Built-in simple cache to reduce the stuttering phenomenon in the `multi-regular, big data scenario`.
|
||||
|
||||
@@ -79,7 +79,7 @@ The mobile phone number required to be matched cannot be a number from 0-9.
|
||||
|
||||
### Include Regular Expression List
|
||||
|
||||
Chinese ID-Number(From: https://github.com/gh0stkey/HaE/issues/3):
|
||||
Chinese ID-Number(From: https://github.com/gh0stkey/HaE/issues/3):
|
||||
|
||||
```
|
||||
[^0-9]([1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx])|([1-9]\d{5}\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{2}[0-9Xx])[^0-9]
|
||||
@@ -91,3 +91,9 @@ Email Address:
|
||||
([\w-]+(?:\.[\w-]+)*@(?:[\w](?:[\w-]*[\w])?\.)+[\w](?:[\w-]*[\w])?)
|
||||
```
|
||||
|
||||
Elasticsearch Unauthorized Access(From: https://github.com/gh0stkey/HaE/issues/7):
|
||||
|
||||
```
|
||||
("cluster_uuid"\s*:\s*"[A-Za-z0-9_-]{22}")
|
||||
```
|
||||
|
||||
|
||||
11
README_zh.md
11
README_zh.md
@@ -6,7 +6,7 @@
|
||||
|
||||

|
||||
|
||||
该插件可以通过自定义正则的方式匹配**响应报文**,可以自行决定符合该自定义正则匹配的相应请求是否需要高亮标记、信息提取。
|
||||
该插件可以通过自定义正则的方式匹配**响应报文或请求报文**,可以自行决定符合该自定义正则匹配的相应请求是否需要高亮标记、信息提取。
|
||||
|
||||
**注**: `HaE`的使用,对测试人员来说需要基本的正则表达式基础,由于`Java`正则表达式的库并没有`Python`的优雅或方便,在使用正则的,HaE要求使用者必须使用`()`将所需提取的表达式内容包含;例如你要匹配一个**Shiro应用**的响应报文,正常匹配规则为`rememberMe=delete`,如果你要提取这段内容的话就需要变成`(rememberMe=delete)`。
|
||||
|
||||
@@ -37,7 +37,7 @@ HaE支持三个动作:
|
||||
3. 颜色升级算法: 利用下标的方式进行优先级排序,当满足2个同颜色条件则以优先级顺序上升颜色。(例如: **两个正则,颜色为橘黄色,该请求两个正则都匹配到了,那么将升级为红色**)
|
||||
4. 简单的配置文件格式选用JSON格式,格式为
|
||||
```
|
||||
{name: {"loaded": isLoaded,"regex": regexText, "highlight": isHighlight, "extract": isExtract, "color": colorText}}
|
||||
{name: {"loaded": isLoaded,"regex": regexText, "scope": request/response/any, "action": extract/highlight/any, "color": colorText}}
|
||||
```
|
||||
5. 内置简单缓存,在“多正则、大数据”的场景下减少卡顿现象。
|
||||
|
||||
@@ -89,7 +89,7 @@ Github项目地址(BUG、需求、正则欢迎提交): https://github.com/gh
|
||||
|
||||
### 收录正则列表
|
||||
|
||||
身份证号码(来自: https://github.com/gh0stkey/HaE/issues/3):
|
||||
身份证号码(来自: https://github.com/gh0stkey/HaE/issues/3):
|
||||
|
||||
```
|
||||
[^0-9]([1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx])|([1-9]\d{5}\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{2}[0-9Xx])[^0-9]
|
||||
@@ -101,3 +101,8 @@ Github项目地址(BUG、需求、正则欢迎提交): https://github.com/gh
|
||||
([\w-]+(?:\.[\w-]+)*@(?:[\w](?:[\w-]*[\w])?\.)+[\w](?:[\w-]*[\w])?)
|
||||
```
|
||||
|
||||
Elasticsearch未授权访问匹配(来自: https://github.com/gh0stkey/HaE/issues/7):
|
||||
|
||||
```
|
||||
("cluster_uuid"\s*:\s*"[A-Za-z0-9_-]{22}")
|
||||
```
|
||||
|
||||
@@ -6,6 +6,7 @@ repositories {
|
||||
|
||||
dependencies {
|
||||
compile 'net.portswigger.burp.extender:burp-extender-api:1.7.13'
|
||||
compile 'net.sourceforge.jregex:jregex:1.2_01'
|
||||
compile 'org.json:json:20200518'
|
||||
}
|
||||
|
||||
|
||||
@@ -4,11 +4,20 @@ import java.awt.BorderLayout;
|
||||
import java.awt.Color;
|
||||
import java.awt.Component;
|
||||
import java.util.*;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import org.json.*;
|
||||
|
||||
import burp.action.DoAction;
|
||||
import burp.action.ExtractContent;
|
||||
import burp.action.MatchHTTP;
|
||||
import burp.color.GetColorKey;
|
||||
import burp.color.UpgradeColor;
|
||||
import burp.file.FileExists;
|
||||
import burp.file.ReadFile;
|
||||
import burp.file.RemoveContent;
|
||||
import burp.file.WriteFile;
|
||||
import burp.ui.FillTable;
|
||||
|
||||
import javax.swing.JFrame;
|
||||
import javax.swing.JOptionPane;
|
||||
import javax.swing.DefaultCellEditor;
|
||||
@@ -19,12 +28,7 @@ import javax.swing.table.DefaultTableModel;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.JButton;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.BufferedWriter;
|
||||
import java.io.File;
|
||||
import java.io.FileReader;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
import java.awt.event.ActionEvent;
|
||||
import javax.swing.JCheckBox;
|
||||
import javax.swing.JComboBox;
|
||||
@@ -38,6 +42,7 @@ import javax.swing.SwingUtilities;
|
||||
import javax.swing.JLabel;
|
||||
|
||||
import java.io.PrintWriter;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
|
||||
public class BurpExtender implements IBurpExtender, IHttpListener, IMessageEditorTabFactory, ITab {
|
||||
|
||||
@@ -46,24 +51,37 @@ public class BurpExtender implements IBurpExtender, IHttpListener, IMessageEdito
|
||||
private JTable table;
|
||||
private JTextField textField;
|
||||
private IBurpExtenderCallbacks callbacks;
|
||||
private static IExtensionHelpers helpers;
|
||||
private static String configFilePath = "config.json";
|
||||
private static String initFilePath = "init.hae";
|
||||
private static String initConfigContent = "{\"Email\":{\"loaded\":true,\"highlight\":true,\"regex\":\"([\\\\w-]+(?:\\\\.[\\\\w-]+)*@(?:[\\\\w](?:[\\\\w-]*[\\\\w])?\\\\.)+[\\\\w](?:[\\\\w-]*[\\\\w])?)\",\"extract\":true,\"color\":\"yellow\"}}";
|
||||
private static String endColor = "";
|
||||
private static String[] colorArray = new String[] {"red", "orange", "yellow", "green", "cyan", "blue", "pink", "magenta", "gray"};
|
||||
private static IMessageEditorTab HaETab;
|
||||
private static PrintWriter stdout;
|
||||
|
||||
ReadFile rf = new ReadFile();
|
||||
WriteFile wfc = new WriteFile();
|
||||
FileExists fe = new FileExists();
|
||||
RemoveContent rc = new RemoveContent();
|
||||
GetColorKey gck = new GetColorKey();
|
||||
UpgradeColor uc = new UpgradeColor();
|
||||
ExtractContent ec = new ExtractContent();
|
||||
MatchHTTP mh = new MatchHTTP();
|
||||
FillTable ft = new FillTable();
|
||||
DoAction da = new DoAction();
|
||||
|
||||
@Override
|
||||
public void registerExtenderCallbacks(final IBurpExtenderCallbacks callbacks)
|
||||
{
|
||||
this.callbacks = callbacks;
|
||||
// 设置插件名字
|
||||
callbacks.setExtensionName("HaE - Highlighter and Extractor");
|
||||
this.helpers = callbacks.getHelpers();
|
||||
// 设置插件名字和版本
|
||||
String version = "1.5";
|
||||
|
||||
callbacks.setExtensionName(String.format("HaE (%s) - Highlighter and Extractor", version));
|
||||
|
||||
// 定义输出
|
||||
stdout = new PrintWriter(callbacks.getStdout(), true);
|
||||
stdout.println("@Author: EvilChen");
|
||||
stdout.println("@Blog: cn.gh0st.cn");
|
||||
|
||||
// UI
|
||||
SwingUtilities.invokeLater(new Runnable() {
|
||||
@@ -71,20 +89,20 @@ public class BurpExtender implements IBurpExtender, IHttpListener, IMessageEdito
|
||||
public void run() {
|
||||
// 判断"config.json"文件是否具备内容,如若不具备则进行初始化
|
||||
if (configFilePath.equals("config.json")) {
|
||||
if (readFileContent(configFilePath).equals("")) {
|
||||
writeFileContent(configFilePath, initConfigContent);
|
||||
writeFileContent(initFilePath, configFilePath);
|
||||
if (rf.readFileContent(configFilePath).equals("")) {
|
||||
wfc.writeFileContent(configFilePath, Config.initConfigContent);
|
||||
wfc.writeFileContent(initFilePath, configFilePath);
|
||||
}
|
||||
}
|
||||
// 判断配置文件是否存在
|
||||
if (fileExists(configFilePath)) {
|
||||
configFilePath = readFileContent(initFilePath);
|
||||
if (fe.fileExists(configFilePath)) {
|
||||
configFilePath = rf.readFileContent(initFilePath);
|
||||
} else {
|
||||
JOptionPane.showMessageDialog(null, "Config File Not Found!", "Error", JOptionPane.ERROR_MESSAGE);
|
||||
}
|
||||
|
||||
initialize();
|
||||
fillTable();
|
||||
ft.fillTable(configFilePath, table);
|
||||
|
||||
}
|
||||
});
|
||||
@@ -123,8 +141,8 @@ public class BurpExtender implements IBurpExtender, IHttpListener, IMessageEdito
|
||||
File file = jfc.getSelectedFile();
|
||||
textField.setText(file.getAbsolutePath());
|
||||
configFilePath = textField.getText();
|
||||
writeFileContent(initFilePath, configFilePath);
|
||||
fillTable();
|
||||
wfc.writeFileContent(initFilePath, configFilePath);
|
||||
ft.fillTable(configFilePath, table);
|
||||
}
|
||||
});
|
||||
panel_3.add(btnNewButton);
|
||||
@@ -137,15 +155,15 @@ public class BurpExtender implements IBurpExtender, IHttpListener, IMessageEdito
|
||||
panel_2.add(panel_1, BorderLayout.NORTH);
|
||||
panel_1.setBorder(new TitledBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null), "Actions", TitledBorder.LEADING, TitledBorder.TOP, null, new Color(0, 0, 0)));
|
||||
|
||||
JButton btnReloadRule = new JButton("Reload Rule");
|
||||
JButton btnReloadRule = new JButton("Reload");
|
||||
btnReloadRule.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
fillTable();
|
||||
ft.fillTable(configFilePath, table);
|
||||
}
|
||||
});
|
||||
panel_1.add(btnReloadRule);
|
||||
|
||||
JButton btnNewRule = new JButton("New Rule");
|
||||
JButton btnNewRule = new JButton("New");
|
||||
btnNewRule.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent arg0) {
|
||||
DefaultTableModel dtm = (DefaultTableModel) table.getModel();
|
||||
@@ -154,14 +172,14 @@ public class BurpExtender implements IBurpExtender, IHttpListener, IMessageEdito
|
||||
rules.add("New Rule");
|
||||
rules.add("New Regex");
|
||||
rules.add("red");
|
||||
rules.add(true);
|
||||
rules.add(true);
|
||||
rules.add("response");
|
||||
rules.add("any");
|
||||
dtm.addRow(rules);
|
||||
}
|
||||
});
|
||||
panel_1.add(btnNewRule);
|
||||
|
||||
JButton btnDeleteRule = new JButton("Delete Rule");
|
||||
JButton btnDeleteRule = new JButton("Delete");
|
||||
btnDeleteRule.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
int selectRows = table.getSelectedRows().length;
|
||||
@@ -171,7 +189,7 @@ public class BurpExtender implements IBurpExtender, IHttpListener, IMessageEdito
|
||||
// 在配置文件中删除数据
|
||||
String cellValue = (String) dtm.getValueAt(selectedRowIndex, 1);
|
||||
// System.out.println(cellValue);
|
||||
removeConfig(cellValue);
|
||||
rc.removeFileContent(cellValue, configFilePath);
|
||||
// 在表格中删除数据
|
||||
dtm.removeRow(selectedRowIndex);
|
||||
|
||||
@@ -188,16 +206,16 @@ public class BurpExtender implements IBurpExtender, IHttpListener, IMessageEdito
|
||||
new Object[][] {
|
||||
},
|
||||
new String[] {
|
||||
"Loaded", "Name", "Regex", "Color", "isExtract", "isHighlight"
|
||||
"Loaded", "Name", "Regex", "Color", "Scope", "Action"
|
||||
}
|
||||
));
|
||||
scrollPane.setViewportView(table);
|
||||
|
||||
table.getColumnModel().getColumn(2).setPreferredWidth(172);
|
||||
table.getColumnModel().getColumn(3).setCellEditor(new DefaultCellEditor(new JComboBox(colorArray)));
|
||||
table.getColumnModel().getColumn(3).setCellEditor(new DefaultCellEditor(new JComboBox(Config.colorArray)));
|
||||
table.getColumnModel().getColumn(0).setCellEditor(new DefaultCellEditor(new JCheckBox()));
|
||||
table.getColumnModel().getColumn(4).setCellEditor(new DefaultCellEditor(new JCheckBox()));
|
||||
table.getColumnModel().getColumn(5).setCellEditor(new DefaultCellEditor(new JCheckBox()));
|
||||
table.getColumnModel().getColumn(4).setCellEditor(new DefaultCellEditor(new JComboBox(Config.scopeArray)));
|
||||
table.getColumnModel().getColumn(5).setCellEditor(new DefaultCellEditor(new JComboBox(Config.actionArray)));
|
||||
|
||||
JLabel lblNewLabel = new JLabel("@EvilChen Love YuChen.");
|
||||
lblNewLabel.setHorizontalAlignment(SwingConstants.CENTER);
|
||||
@@ -217,26 +235,26 @@ public class BurpExtender implements IBurpExtender, IHttpListener, IMessageEdito
|
||||
jsonObj1.put("loaded", (boolean) dtm.getValueAt(i, 0));
|
||||
jsonObj1.put("regex", (String) dtm.getValueAt(i, 2));
|
||||
jsonObj1.put("color", (String) dtm.getValueAt(i, 3));
|
||||
jsonObj1.put("extract", (boolean) dtm.getValueAt(i, 4));
|
||||
jsonObj1.put("highlight", (boolean) dtm.getValueAt(i, 5));
|
||||
jsonObj1.put("scope", (String) dtm.getValueAt(i, 4));
|
||||
jsonObj1.put("action", (String) dtm.getValueAt(i, 5));
|
||||
// 添加数据
|
||||
jsonObj.put((String) dtm.getValueAt(i, 1), jsonObj1);
|
||||
}
|
||||
|
||||
writeFileContent(configFilePath, jsonObj.toString());
|
||||
wfc.writeFileContent(configFilePath, jsonObj.toString());
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
callbacks.customizeUiComponent(panel);
|
||||
callbacks.customizeUiComponent(panel_1);
|
||||
callbacks.customizeUiComponent(panel_2);
|
||||
callbacks.customizeUiComponent(panel_3);
|
||||
callbacks.customizeUiComponent(scrollPane);
|
||||
callbacks.addSuiteTab(BurpExtender.this);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -261,34 +279,57 @@ public class BurpExtender implements IBurpExtender, IHttpListener, IMessageEdito
|
||||
@Override
|
||||
public void processHttpMessage(int toolFlag, boolean messageIsRequest, IHttpRequestResponse messageInfo) {
|
||||
// 判断是否是响应,且该代码作用域为:REPEATER、INTRUDER、PROXY(分别对应toolFlag 64、32、4)
|
||||
if (!messageIsRequest && (toolFlag == 64 || toolFlag == 32 || toolFlag == 4)) {
|
||||
byte[] content = messageInfo.getResponse();
|
||||
JSONObject jsonObj = matchRegex(content);
|
||||
if (jsonObj.length() > 0) {
|
||||
List<String> colorList = new ArrayList<String>();
|
||||
Iterator<String> k = jsonObj.keys();
|
||||
while (k.hasNext()) {
|
||||
String name = k.next();
|
||||
JSONObject jsonObj2 = new JSONObject(jsonObj.get(name).toString());
|
||||
boolean isHighlight = jsonObj2.getBoolean("highlight");
|
||||
if (isHighlight) {
|
||||
colorList.add(jsonObj2.getString("color"));
|
||||
}
|
||||
}
|
||||
if (colorList.size() != 0) {
|
||||
colorUpgrade(getColorKeys(colorList));
|
||||
String color = endColor;
|
||||
messageInfo.setHighlight(color);
|
||||
}
|
||||
if (toolFlag == 64 || toolFlag == 32 || toolFlag == 4) {
|
||||
JSONObject jsonObj = new JSONObject();
|
||||
byte[] content = messageInfo.getRequest();
|
||||
// 流量清洗
|
||||
String urlString = helpers.analyzeRequest(messageInfo.getHttpService(), content).getUrl().toString();
|
||||
urlString = urlString.indexOf("?") > 0 ? urlString.substring(0, urlString.indexOf("?")) : urlString;
|
||||
// 正则判断
|
||||
if (mh.matchSuffix(urlString)) {
|
||||
return;
|
||||
}
|
||||
if (messageIsRequest) {
|
||||
try {
|
||||
String c = new String(content, "UTF-8").intern();
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
jsonObj = ec.matchRegex(content, "request", "highlight", configFilePath);
|
||||
} else {
|
||||
content = messageInfo.getResponse();
|
||||
// 流量清洗
|
||||
List<String> mimeList = helpers.analyzeResponse(content).getHeaders();
|
||||
// 正则判断
|
||||
if (mh.matchMIME(mimeList)) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
String c = new String(content, "UTF-8").intern();
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
jsonObj = ec.matchRegex(content, "response", "highlight", configFilePath);
|
||||
}
|
||||
|
||||
List<String> colorList = da.highlightList(jsonObj);
|
||||
if (colorList.size() != 0) {
|
||||
String color = uc.getEndColor(gck.getColorKeys(colorList, Config.colorArray), Config.colorArray);;
|
||||
messageInfo.setHighlight(color);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class MarkInfoTab implements IMessageEditorTab {
|
||||
private ITextEditor markInfoText;
|
||||
private byte[] currentMessage;
|
||||
|
||||
private final IMessageEditorController controller;
|
||||
private byte[] extractRequestContent;
|
||||
private byte[] extractResponseContent;
|
||||
|
||||
public MarkInfoTab(IMessageEditorController controller, boolean editable) {
|
||||
this.controller = controller;
|
||||
markInfoText = callbacks.createTextEditor();
|
||||
markInfoText.setEditable(editable);
|
||||
}
|
||||
@@ -305,9 +346,39 @@ public class BurpExtender implements IBurpExtender, IHttpListener, IMessageEdito
|
||||
|
||||
@Override
|
||||
public boolean isEnabled(byte[] content, boolean isRequest) {
|
||||
// 先判断是否是请求,再判断是否匹配到内容
|
||||
if (!isRequest && matchRegex(content).length() != 0) {
|
||||
return true;
|
||||
try {
|
||||
// 流量清洗
|
||||
String urlString = helpers.analyzeRequest(controller.getHttpService(), controller.getRequest()).getUrl().toString();
|
||||
urlString = urlString.indexOf("?") > 0 ? urlString.substring(0, urlString.indexOf("?")) : urlString;
|
||||
// 正则判断
|
||||
if (mh.matchSuffix(urlString)) {
|
||||
return false;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if (isRequest) {
|
||||
JSONObject jsonObj = ec.matchRegex(content, "request", "extract", configFilePath);
|
||||
if (jsonObj.length() != 0) {
|
||||
String result = da.extractString(jsonObj);
|
||||
extractRequestContent = result.getBytes();
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
// 流量清洗
|
||||
List<String> mimeList = helpers.analyzeResponse(controller.getResponse()).getHeaders();
|
||||
// 正则判断
|
||||
if (mh.matchMIME(mimeList)) {
|
||||
return false;
|
||||
}
|
||||
JSONObject jsonObj = ec.matchRegex(content, "response", "extract", configFilePath);
|
||||
if (jsonObj.length() != 0) {
|
||||
String result = da.extractString(jsonObj);
|
||||
extractResponseContent = result.getBytes();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -332,228 +403,23 @@ public class BurpExtender implements IBurpExtender, IHttpListener, IMessageEdito
|
||||
*/
|
||||
@Override
|
||||
public void setMessage(byte[] content, boolean isRequest) {
|
||||
if (content.length > 0 && !isRequest) {
|
||||
String result = "";
|
||||
JSONObject jsonObj = matchRegex(content);
|
||||
if (jsonObj.length() != 0) {
|
||||
Iterator<String> k = jsonObj.keys();
|
||||
while (k.hasNext()) {
|
||||
String name = k.next();
|
||||
JSONObject jsonObj1 = new JSONObject(jsonObj.get(name).toString());
|
||||
boolean isExtract = jsonObj1.getBoolean("extract");
|
||||
if (isExtract) {
|
||||
String tmpStr = String.format("[%s]\n%s\n\n", name, jsonObj1.getString("data")).intern();
|
||||
result += tmpStr;
|
||||
}
|
||||
}
|
||||
try {
|
||||
String c = new String(content, "UTF-8").intern();
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if (content.length > 0) {
|
||||
if (isRequest) {
|
||||
markInfoText.setText(extractRequestContent);
|
||||
} else {
|
||||
markInfoText.setText(extractResponseContent);
|
||||
}
|
||||
markInfoText.setText(result.getBytes());
|
||||
}
|
||||
currentMessage = content;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private JSONObject matchRegex(byte[] content) {
|
||||
JSONObject tabContent = new JSONObject();
|
||||
// 正则匹配提取内容
|
||||
try {
|
||||
String jsonStr = readFileContent(configFilePath);
|
||||
JSONObject jsonObj = new JSONObject(jsonStr);
|
||||
Iterator<String> k = jsonObj.keys();
|
||||
// 遍历json数组
|
||||
while (k.hasNext()) {
|
||||
String contentString = new String(content, "UTF-8").intern();
|
||||
String name = k.next();
|
||||
JSONObject jsonObj1 = new JSONObject(jsonObj.get(name).toString());
|
||||
JSONObject jsonData = new JSONObject();
|
||||
String regex = jsonObj1.getString("regex");
|
||||
boolean isHighligth = jsonObj1.getBoolean("highlight");
|
||||
boolean isExtract = jsonObj1.getBoolean("extract");
|
||||
boolean isLoaded = jsonObj1.getBoolean("loaded");
|
||||
String color = jsonObj1.getString("color");
|
||||
List<String> result = new ArrayList<String>();
|
||||
if(isLoaded) {
|
||||
Pattern pattern = Pattern.compile(regex);
|
||||
Matcher matcher = pattern.matcher(contentString);
|
||||
while (matcher.find()) {
|
||||
// 添加匹配数据至list
|
||||
// 强制用户使用()包裹正则
|
||||
result.add(matcher.group(1));
|
||||
}
|
||||
// 去除重复内容
|
||||
HashSet tmpList = new HashSet(result);
|
||||
result.clear();
|
||||
result.addAll(tmpList);
|
||||
|
||||
if (!result.isEmpty()) {
|
||||
jsonData.put("highlight", isHighligth);
|
||||
jsonData.put("extract", isExtract);
|
||||
jsonData.put("color", color);
|
||||
jsonData.put("data", String.join("\n", result));
|
||||
jsonData.put("loaded", isLoaded);
|
||||
// 初始化格式
|
||||
tabContent.put(name, jsonData);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return tabContent;
|
||||
} catch (Exception e) {
|
||||
return new JSONObject();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* 颜色下标获取
|
||||
*/
|
||||
private List<Integer> getColorKeys(List<String> keys){
|
||||
List<Integer> result = new ArrayList<Integer>();
|
||||
int size = colorArray.length;
|
||||
// 根据颜色获取下标
|
||||
for (int x = 0; x < keys.size(); x++) {
|
||||
for (int v = 0; v < size; v++) {
|
||||
if (colorArray[v].equals(keys.get(x))) {
|
||||
result.add(v);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* 颜色升级递归算法
|
||||
*/
|
||||
private static String colorUpgrade(List<Integer> colorList) {
|
||||
int colorSize = colorList.size();
|
||||
colorList.sort(Comparator.comparingInt(Integer::intValue));
|
||||
int i = 0;
|
||||
List<Integer> stack = new ArrayList<Integer>();
|
||||
while (i < colorSize) {
|
||||
if (stack.isEmpty()) {
|
||||
stack.add(colorList.get(i));
|
||||
i++;
|
||||
} else {
|
||||
if (colorList.get(i) != stack.stream().reduce((first, second) -> second).orElse(99999999)) {
|
||||
stack.add(colorList.get(i));
|
||||
i++;
|
||||
} else {
|
||||
stack.set(stack.size() - 1, stack.get(stack.size() - 1) - 1);
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
// 利用HashSet删除重复元素
|
||||
HashSet tmpList = new HashSet(stack);
|
||||
if (stack.size() == tmpList.size()) {
|
||||
stack.sort(Comparator.comparingInt(Integer::intValue));
|
||||
if(stack.get(0).equals(-1)) {
|
||||
endColor = colorArray[0];
|
||||
} else {
|
||||
endColor = colorArray[stack.get(0)];
|
||||
}
|
||||
} else {
|
||||
colorUpgrade(stack);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
/*
|
||||
* 判断文件是否存在
|
||||
*/
|
||||
private Boolean fileExists(String fileName) {
|
||||
File file = new File(fileName);
|
||||
if(file.exists()){
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
/*
|
||||
* 获取文件内容
|
||||
*/
|
||||
private String readFileContent(String fileName) {
|
||||
File file = new File(fileName);
|
||||
BufferedReader reader = null;
|
||||
StringBuffer sbf = new StringBuffer();
|
||||
try {
|
||||
reader = new BufferedReader(new FileReader(file));
|
||||
String tempStr;
|
||||
while ((tempStr = reader.readLine()) != null) {
|
||||
sbf.append(tempStr);
|
||||
}
|
||||
reader.close();
|
||||
return sbf.toString();
|
||||
} catch (IOException e) {
|
||||
} finally {
|
||||
if (reader != null) {
|
||||
try {
|
||||
reader.close();
|
||||
} catch (IOException err) {
|
||||
err.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
return sbf.toString();
|
||||
}
|
||||
|
||||
/*
|
||||
* 写入文件内容
|
||||
*/
|
||||
private boolean writeFileContent(String fileName, String fileContent) {
|
||||
try {
|
||||
BufferedWriter out = new BufferedWriter(new FileWriter(fileName));
|
||||
out.write(fileContent);
|
||||
out.close();
|
||||
return true;
|
||||
} catch (IOException e) {
|
||||
stdout.println(e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* 删除单条配置内容
|
||||
*/
|
||||
private void removeConfig(String key) {
|
||||
String jsonStr = readFileContent(configFilePath);
|
||||
JSONObject jsonObj = new JSONObject(jsonStr);
|
||||
jsonObj.remove(key);
|
||||
if (writeFileContent(configFilePath, jsonObj.toString())) {
|
||||
JOptionPane.showMessageDialog(null, "Delete Successfully!", "Info", JOptionPane.INFORMATION_MESSAGE);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* 初始化表格内容
|
||||
*/
|
||||
private void fillTable() {
|
||||
DefaultTableModel dtm=(DefaultTableModel) table.getModel();
|
||||
dtm.setRowCount(0);
|
||||
String jsonStr = readFileContent(configFilePath);
|
||||
JSONObject jsonObj = new JSONObject(jsonStr);
|
||||
Iterator<String> k = jsonObj.keys();
|
||||
// 遍历json数组
|
||||
while (k.hasNext()) {
|
||||
String name = k.next();
|
||||
JSONObject jsonObj1 = new JSONObject(jsonObj.get(name).toString());
|
||||
boolean loaded = jsonObj1.getBoolean("loaded");
|
||||
String regex = jsonObj1.getString("regex");
|
||||
String color = jsonObj1.getString("color");
|
||||
boolean isExtract = jsonObj1.getBoolean("extract");
|
||||
boolean isHighlight = jsonObj1.getBoolean("highlight");
|
||||
// 填充数据
|
||||
Vector rules = new Vector();
|
||||
rules.add(loaded);
|
||||
rules.add(name);
|
||||
rules.add(regex);
|
||||
rules.add(color);
|
||||
rules.add(isExtract);
|
||||
rules.add(isHighlight);
|
||||
dtm.addRow(rules);
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
}
|
||||
|
||||
11
burp/Config.java
Normal file
11
burp/Config.java
Normal file
@@ -0,0 +1,11 @@
|
||||
package burp;
|
||||
|
||||
public class Config {
|
||||
public static String initConfigContent = "{\"Email\":{\"loaded\":true,\"scope\":\"response\",\"regex\":\"([\\\\w-]+(?:\\\\.[\\\\w-]+)*@(?:[\\\\w](?:[\\\\w-]*[\\\\w])?\\\\.)+[\\\\w](?:[\\\\w-]*[\\\\w])?)\",\"action\":\"any\",\"color\":\"yellow\"}}";
|
||||
public static String[] colorArray = new String[] {"red", "orange", "yellow", "green", "cyan", "blue", "pink", "magenta", "gray"};
|
||||
public static String[] scopeArray = new String[] {"any", "response", "request"};
|
||||
public static String[] actionArray = new String[] {"any", "extract", "highight"};
|
||||
public static String excludeSuffix = "7z|aif|aifc|aiff|au|bmp|cmx|cod|css|doc|docx|gif|gz|ico|ief|jfif|jpe|jpeg|jpg|m3u|mid|mp2|mp3|mpa|mpe|mpeg|mpg|mpp|mpv2|otf|pbm|pdf|pgm|png|pnm|ppm|ra|ram|rar|ras|rgb|rmi|snd|svg|tar|tif|tiff|ttf|wav|woff|woff2|xbm|xpm|xwd|zip";
|
||||
public static String[] excludeMIME = new String[] {"application/msword", "application/vnd.ms-project", "application/x-gzip", "application/x-tar", "application/zip", "audio/basic", "audio/mid", "audio/mpeg", "audio/x-aiff", "audio/x-mpegurl", "audio/x-pn-realaudio", "audio/x-wav", "image/bmp", "image/cis-cod", "image/gif", "image/ief", "image/jpeg", "image/png", "image/pipeg", "image/svg+xml", "image/tiff", "image/x-cmu-raster", "image/x-cmx", "image/x-icon", "image/x-portable-anymap", "image/x-portable-bitmap", "image/x-portable-graymap", "image/x-portable-pixmap", "image/x-rgb", "image/x-xbitmap", "image/x-xpixmap", "image/x-xwindowdump", "text/css", "video/mpeg", "video/mpeg", "application/font-woff"};
|
||||
public static String outputTplString = "[%s]\n%s\n\n";
|
||||
}
|
||||
34
burp/action/DoAction.java
Normal file
34
burp/action/DoAction.java
Normal file
@@ -0,0 +1,34 @@
|
||||
package burp.action;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import org.json.JSONObject;
|
||||
|
||||
import burp.Config;
|
||||
|
||||
public class DoAction {
|
||||
public String extractString(JSONObject jsonObj) {
|
||||
String result = "";
|
||||
Iterator<String> k = jsonObj.keys();
|
||||
while (k.hasNext()) {
|
||||
String name = k.next();
|
||||
JSONObject jsonObj1 = new JSONObject(jsonObj.get(name).toString());
|
||||
String tmpStr = String.format(Config.outputTplString, name, jsonObj1.getString("data")).intern();
|
||||
result += tmpStr;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public List<String> highlightList(JSONObject jsonObj) {
|
||||
List<String> colorList = new ArrayList<String>();
|
||||
Iterator<String> k = jsonObj.keys();
|
||||
while (k.hasNext()) {
|
||||
String name = k.next();
|
||||
JSONObject jsonObj2 = new JSONObject(jsonObj.get(name).toString());
|
||||
colorList.add(jsonObj2.getString("color"));
|
||||
}
|
||||
return colorList;
|
||||
}
|
||||
}
|
||||
67
burp/action/ExtractContent.java
Normal file
67
burp/action/ExtractContent.java
Normal file
@@ -0,0 +1,67 @@
|
||||
package burp.action;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import org.json.JSONObject;
|
||||
|
||||
import burp.file.ReadFile;
|
||||
import jregex.Matcher;
|
||||
import jregex.Pattern;
|
||||
|
||||
public class ExtractContent {
|
||||
ReadFile rf = new ReadFile();
|
||||
public JSONObject matchRegex(byte[] content, String scopeString, String actionString, String configFilePath) {
|
||||
JSONObject tabContent = new JSONObject();
|
||||
// 正则匹配提取内容
|
||||
try {
|
||||
String jsonStr = rf.readFileContent(configFilePath);
|
||||
JSONObject jsonObj = new JSONObject(jsonStr);
|
||||
Iterator<String> k = jsonObj.keys();
|
||||
// 遍历json数组
|
||||
while (k.hasNext()) {
|
||||
String contentString = new String(content, "UTF-8").intern();
|
||||
String name = k.next();
|
||||
JSONObject jsonObj1 = new JSONObject(jsonObj.get(name).toString());
|
||||
JSONObject jsonData = new JSONObject();
|
||||
String regex = jsonObj1.getString("regex");
|
||||
boolean isLoaded = jsonObj1.getBoolean("loaded");
|
||||
String scope = jsonObj1.getString("scope");
|
||||
String action = jsonObj1.getString("action");
|
||||
String color = jsonObj1.getString("color");
|
||||
List<String> result = new ArrayList<String>();
|
||||
|
||||
if(isLoaded && (scope.equals(scopeString) || scope.equals("any")) && (action.equals(actionString) || action.equals("any"))) {
|
||||
Pattern pattern = new Pattern(regex);
|
||||
Matcher matcher = pattern.matcher(contentString);
|
||||
while (matcher.find()) {
|
||||
// 添加匹配数据至list
|
||||
// 强制用户使用()包裹正则
|
||||
result.add(matcher.group(1));
|
||||
}
|
||||
|
||||
// 去除重复内容
|
||||
HashSet tmpList = new HashSet(result);
|
||||
result.clear();
|
||||
result.addAll(tmpList);
|
||||
|
||||
if (!result.isEmpty()) {
|
||||
jsonData.put("color", color);
|
||||
jsonData.put("data", String.join("\n", result));
|
||||
jsonData.put("loaded", isLoaded);
|
||||
// 初始化格式
|
||||
tabContent.put(name, jsonData);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
} catch (Exception e) {}
|
||||
|
||||
return tabContent;
|
||||
}
|
||||
}
|
||||
36
burp/action/MatchHTTP.java
Normal file
36
burp/action/MatchHTTP.java
Normal file
@@ -0,0 +1,36 @@
|
||||
package burp.action;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import burp.Config;
|
||||
import jregex.Matcher;
|
||||
import jregex.Pattern;
|
||||
import jregex.REFlags;
|
||||
|
||||
public class MatchHTTP {
|
||||
// 匹配后缀
|
||||
public boolean matchSuffix(String str) {
|
||||
Pattern pattern = new Pattern(String.format("[\\w]+[\\.](%s)", Config.excludeSuffix), REFlags.IGNORE_CASE);
|
||||
Matcher matcher = pattern.matcher(str);
|
||||
if(matcher.find()){
|
||||
return true;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// 匹配MIME
|
||||
public boolean matchMIME(List<String> mimeList) {
|
||||
for (String headerString : mimeList) {
|
||||
if (headerString.toLowerCase().startsWith("content-type")) {
|
||||
for (String mime : Arrays.asList(Config.excludeMIME)) {
|
||||
if (headerString.contains(mime)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
23
burp/color/GetColorKey.java
Normal file
23
burp/color/GetColorKey.java
Normal file
@@ -0,0 +1,23 @@
|
||||
package burp.color;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class GetColorKey {
|
||||
/*
|
||||
* 颜色下标获取
|
||||
*/
|
||||
public List<Integer> getColorKeys(List<String> keys, String[] colorArray){
|
||||
List<Integer> result = new ArrayList<Integer>();
|
||||
int size = colorArray.length;
|
||||
// 根据颜色获取下标
|
||||
for (int x = 0; x < keys.size(); x++) {
|
||||
for (int v = 0; v < size; v++) {
|
||||
if (colorArray[v].equals(keys.get(x))) {
|
||||
result.add(v);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
53
burp/color/UpgradeColor.java
Normal file
53
burp/color/UpgradeColor.java
Normal file
@@ -0,0 +1,53 @@
|
||||
package burp.color;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Comparator;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
|
||||
public class UpgradeColor {
|
||||
|
||||
private String endColor = "";
|
||||
/*
|
||||
* 颜色升级递归算法
|
||||
*/
|
||||
private String colorUpgrade(List<Integer> colorList, String[] colorArray) {
|
||||
int colorSize = colorList.size();
|
||||
colorList.sort(Comparator.comparingInt(Integer::intValue));
|
||||
int i = 0;
|
||||
List<Integer> stack = new ArrayList<Integer>();
|
||||
while (i < colorSize) {
|
||||
if (stack.isEmpty()) {
|
||||
stack.add(colorList.get(i));
|
||||
i++;
|
||||
} else {
|
||||
if (colorList.get(i) != stack.stream().reduce((first, second) -> second).orElse(99999999)) {
|
||||
stack.add(colorList.get(i));
|
||||
i++;
|
||||
} else {
|
||||
stack.set(stack.size() - 1, stack.get(stack.size() - 1) - 1);
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
// 利用HashSet删除重复元素
|
||||
HashSet tmpList = new HashSet(stack);
|
||||
if (stack.size() == tmpList.size()) {
|
||||
stack.sort(Comparator.comparingInt(Integer::intValue));
|
||||
if(stack.get(0).equals(-1)) {
|
||||
this.endColor = colorArray[0];
|
||||
} else {
|
||||
this.endColor = colorArray[stack.get(0)];
|
||||
}
|
||||
} else {
|
||||
this.colorUpgrade(stack, colorArray);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public String getEndColor(List<Integer> colorList, String[] colorArray) {
|
||||
colorUpgrade(colorList, colorArray);
|
||||
return endColor;
|
||||
}
|
||||
}
|
||||
18
burp/file/FileExists.java
Normal file
18
burp/file/FileExists.java
Normal file
@@ -0,0 +1,18 @@
|
||||
package burp.file;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
public class FileExists {
|
||||
|
||||
/*
|
||||
* 判断文件是否存在
|
||||
*/
|
||||
public Boolean fileExists(String fileName) {
|
||||
File file = new File(fileName);
|
||||
if(file.exists()){
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
36
burp/file/ReadFile.java
Normal file
36
burp/file/ReadFile.java
Normal file
@@ -0,0 +1,36 @@
|
||||
package burp.file;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.FileReader;
|
||||
import java.io.IOException;
|
||||
|
||||
public class ReadFile {
|
||||
/*
|
||||
* 获取文件内容
|
||||
*/
|
||||
public String readFileContent(String fileName) {
|
||||
File file = new File(fileName);
|
||||
BufferedReader reader = null;
|
||||
StringBuffer sbf = new StringBuffer();
|
||||
try {
|
||||
reader = new BufferedReader(new FileReader(file));
|
||||
String tempStr;
|
||||
while ((tempStr = reader.readLine()) != null) {
|
||||
sbf.append(tempStr);
|
||||
}
|
||||
reader.close();
|
||||
return sbf.toString();
|
||||
} catch (IOException e) {
|
||||
} finally {
|
||||
if (reader != null) {
|
||||
try {
|
||||
reader.close();
|
||||
} catch (IOException err) {
|
||||
err.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
return sbf.toString();
|
||||
}
|
||||
}
|
||||
22
burp/file/RemoveContent.java
Normal file
22
burp/file/RemoveContent.java
Normal file
@@ -0,0 +1,22 @@
|
||||
package burp.file;
|
||||
|
||||
import javax.swing.JOptionPane;
|
||||
|
||||
import org.json.JSONObject;
|
||||
|
||||
public class RemoveContent {
|
||||
WriteFile w = new WriteFile();
|
||||
ReadFile r = new ReadFile();
|
||||
/*
|
||||
* 删除某文件内容
|
||||
*/
|
||||
public void removeFileContent(String key, String configFilePath) {
|
||||
String jsonStr = r.readFileContent(configFilePath);
|
||||
JSONObject jsonObj = new JSONObject(jsonStr);
|
||||
jsonObj.remove(key);
|
||||
|
||||
if (w.writeFileContent(configFilePath, jsonObj.toString())) {
|
||||
JOptionPane.showMessageDialog(null, "Delete Successfully!", "Info", JOptionPane.INFORMATION_MESSAGE);
|
||||
}
|
||||
}
|
||||
}
|
||||
21
burp/file/WriteFile.java
Normal file
21
burp/file/WriteFile.java
Normal file
@@ -0,0 +1,21 @@
|
||||
package burp.file;
|
||||
|
||||
import java.io.BufferedWriter;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
|
||||
public class WriteFile {
|
||||
/*
|
||||
* 写入文件内容
|
||||
*/
|
||||
public boolean writeFileContent(String fileName, String fileContent) {
|
||||
try {
|
||||
BufferedWriter out = new BufferedWriter(new FileWriter(fileName));
|
||||
out.write(fileContent);
|
||||
out.close();
|
||||
return true;
|
||||
} catch (IOException e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
44
burp/ui/FillTable.java
Normal file
44
burp/ui/FillTable.java
Normal file
@@ -0,0 +1,44 @@
|
||||
package burp.ui;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.Vector;
|
||||
|
||||
import javax.swing.JTable;
|
||||
import javax.swing.table.DefaultTableModel;
|
||||
|
||||
import org.json.JSONObject;
|
||||
|
||||
import burp.file.ReadFile;
|
||||
|
||||
public class FillTable {
|
||||
ReadFile rf = new ReadFile();
|
||||
/*
|
||||
* 初始化表格内容
|
||||
*/
|
||||
public void fillTable(String configFilePath, JTable table) {
|
||||
DefaultTableModel dtm=(DefaultTableModel) table.getModel();
|
||||
dtm.setRowCount(0);
|
||||
String jsonStr = rf.readFileContent(configFilePath);
|
||||
JSONObject jsonObj = new JSONObject(jsonStr);
|
||||
Iterator<String> k = jsonObj.keys();
|
||||
// 遍历json数组
|
||||
while (k.hasNext()) {
|
||||
String name = k.next();
|
||||
JSONObject jsonObj1 = new JSONObject(jsonObj.get(name).toString());
|
||||
boolean loaded = jsonObj1.getBoolean("loaded");
|
||||
String regex = jsonObj1.getString("regex");
|
||||
String color = jsonObj1.getString("color");
|
||||
String scope = jsonObj1.getString("scope");
|
||||
String action = jsonObj1.getString("action");
|
||||
// 填充数据
|
||||
Vector rules = new Vector();
|
||||
rules.add(loaded);
|
||||
rules.add(name);
|
||||
rules.add(regex);
|
||||
rules.add(color);
|
||||
rules.add(scope);
|
||||
rules.add(action);
|
||||
dtm.addRow(rules);
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 214 KiB After Width: | Height: | Size: 698 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 131 KiB After Width: | Height: | Size: 223 KiB |
Reference in New Issue
Block a user