Skip to content

Commit ba2eae3

Browse files
Add BypassFirstRequestValidation (#151)
1 parent 1ccbcd9 commit ba2eae3

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
id: 996d9f0d-1113-46c1-b731-4e6918013604
2+
name: Bypass first-request validation
3+
function: CUSTOM_ACTION
4+
location: REPEATER
5+
source: |
6+
/**
7+
* This hides your repeater request behind an innocent GET request. It's useful for bypassing server-level validation sometimes.
8+
*
9+
* @author James Kettle (https://github.com/albinowax)
10+
*
11+
* Try it out on the Academy lab here: https://portswigger.net/web-security/host-header/exploiting#connection-state-attacks
12+
*
13+
**/
14+
var connectionId = utilities().randomUtils().randomString(8);
15+
var options = RequestOptions.requestOptions().withConnectionId(connectionId).withHttpMode(HttpMode.HTTP_1);
16+
17+
// Send a simple GET / HTTP/1.1 to the target as the precusor request
18+
var url = requestResponse.request().url();
19+
var precursorRequest = HttpRequest.httpRequestFromUrl(url);
20+
precursorRequest = precursorRequest.withPath("/").withHeader("Connection", "keep-alive");
21+
22+
// Send the attack in the repeater, and update the response pane
23+
api().http().sendRequest(precursorRequest, options);
24+
var response = api().http().sendRequest(requestResponse.request(), options);
25+
httpEditor.responsePane().set(response.response().toByteArray());
26+

0 commit comments

Comments
 (0)