Created
          October 16, 2025 13:24 
        
      - 
      
- 
        Save albinowax/2814ce731643791fabbcfe4d319e298b to your computer and use it in GitHub Desktop. 
    Connection state attack Custom Action for Burp Repeater
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | // For context check out https://portswigger.net/web-security/host-header/exploiting#connection-state-attacks | |
| var connectionId = utilities().randomUtils().randomString(8); | |
| var options = RequestOptions.requestOptions().withConnectionId(connectionId).withHttpMode(HttpMode.HTTP_1); | |
| // Send a simple GET / HTTP/1.1 to the target as the precusor request | |
| var url = requestResponse.request().url(); | |
| var precursorRequest = HttpRequest.httpRequestFromUrl(url); | |
| precursorRequest = precursorRequest.withPath("/").withHeader("Connection", "keep-alive"); | |
| // Send the attack in the repeater, and update the response pane | |
| api().http().sendRequest(precursorRequest, options); | |
| var response = api().http().sendRequest(requestResponse.request(), options); | |
| httpEditor.responsePane().set(response.response().toByteArray()); | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment