Version: 2.2.2 Update
This commit is contained in:
@@ -13,7 +13,7 @@ import java.util.List;
|
||||
import javax.swing.event.ChangeEvent;
|
||||
import javax.swing.event.ChangeListener;
|
||||
|
||||
/*
|
||||
/**
|
||||
* @author EvilChen & 0chencc
|
||||
*/
|
||||
|
||||
@@ -61,7 +61,7 @@ public class BurpExtender implements IBurpExtender, IHttpListener, IMessageEdito
|
||||
return main;
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* 使用processHttpMessage用来做Highlighter
|
||||
*/
|
||||
@Override
|
||||
@@ -149,7 +149,7 @@ public class BurpExtender implements IBurpExtender, IHttpListener, IMessageEdito
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* 快捷键复制功能
|
||||
*/
|
||||
@Override
|
||||
@@ -162,7 +162,7 @@ public class BurpExtender implements IBurpExtender, IHttpListener, IMessageEdito
|
||||
return helpers.stringToBytes(selectData.toString());
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* 使用setMessage用来做Extractor
|
||||
*/
|
||||
@Override
|
||||
@@ -177,7 +177,7 @@ public class BurpExtender implements IBurpExtender, IHttpListener, IMessageEdito
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* 创建MarkInfo表单
|
||||
*/
|
||||
public void makeTable(Map<String, String> dataMap) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package burp;
|
||||
|
||||
/*
|
||||
/**
|
||||
* @author EvilChen
|
||||
*/
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import burp.Config;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/*
|
||||
/**
|
||||
* @author EvilChen
|
||||
*/
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ import dk.brics.automaton.RunAutomaton;
|
||||
import jregex.Matcher;
|
||||
import jregex.Pattern;
|
||||
|
||||
/*
|
||||
/**
|
||||
* @author EvilChen
|
||||
*/
|
||||
|
||||
|
||||
@@ -4,12 +4,12 @@ import burp.Config;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/*
|
||||
/**
|
||||
* @author EvilChen
|
||||
*/
|
||||
|
||||
public class GetColorKey {
|
||||
/*
|
||||
/**
|
||||
* 颜色下标获取
|
||||
*/
|
||||
public List<Integer> getColorKeys(List<String> keys){
|
||||
|
||||
@@ -5,7 +5,7 @@ import jregex.Pattern;
|
||||
import jregex.REFlags;
|
||||
import burp.yaml.LoadConfig;
|
||||
|
||||
/*
|
||||
/**
|
||||
* @author EvilChen
|
||||
*/
|
||||
|
||||
|
||||
@@ -4,13 +4,13 @@ import burp.Config;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/*
|
||||
/**
|
||||
* @author EvilChen
|
||||
*/
|
||||
|
||||
public class UpgradeColor {
|
||||
private String endColor = "";
|
||||
/*
|
||||
/**
|
||||
* 颜色升级递归算法
|
||||
*/
|
||||
private void colorUpgrade(List<Integer> colorList) {
|
||||
|
||||
@@ -6,7 +6,7 @@ import java.awt.*;
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.awt.event.MouseListener;
|
||||
|
||||
/*
|
||||
/**
|
||||
* @author 6dc
|
||||
*
|
||||
* A class which creates a JTabbedPane and auto sets a close button when you add a tab
|
||||
@@ -18,7 +18,7 @@ public class JTabbedPaneCloseButton extends JTabbedPane {
|
||||
super();
|
||||
}
|
||||
|
||||
/* Override Addtab in order to add the close Button everytime */
|
||||
/** Override Addtab in order to add the close Button everytime */
|
||||
@Override
|
||||
public void addTab(String title, Icon icon, Component component, String tip) {
|
||||
super.addTab(title, icon, component, tip);
|
||||
@@ -45,7 +45,7 @@ public class JTabbedPaneCloseButton extends JTabbedPane {
|
||||
}
|
||||
}
|
||||
|
||||
/* addTabNoExit */
|
||||
/** addTabNoExit */
|
||||
public void addTabNoExit(String title, Icon icon, Component component, String tip) {
|
||||
super.addTab(title, icon, component, tip);
|
||||
}
|
||||
@@ -58,7 +58,7 @@ public class JTabbedPaneCloseButton extends JTabbedPane {
|
||||
addTabNoExit(title, null, component);
|
||||
}
|
||||
|
||||
/* Button */
|
||||
/** Button */
|
||||
public class CloseButtonTab extends JPanel {
|
||||
|
||||
public CloseButtonTab(final Component tab, String title, Icon icon) {
|
||||
@@ -74,7 +74,7 @@ public class JTabbedPaneCloseButton extends JTabbedPane {
|
||||
add(button);
|
||||
}
|
||||
}
|
||||
/* ClickListener */
|
||||
/** ClickListener */
|
||||
public class CloseListener implements MouseListener
|
||||
{
|
||||
private final Component tab;
|
||||
|
||||
@@ -14,7 +14,7 @@ import java.awt.*;
|
||||
import java.awt.event.*;
|
||||
import java.util.Map;
|
||||
|
||||
/*
|
||||
/**
|
||||
* @author LinChen
|
||||
*/
|
||||
|
||||
|
||||
@@ -12,19 +12,20 @@ import java.awt.event.MouseAdapter;
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.util.Vector;
|
||||
|
||||
/*
|
||||
/**
|
||||
* @author LinChen
|
||||
*/
|
||||
|
||||
public class RulePane extends JPanel {
|
||||
public RulePane(Object[][] data,JTabbedPane pane) {
|
||||
initComponents(data,pane);
|
||||
public RulePane(Object[][] data, JTabbedPane pane) {
|
||||
initComponents(data, pane);
|
||||
}
|
||||
private SetConfig setruleconfig = new SetConfig();
|
||||
private SetConfig setConfig = new SetConfig();
|
||||
private Boolean isEdit = false;
|
||||
private void RuleAddMouseClicked(MouseEvent e, JTabbedPane pane) {
|
||||
|
||||
private void ruleAddMouseClicked(MouseEvent e, JTabbedPane pane) {
|
||||
RuleSetting add = new RuleSetting();
|
||||
int isOk = JOptionPane.showConfirmDialog(null,add,"RuleSetting - Add Rule",JOptionPane.OK_OPTION);
|
||||
int isOk = JOptionPane.showConfirmDialog(null, add, "RuleSetting - Add Rule", JOptionPane.OK_OPTION);
|
||||
if(isOk == 0){
|
||||
Vector data = new Vector();
|
||||
data.add(false);
|
||||
@@ -33,61 +34,61 @@ public class RulePane extends JPanel {
|
||||
data.add(add.ColorSelect.getSelectedItem().toString());
|
||||
data.add(add.ScopeSelect.getSelectedItem().toString());
|
||||
data.add(add.EngineSelect.getSelectedItem().toString());
|
||||
model.insertRow(model.getRowCount(),data);
|
||||
model = (DefaultTableModel) table.getModel();
|
||||
setruleconfig.add(data,pane.getTitleAt(pane.getSelectedIndex()));
|
||||
model.insertRow(model.getRowCount(), data);
|
||||
model = (DefaultTableModel) jTable.getModel();
|
||||
setConfig.add(data, pane.getTitleAt(pane.getSelectedIndex()));
|
||||
}
|
||||
}
|
||||
|
||||
private void RuleEditMouseClicked(MouseEvent e,JTabbedPane pane){
|
||||
if (table.getSelectedRowCount()>=1){
|
||||
private void ruleEditMouseClicked(MouseEvent e, JTabbedPane pane){
|
||||
if (jTable.getSelectedRowCount() >= 1){
|
||||
RuleSetting edit = new RuleSetting();
|
||||
edit.Name.setText(table.getValueAt(table.getSelectedRow(),1).toString());
|
||||
edit.Regex.setText(table.getValueAt(table.getSelectedRow(),2).toString());
|
||||
edit.ColorSelect.setSelectedItem(table.getValueAt(table.getSelectedRow(),3).toString());
|
||||
edit.ScopeSelect.setSelectedItem(table.getValueAt(table.getSelectedRow(),4).toString());
|
||||
edit.EngineSelect.setSelectedItem(table.getValueAt(table.getSelectedRow(),5).toString());
|
||||
int isOk = JOptionPane.showConfirmDialog(null,edit,"RuleSetting - Edit Rule",JOptionPane.OK_OPTION);
|
||||
if (isOk ==0){
|
||||
int select = table.convertRowIndexToModel(table.getSelectedRow());
|
||||
model.setValueAt(edit.Name.getText(),select,1);
|
||||
model.setValueAt(edit.Regex.getText(),select,2);
|
||||
model.setValueAt(edit.ColorSelect.getSelectedItem().toString(),select,3);
|
||||
model.setValueAt(edit.ScopeSelect.getSelectedItem().toString(),select,4);
|
||||
model.setValueAt(edit.EngineSelect.getSelectedItem().toString(),select,5);
|
||||
model = (DefaultTableModel) table.getModel();
|
||||
setruleconfig.edit((Vector) model.getDataVector().get(select),select,pane.getTitleAt(pane.getSelectedIndex()));
|
||||
edit.Name.setText(jTable.getValueAt(jTable.getSelectedRow(), 1).toString());
|
||||
edit.Regex.setText(jTable.getValueAt(jTable.getSelectedRow(), 2).toString());
|
||||
edit.ColorSelect.setSelectedItem(jTable.getValueAt(jTable.getSelectedRow(), 3).toString());
|
||||
edit.ScopeSelect.setSelectedItem(jTable.getValueAt(jTable.getSelectedRow(), 4).toString());
|
||||
edit.EngineSelect.setSelectedItem(jTable.getValueAt(jTable.getSelectedRow(), 5).toString());
|
||||
int isOk = JOptionPane.showConfirmDialog(null, edit, "RuleSetting - Edit Rule", JOptionPane.OK_OPTION);
|
||||
if (isOk == 0){
|
||||
int select = jTable.convertRowIndexToModel(jTable.getSelectedRow());
|
||||
model.setValueAt(edit.Name.getText(), select, 1);
|
||||
model.setValueAt(edit.Regex.getText(), select, 2);
|
||||
model.setValueAt(edit.ColorSelect.getSelectedItem().toString(), select, 3);
|
||||
model.setValueAt(edit.ScopeSelect.getSelectedItem().toString(), select, 4);
|
||||
model.setValueAt(edit.EngineSelect.getSelectedItem().toString(), select, 5);
|
||||
model = (DefaultTableModel) jTable.getModel();
|
||||
setConfig.edit((Vector) model.getDataVector().get(select), select, pane.getTitleAt(pane.getSelectedIndex()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void RuleRemoveMouseClicked(MouseEvent e,JTabbedPane pane){
|
||||
if (table.getSelectedRowCount()>=1){
|
||||
int isOk = JOptionPane.showConfirmDialog(null,"Are your sure?","RuleSetting - Delete Rule",JOptionPane.OK_OPTION);
|
||||
if (isOk==0){
|
||||
int select = table.convertRowIndexToModel(table.getSelectedRow());
|
||||
private void ruleRemoveMouseClicked(MouseEvent e, JTabbedPane pane){
|
||||
if (jTable.getSelectedRowCount() >= 1){
|
||||
int isOk = JOptionPane.showConfirmDialog(null, "Are your sure?", "RuleSetting - Delete Rule", JOptionPane.OK_OPTION);
|
||||
if (isOk == 0){
|
||||
int select = jTable.convertRowIndexToModel(jTable.getSelectedRow());
|
||||
model.removeRow(select);
|
||||
model = (DefaultTableModel) table.getModel();
|
||||
setruleconfig.remove(select,pane.getTitleAt(pane.getSelectedIndex()));
|
||||
model = (DefaultTableModel) jTable.getModel();
|
||||
setConfig.remove(select, pane.getTitleAt(pane.getSelectedIndex()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void RuleTableChange(TableModelEvent e,JTabbedPane pane) {
|
||||
if (e.getColumn()==0&&table.getSelectedRow()!=-1&&!isEdit){
|
||||
model = (DefaultTableModel) table.getModel();
|
||||
int select = table.convertRowIndexToModel(table.getSelectedRow());
|
||||
setruleconfig.edit((Vector) model.getDataVector().get(select),select,pane.getTitleAt(pane.getSelectedIndex()));
|
||||
private void ruleTableChange(TableModelEvent e, JTabbedPane pane) {
|
||||
if (e.getColumn() == 0 && jTable.getSelectedRow() != -1 && !isEdit){
|
||||
model = (DefaultTableModel) jTable.getModel();
|
||||
int select = jTable.convertRowIndexToModel(jTable.getSelectedRow());
|
||||
setConfig.edit((Vector) model.getDataVector().get(select), select, pane.getTitleAt(pane.getSelectedIndex()));
|
||||
}
|
||||
}
|
||||
|
||||
private void initComponents(Object[][] data,JTabbedPane pane) {
|
||||
private void initComponents(Object[][] data, JTabbedPane pane) {
|
||||
// JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents
|
||||
RuleAdd = new JButton();
|
||||
RuleEdit = new JButton();
|
||||
addButton = new JButton();
|
||||
editButton = new JButton();
|
||||
scrollPane = new JScrollPane();
|
||||
table = new JTable();
|
||||
Remove = new JButton();
|
||||
jTable = new JTable();
|
||||
removeButton = new JButton();
|
||||
|
||||
//======== this ========
|
||||
setLayout(new GridBagLayout());
|
||||
@@ -96,89 +97,96 @@ public class RulePane extends JPanel {
|
||||
((GridBagLayout)getLayout()).columnWeights = new double[] {0.0, 1.0, 1.0E-4};
|
||||
((GridBagLayout)getLayout()).rowWeights = new double[] {0.0, 0.0, 0.0, 1.0, 1.0E-4};
|
||||
|
||||
//---- RuleAdd ----
|
||||
RuleAdd.setText("Add");
|
||||
RuleAdd.addMouseListener(new MouseAdapter() {
|
||||
//---- addButton ----
|
||||
addButton.setText("Add");
|
||||
|
||||
addButton.addMouseListener(new MouseAdapter() {
|
||||
@Override
|
||||
public void mouseClicked(MouseEvent e) {
|
||||
isEdit = true;
|
||||
RuleAddMouseClicked(e,pane);
|
||||
model = (DefaultTableModel) table.getModel();
|
||||
ruleAddMouseClicked(e, pane);
|
||||
model = (DefaultTableModel) jTable.getModel();
|
||||
isEdit = false;
|
||||
}
|
||||
});
|
||||
add(RuleAdd, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0,
|
||||
GridBagConstraints.CENTER, GridBagConstraints.BOTH,
|
||||
|
||||
add(addButton, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0,
|
||||
GridBagConstraints.CENTER, GridBagConstraints.BOTH,
|
||||
new Insets(15, 5, 3, 2), 0, 0));
|
||||
|
||||
//---- RuleEdit ----
|
||||
RuleEdit.setText("Edit");
|
||||
RuleEdit.addMouseListener(new MouseAdapter() {
|
||||
//---- editButton ----
|
||||
editButton.setText("Edit");
|
||||
editButton.addMouseListener(new MouseAdapter() {
|
||||
@Override
|
||||
public void mouseClicked(MouseEvent e) {
|
||||
isEdit = true;
|
||||
RuleEditMouseClicked(e,pane);
|
||||
model = (DefaultTableModel) table.getModel();
|
||||
ruleEditMouseClicked(e, pane);
|
||||
model = (DefaultTableModel) jTable.getModel();
|
||||
isEdit = false;
|
||||
}
|
||||
});
|
||||
add(RuleEdit, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0,
|
||||
GridBagConstraints.CENTER, GridBagConstraints.BOTH,
|
||||
|
||||
add(editButton, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0,
|
||||
GridBagConstraints.CENTER, GridBagConstraints.BOTH,
|
||||
new Insets(0, 5, 3, 2), 0, 0));
|
||||
|
||||
//======== scrollPane ========
|
||||
{
|
||||
|
||||
//---- table ----
|
||||
table.setShowVerticalLines(false);
|
||||
table.setVerifyInputWhenFocusTarget(false);
|
||||
table.setUpdateSelectionOnSort(false);
|
||||
table.setShowHorizontalLines(false);
|
||||
table.setModel(new DefaultTableModel());
|
||||
table.setSurrendersFocusOnKeystroke(true);
|
||||
scrollPane.setViewportView(table);
|
||||
jTable.setShowVerticalLines(false);
|
||||
jTable.setVerifyInputWhenFocusTarget(false);
|
||||
jTable.setUpdateSelectionOnSort(false);
|
||||
jTable.setShowHorizontalLines(false);
|
||||
jTable.setModel(new DefaultTableModel());
|
||||
jTable.setSurrendersFocusOnKeystroke(true);
|
||||
scrollPane.setViewportView(jTable);
|
||||
}
|
||||
add(scrollPane, new GridBagConstraints(1, 0, 1, 4, 0.0, 0.0,
|
||||
GridBagConstraints.CENTER, GridBagConstraints.BOTH,
|
||||
|
||||
add(scrollPane, new GridBagConstraints(1, 0, 1, 4, 0.0, 0.0,
|
||||
GridBagConstraints.CENTER, GridBagConstraints.BOTH,
|
||||
new Insets(15, 5, 5, 5), 0, 0));
|
||||
|
||||
//---- Remove ----
|
||||
Remove.setText("Remove");
|
||||
Remove.addMouseListener(new MouseAdapter() {
|
||||
//---- removeButton ----
|
||||
removeButton.setText("Remove");
|
||||
|
||||
removeButton.addMouseListener(new MouseAdapter() {
|
||||
@Override
|
||||
public void mouseClicked(MouseEvent e) {
|
||||
isEdit = true;
|
||||
RuleRemoveMouseClicked(e,pane);
|
||||
model = (DefaultTableModel) table.getModel();
|
||||
ruleRemoveMouseClicked(e, pane);
|
||||
model = (DefaultTableModel) jTable.getModel();
|
||||
isEdit = false;
|
||||
}
|
||||
});
|
||||
add(Remove, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0,
|
||||
GridBagConstraints.CENTER, GridBagConstraints.BOTH,
|
||||
|
||||
add(removeButton, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0,
|
||||
GridBagConstraints.CENTER, GridBagConstraints.BOTH,
|
||||
new Insets(0, 5, 3, 2), 0, 0));
|
||||
|
||||
// JFormDesigner - End of component initialization //GEN-END:initComponents
|
||||
table.setModel(model);
|
||||
model.setDataVector(data,title);
|
||||
jTable.setModel(model);
|
||||
model.setDataVector(data, title);
|
||||
model.addTableModelListener(new TableModelListener() {
|
||||
@Override
|
||||
public void tableChanged(TableModelEvent e) {
|
||||
RuleTableChange(e,pane);
|
||||
ruleTableChange(e, pane);
|
||||
}
|
||||
});
|
||||
table.setRowSorter(new TableRowSorter(model));
|
||||
|
||||
jTable.setRowSorter(new TableRowSorter(model));
|
||||
}
|
||||
|
||||
// JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables
|
||||
public JButton RuleAdd;
|
||||
public JButton RuleEdit;
|
||||
public JButton addButton;
|
||||
public JButton editButton;
|
||||
public JScrollPane scrollPane;
|
||||
public JTable table;
|
||||
public JButton Remove;
|
||||
public JTable jTable;
|
||||
public JButton removeButton;
|
||||
// JFormDesigner - End of variables declaration //GEN-END:variables
|
||||
private final String[] title = new String[]{"Loaded", "Name", "Regex", "Color", "Scope", "Engine"};
|
||||
private DefaultTableModel model = new DefaultTableModel() {
|
||||
@Override
|
||||
public Class<?> getColumnClass ( int column){
|
||||
public Class<?> getColumnClass (int column){
|
||||
if (column == 0) {
|
||||
return Boolean.class;
|
||||
}else{
|
||||
@@ -187,12 +195,8 @@ public class RulePane extends JPanel {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCellEditable(int row,int column){
|
||||
if (column ==0){
|
||||
return true;
|
||||
}else {
|
||||
return false;
|
||||
}
|
||||
public boolean isCellEditable(int row, int column){
|
||||
return column == 0;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import burp.Config;
|
||||
|
||||
/*
|
||||
/**
|
||||
* @author LinChen
|
||||
*/
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ package burp.yaml.template;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/*
|
||||
/**
|
||||
* @author LinChen
|
||||
*/
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import burp.yaml.template.Rule;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/*
|
||||
/**
|
||||
* @author LinChen
|
||||
*/
|
||||
|
||||
|
||||
Reference in New Issue
Block a user