Skip to content

Commit 51a33b0

Browse files
committed
首次提交
1 parent 8d6da6d commit 51a33b0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+4700
-0
lines changed

.classpath

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="src" path="src"/>
4+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
5+
<classpathentry kind="output" path="bin"/>
6+
</classpath>

.project

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>HTTPHeadModifer</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.jdt.core.javabuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
</buildSpec>
14+
<natures>
15+
<nature>org.eclipse.jdt.core.javanature</nature>
16+
</natures>
17+
</projectDescription>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
eclipse.preferences.version=1
2+
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
3+
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
4+
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
5+
org.eclipse.jdt.core.compiler.compliance=1.8
6+
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
7+
org.eclipse.jdt.core.compiler.debug.localVariable=generate
8+
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
9+
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
10+
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
11+
org.eclipse.jdt.core.compiler.source=1.8

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,24 @@
11
# HTTPHeadModifer
22
一款快速修改HTTP数据包头的Burp Suite插件
3+
4+
![HTTPHeadModifer插件菜单](doc/HTTPHeadModifer.png)
5+
6+
##一、插件功能
7+
#### 1.添加IP相关的HTTP头
8+
方便测试IP伪造,WAF绕过,HTTP盲攻击等等
9+
10+
#### 2.切换User-Agent
11+
可任意切换Firefox,Chorme,Edge,IE,Opera,Safari,Android,Windows phone,IOS等浏览器和谷歌,必应,百度等各大搜索引擎爬虫的User-Agetn。
12+
13+
PS:数据来源于Chrome浏览器插件`User-Agent Switcher for Google Chrome`和自己补充。
14+
15+
#### 3.添加Origin
16+
方便测试CROS跨域漏洞
17+
18+
#### 4.更新Cookie
19+
方便更新数据包为最新可用Cookie,实现代码来自项目[knife](https://github.com/bit4woo/knife)
20+
21+
注意:该功能代码存在问题,正在排查。
22+
23+
## 二、最后的话
24+
HTTPHeadModifer插件的目的在于 **收集渗透测试过程中涉及的HTTP头,方便我们快速添加到数据包中进行测试** 。如有一些遗漏的HTTP头,欢迎补充!

doc/HTTPHeadModifer.png

153 KB
Loading

src/burp/BurpExtender.java

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
package burp;
2+
3+
import java.awt.Component;
4+
import java.io.PrintWriter;
5+
6+
public class BurpExtender implements IBurpExtender{
7+
private IBurpExtenderCallbacks callbacks;
8+
private IExtensionHelpers helpers;
9+
private PrintWriter stdout;
10+
private PrintWriter stderr;
11+
private String extensionName = "HTTPHeadModifer";
12+
private String version ="0.1";
13+
14+
15+
@Override
16+
public void registerExtenderCallbacks(IBurpExtenderCallbacks callbacks)
17+
{
18+
this.callbacks = callbacks;
19+
this.helpers = callbacks.getHelpers();
20+
this.stdout = new PrintWriter(callbacks.getStdout(),true);
21+
this.stderr = new PrintWriter(callbacks.getStderr(),true);
22+
23+
callbacks.setExtensionName(String.format("%s v%s", extensionName,version));
24+
callbacks.registerContextMenuFactory(new Menu(callbacks));
25+
stdout.println(getBanner());
26+
}
27+
28+
public String getBanner(){
29+
String bannerInfo =
30+
"[+]\n"
31+
+ "[+] #####################################\n"
32+
+ "[+] " + extensionName + " v" + version +"\n"
33+
+ "[+] anthor: c0ny1\n"
34+
+ "[+] email: [email protected]\n"
35+
+ "[+] github: http://github.com/c0ny1/HTTPHeadModifer\n"
36+
+ "[+] ####################################";
37+
return bannerInfo;
38+
}
39+
}
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
package burp;
2+
3+
/*
4+
* @(#)IBurpCollaboratorClientContext.java
5+
*
6+
* Copyright PortSwigger Ltd. All rights reserved.
7+
*
8+
* This code may be used to extend the functionality of Burp Suite Free Edition
9+
* and Burp Suite Professional, provided that this usage does not violate the
10+
* license terms for those products.
11+
*/
12+
import java.util.List;
13+
14+
/**
15+
* This interface represents an instance of a Burp Collaborator client context,
16+
* which can be used to generate Burp Collaborator payloads and poll the
17+
* Collaborator server for any network interactions that result from using those
18+
* payloads. Extensions can obtain new instances of this class by calling
19+
* <code>IBurpExtenderCallbacks.createBurpCollaboratorClientContext()</code>.
20+
* Note that each Burp Collaborator client context is tied to the Collaborator
21+
* server configuration that was in place at the time the context was created.
22+
*/
23+
public interface IBurpCollaboratorClientContext
24+
{
25+
26+
/**
27+
* This method is used to generate new Burp Collaborator payloads.
28+
*
29+
* @param includeCollaboratorServerLocation Specifies whether to include the
30+
* Collaborator server location in the generated payload.
31+
* @return The payload that was generated.
32+
*/
33+
String generatePayload(boolean includeCollaboratorServerLocation);
34+
35+
/**
36+
* This method is used to retrieve all interactions received by the
37+
* Collaborator server resulting from payloads that were generated for this
38+
* context.
39+
*
40+
* @return The Collaborator interactions that have occurred resulting from
41+
* payloads that were generated for this context.
42+
*/
43+
List<IBurpCollaboratorInteraction> fetchAllCollaboratorInteractions();
44+
45+
/**
46+
* This method is used to retrieve interactions received by the Collaborator
47+
* server resulting from a single payload that was generated for this
48+
* context.
49+
*
50+
* @param payload The payload for which interactions will be retrieved.
51+
* @return The Collaborator interactions that have occurred resulting from
52+
* the given payload.
53+
*/
54+
List<IBurpCollaboratorInteraction> fetchCollaboratorInteractionsFor(String payload);
55+
56+
/**
57+
* This method is used to retrieve the network location of the Collaborator
58+
* server.
59+
*
60+
* @return The hostname or IP address of the Collaborator server.
61+
*/
62+
String getCollaboratorServerLocation();
63+
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
package burp;
2+
3+
/*
4+
* @(#)IBurpCollaboratorInteraction.java
5+
*
6+
* Copyright PortSwigger Ltd. All rights reserved.
7+
*
8+
* This code may be used to extend the functionality of Burp Suite Free Edition
9+
* and Burp Suite Professional, provided that this usage does not violate the
10+
* license terms for those products.
11+
*/
12+
import java.util.Map;
13+
14+
/**
15+
* This interface represents a network interaction that occurred with the Burp
16+
* Collaborator server.
17+
*/
18+
public interface IBurpCollaboratorInteraction
19+
{
20+
21+
/**
22+
* This method is used to retrieve a property of the interaction. Properties
23+
* of all interactions are: interaction_id, type, client_ip, and time_stamp.
24+
* Properties of DNS interactions are: query_type and raw_query. The
25+
* raw_query value is Base64-encoded. Properties of HTTP interactions are:
26+
* protocol, request, and response. The request and response values are
27+
* Base64-encoded.
28+
*
29+
* @param name The name of the property to retrieve.
30+
* @return A string representing the property value, or null if not present.
31+
*/
32+
String getProperty(String name);
33+
34+
/**
35+
* This method is used to retrieve a map containing all properties of the
36+
* interaction.
37+
*
38+
* @return A map containing all properties of the interaction.
39+
*/
40+
Map<String, String> getProperties();
41+
}

src/burp/IBurpExtender.java

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
package burp;
2+
3+
/*
4+
* @(#)IBurpExtender.java
5+
*
6+
* Copyright PortSwigger Ltd. All rights reserved.
7+
*
8+
* This code may be used to extend the functionality of Burp Suite Free Edition
9+
* and Burp Suite Professional, provided that this usage does not violate the
10+
* license terms for those products.
11+
*/
12+
/**
13+
* All extensions must implement this interface.
14+
*
15+
* Implementations must be called BurpExtender, in the package burp, must be
16+
* declared public, and must provide a default (public, no-argument)
17+
* constructor.
18+
*/
19+
public interface IBurpExtender
20+
{
21+
/**
22+
* This method is invoked when the extension is loaded. It registers an
23+
* instance of the
24+
* <code>IBurpExtenderCallbacks</code> interface, providing methods that may
25+
* be invoked by the extension to perform various actions.
26+
*
27+
* @param callbacks An
28+
* <code>IBurpExtenderCallbacks</code> object.
29+
*/
30+
void registerExtenderCallbacks(IBurpExtenderCallbacks callbacks);
31+
}

0 commit comments

Comments
 (0)