emonti-buby 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/History.txt +4 -0
- data/README.rdoc +278 -0
- data/Rakefile +33 -0
- data/bin/buby +16 -0
- data/buby.gemspec +37 -0
- data/java/buby.jar +0 -0
- data/java/src/BurpExtender.java +247 -0
- data/java/src/burp/IBurpExtender.java +136 -0
- data/java/src/burp/IBurpExtenderCallbacks.java +157 -0
- data/lib/buby.rb +462 -0
- data/samples/basic.rb +42 -0
- data/spec/buby_spec.rb +7 -0
- data/spec/spec_helper.rb +16 -0
- data/tasks/ann.rake +80 -0
- data/tasks/bones.rake +20 -0
- data/tasks/gem.rake +201 -0
- data/tasks/git.rake +40 -0
- data/tasks/notes.rake +27 -0
- data/tasks/post_load.rake +34 -0
- data/tasks/rdoc.rake +51 -0
- data/tasks/rubyforge.rake +55 -0
- data/tasks/setup.rb +292 -0
- data/tasks/spec.rake +54 -0
- data/tasks/svn.rake +47 -0
- data/tasks/test.rake +40 -0
- data/tasks/zentest.rake +36 -0
- data/test/test_buby.rb +0 -0
- metadata +92 -0
@@ -0,0 +1,136 @@
|
|
1
|
+
package burp;
|
2
|
+
|
3
|
+
/*
|
4
|
+
* @(#)IBurpExtender.java
|
5
|
+
*
|
6
|
+
* Copyright 2008 PortSwigger Ltd. All rights reserved.
|
7
|
+
* Use is subject to license terms - see http://portswigger.net/
|
8
|
+
*/
|
9
|
+
|
10
|
+
/**
|
11
|
+
* This interface allows third-party code to extend Burp Suite's functionality.
|
12
|
+
*
|
13
|
+
* Implementations must be called BurpExtender, in the package burp,
|
14
|
+
* must be declared public, and must provide a default (public, no-argument)
|
15
|
+
* constructor. On startup, Burp Suite searches its classpath for the class
|
16
|
+
* burp.BurpExtender, and attempts to dynamically load and instantiate this
|
17
|
+
* class. The <code>IBurpExtender</code> methods implemented will then be
|
18
|
+
* dynamically invoked as appropriate.<p>
|
19
|
+
*
|
20
|
+
* Partial implementations are acceptable. The class will be used provided at
|
21
|
+
* least one of the interface's methods is implemented.<p>
|
22
|
+
*
|
23
|
+
* To make use of the interface, create a class called BurpExtender, in the
|
24
|
+
* package burp, which implements one or more methods of the interface, and
|
25
|
+
* place this into the application's classpath at startup. For example, if
|
26
|
+
* Burp Suite is loaded from burp.jar, and BurpProxyExtender.jar contains the
|
27
|
+
* class burp.BurpExtender, use the following command to launch Burp Suite and
|
28
|
+
* load the IBurpExtender implementation:<p>
|
29
|
+
*
|
30
|
+
* <PRE>
|
31
|
+
* java -classpath burp.jar;BurpProxyExtender.jar burp.StartBurp
|
32
|
+
* </PRE>
|
33
|
+
*/
|
34
|
+
|
35
|
+
public interface IBurpExtender
|
36
|
+
{
|
37
|
+
/**
|
38
|
+
* This method is invoked immediately after the implementation's constructor
|
39
|
+
* to pass any command-line arguments that were passed to Burp Suite on
|
40
|
+
* startup. It allows implementations to control aspects of their behaviour
|
41
|
+
* at runtime by defining their own command-line arguments.
|
42
|
+
*
|
43
|
+
* @param args The command-line arguments passed to Burp Suite on startup.
|
44
|
+
*/
|
45
|
+
public void setCommandLineArgs(String[] args);
|
46
|
+
|
47
|
+
|
48
|
+
/**
|
49
|
+
* This method is invoked by Burp Proxy whenever a client request or server
|
50
|
+
* response is received. It allows implementations to perform logging
|
51
|
+
* functions, modify the message, specify an action (intercept, drop, etc.)
|
52
|
+
* and perform any other arbitrary processing.
|
53
|
+
*
|
54
|
+
* @param messageReference An identifier which is unique to a single
|
55
|
+
* request/response pair. This can be used to correlate details of requests
|
56
|
+
* and responses and perform processing on the response message accordingly.
|
57
|
+
* @param messageIsRequest Flags whether the message is a client request or
|
58
|
+
* a server response.
|
59
|
+
* @param remoteHost The hostname of the remote HTTP server.
|
60
|
+
* @param remotePort The port of the remote HTTP server.
|
61
|
+
* @param serviceIsHttps Flags whether the protocol is HTTPS or HTTP.
|
62
|
+
* @param httpMethod The method verb used in the client request.
|
63
|
+
* @param url The requested URL.
|
64
|
+
* @param resourceType The filetype of the requested resource, or a
|
65
|
+
* zero-length string if the resource has no filetype.
|
66
|
+
* @param statusCode The HTTP status code returned by the server. This value
|
67
|
+
* is <code>null</code> for request messages.
|
68
|
+
* @param responseContentType The content-type string returned by the
|
69
|
+
* server. This value is <code>null</code> for request messages.
|
70
|
+
* @param message The full HTTP message.
|
71
|
+
* @param action An array containing a single integer, allowing the
|
72
|
+
* implementation to communicate back to Burp Proxy a non-default
|
73
|
+
* interception action for the message. The default value is
|
74
|
+
* <code>ACTION_FOLLOW_RULES</code>. Set <code>action[0]</code> to one of
|
75
|
+
* the other possible values to perform a different action.
|
76
|
+
* @return Implementations should return either (a) the same object received
|
77
|
+
* in the <code>message</code> paramater, or (b) a different object
|
78
|
+
* containing a modified message.
|
79
|
+
*/
|
80
|
+
public byte[] processProxyMessage(
|
81
|
+
int messageReference,
|
82
|
+
boolean messageIsRequest,
|
83
|
+
String remoteHost,
|
84
|
+
int remotePort,
|
85
|
+
boolean serviceIsHttps,
|
86
|
+
String httpMethod,
|
87
|
+
String url,
|
88
|
+
String resourceType,
|
89
|
+
String statusCode,
|
90
|
+
String responseContentType,
|
91
|
+
byte[] message,
|
92
|
+
int[] action);
|
93
|
+
|
94
|
+
/**
|
95
|
+
* Causes Burp Proxy to follow the current interception rules to determine
|
96
|
+
* the appropriate action to take for the message.
|
97
|
+
*/
|
98
|
+
public final static int ACTION_FOLLOW_RULES = 0;
|
99
|
+
/**
|
100
|
+
* Causes Burp Proxy to present the message to the user for manual
|
101
|
+
* review or modification.
|
102
|
+
*/
|
103
|
+
public final static int ACTION_DO_INTERCEPT = 1;
|
104
|
+
/**
|
105
|
+
* Causes Burp Proxy to forward the message to the remote server or client.
|
106
|
+
*/
|
107
|
+
public final static int ACTION_DONT_INTERCEPT = 2;
|
108
|
+
/**
|
109
|
+
* Causes Burp Proxy to drop the message and close the client connection.
|
110
|
+
*/
|
111
|
+
public final static int ACTION_DROP = 3;
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
/**
|
116
|
+
* This method is invoked on startup. It registers an instance of the
|
117
|
+
* <code>IBurpExtenderCallbacks</code> interface, providing methods that
|
118
|
+
* may be invoked by the implementation to perform various actions.
|
119
|
+
*
|
120
|
+
* The call to registerExtenderCallbacks need not return, and
|
121
|
+
* implementations may use the invoking thread for any purpose.<p>
|
122
|
+
*
|
123
|
+
* @param callbacks An implementation of the
|
124
|
+
* <code>IBurpExtenderCallbacks</code> interface.
|
125
|
+
*/
|
126
|
+
public void registerExtenderCallbacks(burp.IBurpExtenderCallbacks callbacks);
|
127
|
+
|
128
|
+
|
129
|
+
|
130
|
+
/**
|
131
|
+
* This method is invoked immediately before Burp Suite exits.
|
132
|
+
* It allows implementations to carry out any clean-up actions necessary
|
133
|
+
* (e.g. flushing log files or closing database resources).
|
134
|
+
*/
|
135
|
+
public void applicationClosing();
|
136
|
+
}
|
@@ -0,0 +1,157 @@
|
|
1
|
+
package burp;
|
2
|
+
|
3
|
+
/*
|
4
|
+
* @(#)IBurpExtenderCallbacks.java
|
5
|
+
*
|
6
|
+
* Copyright 2008 PortSwigger Ltd. All rights reserved.
|
7
|
+
* Use is subject to license terms - see http://portswigger.net/
|
8
|
+
*/
|
9
|
+
|
10
|
+
/**
|
11
|
+
* This interface is used by Burp Suite to pass to implementations of the
|
12
|
+
* <code>IBurpExtender</code> interface a set of callback methods which can
|
13
|
+
* be used by implementations to perform various actions within Burp Suite.
|
14
|
+
*
|
15
|
+
* If an implementation of <code>IBurpExtender</code> is loaded then on startup
|
16
|
+
* Burp Suite will invoke the implementation's
|
17
|
+
* <code>registerExtenderCallbacks</code> method (if present) and pass to
|
18
|
+
* the implementation an instance of the <code>IBurpExtenderCallbacks</code>
|
19
|
+
* interface. The implementation may then invoke the methods of this instance
|
20
|
+
* as it sees fit in order to extend Burp Suite's functionality.<p>
|
21
|
+
*/
|
22
|
+
|
23
|
+
public interface IBurpExtenderCallbacks
|
24
|
+
{
|
25
|
+
/**
|
26
|
+
* This method can be used to issue arbitrary HTTP requests and retrieve
|
27
|
+
* their responses.
|
28
|
+
*
|
29
|
+
* @param host The hostname of the remote HTTP server.
|
30
|
+
* @param port The port of the remote HTTP server.
|
31
|
+
* @param useHttps Flags whether the protocol is HTTPS or HTTP.
|
32
|
+
* @param request The full HTTP request.
|
33
|
+
* @return The full response retrieved from the remote server.
|
34
|
+
*/
|
35
|
+
public byte[] makeHttpRequest(
|
36
|
+
String host,
|
37
|
+
int port,
|
38
|
+
boolean useHttps,
|
39
|
+
byte[] request) throws Exception;
|
40
|
+
|
41
|
+
/**
|
42
|
+
* This method can be used to send an HTTP request to the Burp Repeater
|
43
|
+
* tool. The request will be displayed in the user interface, but will not
|
44
|
+
* be issued until the user initiates this action.
|
45
|
+
*
|
46
|
+
* @param host The hostname of the remote HTTP server.
|
47
|
+
* @param port The port of the remote HTTP server.
|
48
|
+
* @param useHttps Flags whether the protocol is HTTPS or HTTP.
|
49
|
+
* @param request The full HTTP request.
|
50
|
+
* @param tabCaption An optional caption which will appear on the Repeater
|
51
|
+
* tab containing the request. If this value is <code>null</code> then a
|
52
|
+
* default tab index will be displayed.
|
53
|
+
*/
|
54
|
+
public void sendToRepeater(
|
55
|
+
String host,
|
56
|
+
int port,
|
57
|
+
boolean useHttps,
|
58
|
+
byte[] request,
|
59
|
+
String tabCaption) throws Exception;
|
60
|
+
|
61
|
+
/**
|
62
|
+
* This method can be used to send an HTTP request to the Burp Intruder
|
63
|
+
* tool. The request will be displayed in the user interface, and markers
|
64
|
+
* for attack payloads will be placed into default locations within the
|
65
|
+
* request.
|
66
|
+
*
|
67
|
+
* @param host The hostname of the remote HTTP server.
|
68
|
+
* @param port The port of the remote HTTP server.
|
69
|
+
* @param useHttps Flags whether the protocol is HTTPS or HTTP.
|
70
|
+
* @param request The full HTTP request.
|
71
|
+
*/
|
72
|
+
public void sendToIntruder(
|
73
|
+
String host,
|
74
|
+
int port,
|
75
|
+
boolean useHttps,
|
76
|
+
byte[] request) throws Exception;
|
77
|
+
|
78
|
+
/**
|
79
|
+
* This method can be used to send a seed URL to the Burp Spider tool. If
|
80
|
+
* the URL is not within the current Spider scope, the user will be asked
|
81
|
+
* if they wish to add the URL to the scope. If the Spider is not currently
|
82
|
+
* running, it will be started. The seed URL will be requested, and the
|
83
|
+
* Spider will process the application's response in the normal way.
|
84
|
+
*
|
85
|
+
* @param url The new seed URL to begin spidering from.
|
86
|
+
*/
|
87
|
+
public void sendToSpider(
|
88
|
+
java.net.URL url) throws Exception;
|
89
|
+
|
90
|
+
/**
|
91
|
+
* This method can be used to send an HTTP request to the Burp Scanner
|
92
|
+
* tool to perform an active vulnerability scan. If the request is not
|
93
|
+
* within the current active scanning scope, the user will be asked if
|
94
|
+
* they wish to proceed with the scan.
|
95
|
+
*
|
96
|
+
* @param host The hostname of the remote HTTP server.
|
97
|
+
* @param port The port of the remote HTTP server.
|
98
|
+
* @param useHttps Flags whether the protocol is HTTPS or HTTP.
|
99
|
+
* @param request The full HTTP request.
|
100
|
+
*/
|
101
|
+
public void doActiveScan(
|
102
|
+
String host,
|
103
|
+
int port,
|
104
|
+
boolean useHttps,
|
105
|
+
byte[] request) throws Exception;
|
106
|
+
|
107
|
+
/**
|
108
|
+
* This method can be used to send an HTTP request to the Burp Scanner
|
109
|
+
* tool to perform a passive vulnerability scan.
|
110
|
+
*
|
111
|
+
* @param host The hostname of the remote HTTP server.
|
112
|
+
* @param port The port of the remote HTTP server.
|
113
|
+
* @param useHttps Flags whether the protocol is HTTPS or HTTP.
|
114
|
+
* @param request The full HTTP request.
|
115
|
+
* @param response The full HTTP response.
|
116
|
+
*/
|
117
|
+
public void doPassiveScan(
|
118
|
+
String host,
|
119
|
+
int port,
|
120
|
+
boolean useHttps,
|
121
|
+
byte[] request,
|
122
|
+
byte[] response) throws Exception;
|
123
|
+
|
124
|
+
/**
|
125
|
+
* This method can be used to query whether a specified URL is within
|
126
|
+
* the current Suite-wide scope.
|
127
|
+
*
|
128
|
+
* @param url The URL to query.
|
129
|
+
* @return Returns <code>true</code> if the URL is within the current
|
130
|
+
* Suite-wide scope.
|
131
|
+
*/
|
132
|
+
boolean isInScope(java.net.URL url) throws Exception;
|
133
|
+
|
134
|
+
/**
|
135
|
+
* This method can be used to include the specified URL in the Suite-wide
|
136
|
+
* scope.
|
137
|
+
*
|
138
|
+
* @param url The URL to include in the Suite-wide scope.
|
139
|
+
*/
|
140
|
+
void includeInScope(java.net.URL url) throws Exception;
|
141
|
+
|
142
|
+
/**
|
143
|
+
* This method can be used to exclude the specified URL from the Suite-wide
|
144
|
+
* scope.
|
145
|
+
*
|
146
|
+
* @param url The URL to exclude from the Suite-wide scope.
|
147
|
+
*/
|
148
|
+
void excludeFromScope(java.net.URL url) throws Exception;
|
149
|
+
|
150
|
+
/**
|
151
|
+
* This method can be used to display a specified message in the Burp
|
152
|
+
* Suite alerts tab.
|
153
|
+
*
|
154
|
+
* @param message The alert message to display.
|
155
|
+
*/
|
156
|
+
public void issueAlert(String message);
|
157
|
+
}
|