public interface IExtensionHelpers
IBurpExtenderCallbacks.getHelpers
to obtain an instance of this
interface.Modifier and Type | Method and Description |
---|---|
byte[] |
addParameter(byte[] request,
IParameter parameter)
This method adds a new parameter to an HTTP request, and if appropriate
updates the Content-Length header.
|
IRequestInfo |
analyzeRequest(byte[] request)
This method can be used to analyze an HTTP request, and obtain various
key details about it.
|
IRequestInfo |
analyzeRequest(IHttpRequestResponse request)
This method can be used to analyze an HTTP request, and obtain various
key details about it.
|
IRequestInfo |
analyzeRequest(IHttpService httpService,
byte[] request)
This method can be used to analyze an HTTP request, and obtain various
key details about it.
|
IResponseInfo |
analyzeResponse(byte[] response)
This method can be used to analyze an HTTP response, and obtain various
key details about it.
|
byte[] |
base64Decode(byte[] data)
This method can be used to Base64-decode the specified data.
|
byte[] |
base64Decode(java.lang.String data)
This method can be used to Base64-decode the specified data.
|
java.lang.String |
base64Encode(byte[] data)
This method can be used to Base64-encode the specified data.
|
java.lang.String |
base64Encode(java.lang.String data)
This method can be used to Base64-encode the specified data.
|
byte[] |
buildHttpMessage(java.util.List<java.lang.String> headers,
byte[] body)
This method builds an HTTP message containing the specified headers and
message body.
|
byte[] |
buildHttpRequest(java.net.URL url)
This method creates a GET request to the specified URL.
|
IHttpService |
buildHttpService(java.lang.String host,
int port,
boolean useHttps)
This method constructs an
IHttpService object based on the details provided. |
IHttpService |
buildHttpService(java.lang.String host,
int port,
java.lang.String protocol)
This method constructs an
IHttpService object based on the details provided. |
IParameter |
buildParameter(java.lang.String name,
java.lang.String value,
byte type)
This method constructs an
IParameter object based on the details provided. |
java.lang.String |
bytesToString(byte[] data)
This method can be used to convert data from an array of bytes into
String form.
|
IParameter |
getRequestParameter(byte[] request,
java.lang.String parameterName)
This method can be used to retrieve details of a specified parameter
within an HTTP request.
|
int |
indexOf(byte[] data,
byte[] pattern,
boolean caseSensitive,
int from,
int to)
This method searches a piece of data for the first occurrence of a
specified pattern.
|
IScannerInsertionPoint |
makeScannerInsertionPoint(java.lang.String insertionPointName,
byte[] baseRequest,
int from,
int to)
This method constructs an
IScannerInsertionPoint object based on the details provided. |
byte[] |
removeParameter(byte[] request,
IParameter parameter)
This method removes a parameter from an HTTP request, and if appropriate
updates the Content-Length header.
|
byte[] |
stringToBytes(java.lang.String data)
This method can be used to convert data from String form into an array of
bytes.
|
byte[] |
toggleRequestMethod(byte[] request)
This method can be used to toggle a request's method between GET and
POST.
|
byte[] |
updateParameter(byte[] request,
IParameter parameter)
This method updates the value of a parameter within an HTTP request, and
if appropriate updates the Content-Length header.
|
byte[] |
urlDecode(byte[] data)
This method can be used to URL-decode the specified data.
|
java.lang.String |
urlDecode(java.lang.String data)
This method can be used to URL-decode the specified data.
|
byte[] |
urlEncode(byte[] data)
This method can be used to URL-encode the specified data.
|
java.lang.String |
urlEncode(java.lang.String data)
This method can be used to URL-encode the specified data.
|
IRequestInfo analyzeRequest(IHttpRequestResponse request)
request
- An
IHttpRequestResponse
object containing the request to be
analyzed.IRequestInfo
object that can be queried to obtain details
about the request.IRequestInfo analyzeRequest(IHttpService httpService, byte[] request)
httpService
- The HTTP service associated with the request. This is
optional and may be
null
, in which case the resulting
IRequestInfo
object will not include the full request URL.request
- The request to be analyzed.IRequestInfo
object that can be queried to obtain details
about the request.IRequestInfo analyzeRequest(byte[] request)
IRequestInfo
object will not include the full request URL.
To obtain the full URL, use one of the other overloaded
analyzeRequest()
methods.request
- The request to be analyzed.IRequestInfo
object that can be queried to obtain details
about the request.IResponseInfo analyzeResponse(byte[] response)
response
- The response to be analyzed.IResponseInfo
object that can be queried to obtain details
about the response.IParameter getRequestParameter(byte[] request, java.lang.String parameterName)
analyzeRequest()
to obtain details of all parameters within
the request.request
- The request to be inspected for the specified parameter.parameterName
- The name of the parameter to retrieve.IParameter
object that can be queried to obtain details
about the parameter, or
null
if the parameter was not found.java.lang.String urlDecode(java.lang.String data)
data
- The data to be decoded.java.lang.String urlEncode(java.lang.String data)
data
- The data to be encoded.byte[] urlDecode(byte[] data)
data
- The data to be decoded.byte[] urlEncode(byte[] data)
data
- The data to be encoded.byte[] base64Decode(java.lang.String data)
data
- The data to be decoded.byte[] base64Decode(byte[] data)
data
- The data to be decoded.java.lang.String base64Encode(java.lang.String data)
data
- The data to be encoded.java.lang.String base64Encode(byte[] data)
data
- The data to be encoded.byte[] stringToBytes(java.lang.String data)
bytesToString()
, and byte-based data that is converted to a
String and back again using these two methods is guaranteed to retain its
integrity (which may not be the case with conversions that reflect a
given character set).data
- The data to be converted.java.lang.String bytesToString(byte[] data)
stringToBytes()
, and byte-based data that is converted to a
String and back again using these two methods is guaranteed to retain its
integrity (which may not be the case with conversions that reflect a
given character set).data
- The data to be converted.int indexOf(byte[] data, byte[] pattern, boolean caseSensitive, int from, int to)
String.indexOf()
works on String-based data.data
- The data to be searched.pattern
- The pattern to be searched for.caseSensitive
- Flags whether or not the search is case-sensitive.from
- The offset within
data
where the search should begin.to
- The offset within
data
where the search should end.byte[] buildHttpMessage(java.util.List<java.lang.String> headers, byte[] body)
headers
- A list of headers to include in the message.body
- The body of the message, of
null
if the message has an empty body.byte[] buildHttpRequest(java.net.URL url)
url
- The URL to which the request should be made.byte[] addParameter(byte[] request, IParameter parameter)
request
- The request to which the parameter should be added.parameter
- An
IParameter
object containing details of the parameter to be
added. Supported parameter types are:
PARAM_URL
,
PARAM_BODY
and
PARAM_COOKIE
.byte[] removeParameter(byte[] request, IParameter parameter)
request
- The request from which the parameter should be removed.parameter
- An
IParameter
object containing details of the parameter to be
removed. Supported parameter types are:
PARAM_URL
,
PARAM_BODY
and
PARAM_COOKIE
.byte[] updateParameter(byte[] request, IParameter parameter)
removeParameter()
to remove the parameter with the old type,
and then call
addParameter()
to add a parameter with the new type.request
- The request containing the parameter to be updated.parameter
- An
IParameter
object containing details of the parameter to be
updated. Supported parameter types are:
PARAM_URL
,
PARAM_BODY
and
PARAM_COOKIE
.byte[] toggleRequestMethod(byte[] request)
request
- The HTTP request whose method should be toggled.IHttpService buildHttpService(java.lang.String host, int port, java.lang.String protocol)
IHttpService
object based on the details provided.host
- The HTTP service host.port
- The HTTP service port.protocol
- The HTTP service protocol.IHttpService
object based on the details provided.IHttpService buildHttpService(java.lang.String host, int port, boolean useHttps)
IHttpService
object based on the details provided.host
- The HTTP service host.port
- The HTTP service port.useHttps
- Flags whether the HTTP service protocol is HTTPS or HTTP.IHttpService
object based on the details provided.IParameter buildParameter(java.lang.String name, java.lang.String value, byte type)
IParameter
object based on the details provided.name
- The parameter name.value
- The parameter value.type
- The parameter type, as defined in the
IParameter
interface.IParameter
object based on the details provided.IScannerInsertionPoint makeScannerInsertionPoint(java.lang.String insertionPointName, byte[] baseRequest, int from, int to)
IScannerInsertionPoint
object based on the details provided.
It can be used to quickly create a simple insertion point based on a
fixed payload location within a base request.insertionPointName
- The name of the insertion point.baseRequest
- The request from which to build scan requests.from
- The offset of the start of the payload location.to
- The offset of the end of the payload location.IScannerInsertionPoint
object based on the details provided.