Skip to content

Commit cc4a84d

Browse files
committed
v0.1.0
0 parents  commit cc4a84d

Some content is hidden

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

55 files changed

+4374
-0
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.idea
2+
out/*

BitTraversal.iml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<module type="JAVA_MODULE" version="4">
3+
<component name="NewModuleRootManager" inherit-compiler-output="true">
4+
<exclude-output />
5+
<content url="file://$MODULE_DIR$">
6+
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
7+
</content>
8+
<orderEntry type="inheritedJdk" />
9+
<orderEntry type="sourceFolder" forTests="false" />
10+
</component>
11+
</module>

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# BitTraversal - in development
2+
3+
Recursive Directory Traversal Scanner

list/payloads.list

Whitespace-only changes.

list/regex.list

Whitespace-only changes.

src/META-INF/MANIFEST.MF

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Manifest-Version: 1.0
2+
Main-Class: burp.BurpExtender
3+

src/burp/BurpExtender.java

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
package burp;
2+
3+
import scanner.Executor;
4+
import utils.UrlUtils;
5+
6+
import java.io.IOException;
7+
import java.io.PrintWriter;
8+
import java.net.MalformedURLException;
9+
import java.net.URISyntaxException;
10+
import java.net.URL;
11+
12+
public class BurpExtender implements burp.IBurpExtender, burp.IHttpListener
13+
{
14+
public static PrintWriter stdout;
15+
public static PrintWriter stderr;
16+
public static burp.IExtensionHelpers helpers;
17+
public static IBurpExtenderCallbacks callbacks;
18+
19+
@Override
20+
public void registerExtenderCallbacks(IBurpExtenderCallbacks callbacks)
21+
{
22+
BurpExtender.callbacks = callbacks;
23+
callbacks.setExtensionName("Bit/Traversal");
24+
25+
stdout = new PrintWriter(callbacks.getStdout(), true);
26+
stderr = new PrintWriter(callbacks.getStderr(),true);
27+
helpers = callbacks.getHelpers();
28+
stdout.println("0.1v - loaded");
29+
30+
callbacks.registerHttpListener(this);
31+
}
32+
33+
34+
@Override
35+
public void processHttpMessage(int toolFlag, boolean messageIsRequest, burp.IHttpRequestResponse messageInfo) throws IOException, URISyntaxException {
36+
if (!messageIsRequest)
37+
return;
38+
new Executor().Scan(messageInfo);
39+
}
40+
}
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
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 Community 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+
* @throws IllegalStateException if Burp Collaborator is disabled
34+
*/
35+
String generatePayload(boolean includeCollaboratorServerLocation);
36+
37+
/**
38+
* This method is used to retrieve all interactions received by the
39+
* Collaborator server resulting from payloads that were generated for this
40+
* context.
41+
*
42+
* @return The Collaborator interactions that have occurred resulting from
43+
* payloads that were generated for this context.
44+
*
45+
* @throws IllegalStateException if Burp Collaborator is disabled
46+
*/
47+
List<IBurpCollaboratorInteraction> fetchAllCollaboratorInteractions();
48+
49+
/**
50+
* This method is used to retrieve interactions received by the Collaborator
51+
* server resulting from a single payload that was generated for this
52+
* context.
53+
*
54+
* @param payload The payload for which interactions will be retrieved.
55+
* @return The Collaborator interactions that have occurred resulting from
56+
* the given payload.
57+
*
58+
* @throws IllegalStateException if Burp Collaborator is disabled
59+
*/
60+
List<IBurpCollaboratorInteraction> fetchCollaboratorInteractionsFor(String payload);
61+
62+
/**
63+
* This method is used to retrieve all interactions made by Burp Infiltrator
64+
* instrumentation resulting from payloads that were generated for this
65+
* context.
66+
*
67+
* @return The interactions triggered by the Burp Infiltrator
68+
* instrumentation that have occurred resulting from payloads that were
69+
* generated for this context.
70+
*
71+
* @throws IllegalStateException if Burp Collaborator is disabled
72+
*/
73+
List<IBurpCollaboratorInteraction> fetchAllInfiltratorInteractions();
74+
75+
/**
76+
* This method is used to retrieve interactions made by Burp Infiltrator
77+
* instrumentation resulting from a single payload that was generated for
78+
* this context.
79+
*
80+
* @param payload The payload for which interactions will be retrieved.
81+
* @return The interactions triggered by the Burp Infiltrator
82+
* instrumentation that have occurred resulting from the given payload.
83+
*
84+
* @throws IllegalStateException if Burp Collaborator is disabled
85+
*/
86+
List<IBurpCollaboratorInteraction> fetchInfiltratorInteractionsFor(String payload);
87+
88+
/**
89+
* This method is used to retrieve the network location of the Collaborator
90+
* server.
91+
*
92+
* @return The hostname or IP address of the Collaborator server.
93+
*
94+
* @throws IllegalStateException if Burp Collaborator is disabled
95+
*/
96+
String getCollaboratorServerLocation();
97+
}
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 Community 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 Community 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)