Skip to content

Commit

Permalink
添加设置获取加密结果超时功能
Browse files Browse the repository at this point in the history
  • Loading branch information
c0ny1 committed May 16, 2019
1 parent 37e633d commit 342f49e
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 12 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>me.gv7.tools.burpextend</groupId>
<artifactId>jsEncrypter</artifactId>
<version>0.2.1</version>
<version>0.2.2</version>

<dependencies>
<!-- https://mvnrepository.com/artifact/net.portswigger.burp.extender/burp-extender-api -->
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/burp/BurpExtender.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

public class BurpExtender implements IBurpExtender,IIntruderPayloadProcessor,ITab {
public final static String extensionName = "jsEncrypter";
public final static String version ="0.2.1";
public final static String version ="0.2.2";
private IBurpExtenderCallbacks callbacks;
private IExtensionHelpers helpers;
private PrintWriter stdout;
Expand Down Expand Up @@ -55,8 +55,8 @@ public byte[] processPayload(byte[] currentPayload, byte[] originalPayload, byte
String strPayload = null;
try {
HttpClient hc = new HttpClient(gui.getURL());
hc.setConnTimeout(3000);
hc.setReadTimeout(3000);
hc.setConnTimeout(gui.getTimeout());
hc.setReadTimeout(gui.getTimeout());
String data = "payload=" + payload;
hc.setData(data);
hc.sendPost();
Expand Down
28 changes: 20 additions & 8 deletions src/main/java/burp/GUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ public class GUI{
private JTextField tfHost;
private JLabel lbPort;
private JTextField tfPort;
private JLabel lbTimeout;
private JTextField tfTimeout;
private JButton btnConn;
private JLabel lbConnectInfo;
private JLabel lbConnectStatus;
Expand Down Expand Up @@ -56,22 +58,28 @@ public GUI(IBurpExtenderCallbacks callbacks) {

lbHost = new JLabel("Host:");
panel.add(lbHost);

tfHost = new JTextField();
tfHost.setColumns(20);
tfHost.setText("127.0.0.1");
panel.add(tfHost);

verticalStrut = Box.createVerticalStrut(20);
panel.add(verticalStrut);

lbPort = new JLabel("Port:");
panel.add(lbPort);

tfPort = new JTextField();
tfPort.setText("1664");
panel.add(tfPort);
tfPort.setColumns(20);
tfPort.setColumns(10);

verticalStrut = Box.createVerticalStrut(20);
panel.add(verticalStrut);
lbTimeout = new JLabel("Timeout:");
panel.add(lbTimeout);
tfTimeout = new JTextField();
tfTimeout.setText("5000");
panel.add(tfTimeout);
tfTimeout.setColumns(10);

btnConn = new JButton("Connect");
btnConn.setToolTipText("Test the connection phantomJS");
Expand Down Expand Up @@ -137,6 +145,10 @@ public void actionPerformed(ActionEvent arg0) {
public Component getComponet(){
return contentPane;
}

public Integer getTimeout(){
return Integer.valueOf(tfTimeout.getText());
}

// 测试
private void Test() {
Expand All @@ -159,8 +171,8 @@ private String sendTestPaylaod(String payload) {
String newPayload = null;
try {
HttpClient hc = new HttpClient(this.getURL());
hc.setConnTimeout(3000);
hc.setReadTimeout(3000);
hc.setConnTimeout(Integer.valueOf(tfTimeout.getText()));
hc.setReadTimeout(Integer.valueOf(tfTimeout.getText()));
String data = "payload=" + payload;
hc.setData(data);
hc.sendPost();
Expand All @@ -186,8 +198,8 @@ public String getURL(){
private void testConnect(){
try {
HttpClient hc = new HttpClient(this.getURL());
hc.setReadTimeout(3000);
hc.setConnTimeout(3000);
hc.setReadTimeout(Integer.valueOf(tfTimeout.getText()));
hc.setConnTimeout(Integer.valueOf(tfTimeout.getText()));
hc.sendGet();
int n = helpers.indexOf(hc.getRspData().getBytes(), "hello".getBytes(), false, 0, hc.getRspData().length());
if((hc.getStatusCode() == 200)&&(n != -1)){
Expand Down

0 comments on commit 342f49e

Please sign in to comment.