HTTP Verb Tampering

βš”οΈ Web Server Exploitation: Exploiting HTTP methods to bypass authentication and security controls

Overview

HTTP Verb Tampering attacks exploit web servers that accept many HTTP verbs and methods. These attacks can bypass web application authorization mechanisms or security controls by sending malicious requests using unexpected HTTP methods.

Attack Types:

  • Insecure Web Server Configurations - Bypass HTTP Basic Authentication

  • Insecure Application Coding - Bypass security filters and access controls


1. Bypassing Basic Authentication

Attack Scenario

Target: Web applications with HTTP Basic Authentication protecting admin functionality

Common Vulnerable Setup:

/admin/          ← Protected directory (401 Unauthorized)
/admin/reset.php ← Reset functionality behind auth

Identification Phase

Step 1: Discover Protected Resources

Step 2: Identify Supported HTTP Methods

Exploitation Techniques

Method 1: HEAD Request Bypass

Theory: HEAD requests often bypass authentication while still executing server-side code

Method 2: Alternative HTTP Methods

Testing different verbs:

Burp Suite Methodology

Step 1: Intercept Original Request

Step 2: Change Request Method

  • Right-click intercepted request β†’ "Change Request Method"

  • Manually edit: GET β†’ HEAD or other method

Step 3: Forward and Observe

  • Monitor response codes

  • Check if functionality executed (empty response = success for HEAD)


2. Bypassing Security Filters

Attack Scenario

Target: Web applications with security filters that only check specific HTTP methods

Common Vulnerable Setup:

Vulnerability Background

Insecure Coding Patterns:

  • Security filters only check $_POST parameters

  • Injection detection limited to specific HTTP methods

  • Inconsistent input validation across methods

  • Missing cross-method security controls

Identification Phase

Step 1: Trigger Security Filter

Step 2: Test Different HTTP Methods

Exploitation Techniques

Method 1: POST to GET Conversion

Scenario: File upload form with injection protection

Original Request (Blocked):

Response: Malicious Request Denied!

Bypass Request (Successful):

Response: File created with special characters

Method 2: Command Injection Exploitation

Test Payload: Create two files to confirm injection

Verification: Check if both file1 and file2 were created

Burp Suite Exploitation

Step 1: Capture Original POST Request

Step 2: Convert POST to GET

  • Right-click β†’ "Change Request Method"

  • Parameters automatically move to URL query string

  • Forward modified request

Step 3: Escalate to Command Injection


HTB Academy Lab Solutions

Lab: File Manager Authentication Bypass

Target: http://94.237.50.221:38391

Objective: Access /admin/reset.php without credentials to delete all files

Step-by-Step Solution:

1. Initial Reconnaissance

2. Enumerate HTTP Methods

3. Bypass with HEAD Request

4. Verification

🎯 Flag: HTB{...}

Lab 2: Command Injection Filter Bypass

Target: http://94.237.57.115:43846

Objective: Bypass security filter and execute command: file; cp /flag.txt ./

Step-by-Step Solution:

1. Test Security Filter

2. Bypass Filter with GET Method

3. Execute Command Injection

4. Verification

Alternative Burp Method:

  1. Intercept POST request with payload: filename=file; cp /flag.txt ./

  2. Right-click β†’ "Change Request Method" β†’ Convert to GET

  3. Forward request

  4. Access http://94.237.57.115:43846/flag.txt to retrieve flag


Common HTTP Methods for Testing

Standard Methods

Extended Methods


Automated Testing

Custom Script for Method Testing

Usage:

Burp Suite Intruder

Setup:

  1. Send request to Intruder

  2. Set position on HTTP method

  3. Payload list: GET, POST, HEAD, PUT, DELETE, PATCH, OPTIONS

  4. Start attack and analyze response codes


Vulnerable Code Examples

PHP - Insecure Authentication Handling

PHP - Insecure Security Filter

Secure Implementation


Prevention & Hardening

Web Server Configuration

Apache (.htaccess)

Nginx

Application-Level Controls

Comprehensive Method Checking:


Detection & Monitoring

Log Analysis

Security Headers


HTTP Verb Tampering attacks highlight the importance of comprehensive method validation and consistent security controls across all HTTP verbs.

Last updated