Skip to content

Commit

Permalink
升级版本到0.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
c0ny1 committed Jul 28, 2021
1 parent 51e7988 commit 6392b75
Show file tree
Hide file tree
Showing 8 changed files with 605 additions and 574 deletions.
29 changes: 29 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,32 @@
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*

### Java template
# Compiled class file
*.class

# Log file
*.log

# BlueJ files
*.ctxt

# Mobile Tools for Java (J2ME)
.mtj.tmp/

# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*

target
out
.DS_Store
.idea/*
25 changes: 25 additions & 0 deletions .idea/jarRepositories.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

465 changes: 465 additions & 0 deletions .idea/qaplug_profiles.xml

Large diffs are not rendered by default.

625 changes: 62 additions & 563 deletions .idea/workspace.xml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/main/java/burp/BurpExtender.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

public class BurpExtender implements IBurpExtender,ITab,IProxyListener {
public final static String extensionName = "Passive Scan Client";
public final static String version ="0.2";
public final static String version ="0.3.0";
public static IBurpExtenderCallbacks callbacks;
public static IExtensionHelpers helpers;
public static PrintWriter stdout;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/burp/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
public class Config {
public static boolean IS_RUNNING = false;
public static String PROXY_HOST = "127.0.0.1";
public static Integer PROXY_PORT = 9898;
public static Integer PROXY_PORT = 1664;
public static String PROXY_USERNAME = null;
public static String PROXY_PASSWORD = null;
public static Integer PROXY_TIMEOUT = 5000;
Expand Down
18 changes: 9 additions & 9 deletions src/main/java/burp/HttpAndHttpsProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ public static Map<String,String> HttpProxy(String url,List<String> headers,byte[
String result = "";


HttpURLConnection httpConn = null;
HttpURLConnection httpsConn = null;
PrintWriter out = null;
BufferedReader in = null;
BufferedReader reader = null;
Expand All @@ -200,14 +200,14 @@ public static Map<String,String> HttpProxy(String url,List<String> headers,byte[
//创建代理
Proxy proxy1=new Proxy(Type.HTTP, new InetSocketAddress(proxy, port));
//设置代理
httpConn = (HttpURLConnection) urlClient.openConnection(proxy1);
httpsConn = (HttpURLConnection) urlClient.openConnection(proxy1);

//设置账号密码
if(username != null && username != "" && password != null && password != "" ) {
String user_pass = String.format("%s:%s", username, password);
String headerKey = "Proxy-Authorization";
String headerValue = "Basic " + Base64.encode(user_pass.getBytes());
httpConn.setRequestProperty(headerKey, headerValue);
httpsConn.setRequestProperty(headerKey, headerValue);
}


Expand All @@ -223,7 +223,7 @@ public static Map<String,String> HttpProxy(String url,List<String> headers,byte[
String header_value = h[1].trim();
//BurpExtender.stdout.println("key: " + h[0].trim());
//BurpExtender.stdout.println("value: " + h[1].trim());
httpConn.setRequestProperty(header_key, header_value);
httpsConn.setRequestProperty(header_key, header_value);
}
//设置控制请求方法的Flag
String methodFlag = "";
Expand Down Expand Up @@ -270,15 +270,15 @@ else if(methodFlag.equals("POST")){
out.flush();
}
// 定义BufferedReader输入流来读取URL的响应
in = new BufferedReader(new InputStreamReader(httpConn.getInputStream()));
in = new BufferedReader(new InputStreamReader(httpsConn.getInputStream()));
String line;
while ((line = in.readLine()) != null) {
result += line;
result += "\r\n";
}
// 断开连接
httpConn.disconnect();
Map<String, List<String>> mapHeaders = httpConn.getHeaderFields();
httpsConn.disconnect();
Map<String, List<String>> mapHeaders = httpsConn.getHeaderFields();
for (Map.Entry<String, List<String>> entry : mapHeaders.entrySet()) {
String key = entry.getKey();
List<String> values = entry.getValue();
Expand All @@ -298,7 +298,7 @@ else if(methodFlag.equals("POST")){

//BurpExtender.stdout.println("====result===="+result);
//BurpExtender.stdout.println("返回结果http:" + httpConn.getResponseMessage());
status = String.valueOf(httpConn.getResponseCode());
status = String.valueOf(httpsConn.getResponseCode());
Utils.updateSuccessCount();
} catch (Exception e) {
//e.printStackTrace();
Expand All @@ -325,7 +325,7 @@ else if(methodFlag.equals("POST")){
}

try {
status = String.valueOf(httpConn.getResponseCode());
status = String.valueOf(httpsConn.getResponseCode());
} catch (IOException e) {
status = e.getMessage();
BurpExtender.stderr.println("[*] " + e.getMessage());
Expand Down

0 comments on commit 6392b75

Please sign in to comment.