eWPTXv3 - Notes
GitHubPortfolioTwitter/X MediumCont@ctHome
  • 📝eWPTXv3
    • Web Application Penetration Testing Methodology
      • 1.1 Introduction to Web App Security Testing
        • 1.1.1 Web Application
        • 1.1.2 Web App Architecture
        • 1.1.3 HTTP/HTTPS
      • 1.2 Web App Pentesting Methodology
    • Web Application Reconnaissance
      • 2.1 Information Gathering
        • 2.1.1 DNS Recon
          • 2.1.1.1 DNS Zone Transfer
          • 2.1.1.2 Subdomain Enumeration
        • 2.1.2 WAF Recon
      • 2.2 Passive Crawling & Spidering
      • 2.3 Web Server Fingerprinting
        • 2.3.1 File & Directory Brute-Force
      • 2.4 Web Proxies
        • 2.4.1 Burp Suite
        • 2.4.2 OWASP ZAP
    • Authentication Attacks
      • 6.1 HTTP Attacks
        • 6.1.1 HTTP Method Tampering
        • 6.1.2 Attacking HTTP Authentication
      • 6.2 Session Attacks
        • 6.2.1 Session Hijacking
        • 6.2.2 Session Fixation
        • 6.2.3 Session Hijacking via Cookie Tampering
      • 6.3 JWT Attacks
      • 6.4 CSRF
    • Injection Vulnerabilities
      • 4.1 Command Injection
      • 4.2 Cross-Site Scripting (XSS)
        • 4.2.1 XSS Anatomy
        • 4.2.2 Reflected XSS
        • 4.2.3 Stored XSS
        • 4.2.4 DOM-Based XSS
        • 4.2.5 Identifying & Exploiting XSS with XSSer
      • 4.3 ​SQL Injection (SQLi)
        • 4.3.1 DB & SQL Introduction
        • 4.3.2 SQL Injection (SQLi)
        • 4.3.3 In-Band SQLi
        • 4.3.4 Blind SQLi
        • 4.3.5 NoSQL
        • 4.3.6 SQLMap
        • 4.3.7 Mitigation Strategies
    • API Penetration Testing
      • 5.1 API Testing
    • Server-Side Attacks
      • 6.1 Server-side request forgery (SSRF)
      • 6.2 Deserialization
      • 6.3 ​File & Resource Attacks
        • 6.1 File Upload Vulnerability
        • 6.2 Directory Traversal
        • 6.3 File Inclusion (LFI and RFI)
          • 6.3.1 Local File Inclusion (LFI)
          • 6.3.2 Remote File Inclusion (RFI)
        • 6.4 CMS Pentesting
          • 6.4.1 Wordpress, Drupal & Magento
    • Filter Evasion & WAF Bypass
      • 7.1 Obfuscating attacks using encodings
    • 📄Report
      • How to write a PT Report
  • 🛣️RoadMap / Exam Preparation
  • 📔eWPTX Cheat Sheet
Powered by GitBook
On this page
  • Basic HTTP Authentication Attack
  • How Basic HTTP Authentication Work
  • Example (bWapp)
  • HTTP Digest Authentication Attack
  • How Basic HTTP Authentication Work
  • Example (bWapp)
  1. eWPTXv3
  2. Authentication Attacks
  3. 6.1 HTTP Attacks

6.1.2 Attacking HTTP Authentication

Previous6.1.1 HTTP Method TamperingNext6.2 Session Attacks

Basic HTTP Authentication Attack

Basic HTTP authentication is a simple authentication mechanism used by web app and services to restrict access to certain resources and functionalities.

It usually based on username and password combination, however, it's important to remember that basic HTTP authentication isn't secure when used over and unencrypted connection (HTTP).

It should only be used over HTTPS to ensure that the credentials are transmitted securely.

How Basic HTTP Authentication Work

When a client (usually web browser) makes a request to a protected resource on a server, the server responds with an Unauthorized status code (401) if the resource requires authentication.

The client constructs a string in the format username:password and encodes it in Base64, it includes this encoded string in an Authorization header.

In the response, the server includes a www-authenticate header with the value "Basic", it means that client has provides to access the resource.

When the server receives the request (with the authorization header), it decodes the Base64-encoded credentials, checks them against its database of authorized users and grants access if the credentials are valid (status code 200).

Example (bWapp)

Using burp suite intruder is possible to attack username and password values (present into authorization request (decoded in base 64)

to do brute force attack via dictionary payload password, in addition we can add a prefix (admin) and encode all in Base64:

If we discover password, we decode it using burp suite decoder Base64 to plaintext.

Of course, we can perform the same attack for the username and password using Cluster bomb attack in burp suite intruder.

HTTP Digest Authentication Attack

HTTP Digest Authentication is an authentication mechanism used in web apps and services to securely verify the identity of user that trying to access protected resources.

At difference of basic authentication, it has security limitations such as a challenge-response mechanism and hashing to protect user credentials during transmission.

It should only be used over HTTPS to ensure that the credentials are transmitted securely.

How Basic HTTP Authentication Work

When a client (usually web browser) makes a request to a protected resource on a server, the server responds with an Unauthorized status code (401) if the resource requires authentication.

The client constructs a response using the following components: username, realm, password, nonce, request URI, HTTP, method, cnonce, qop, hashes (1 and 2).

In the response, the server receives the request with the authorization header and validates the response hash calculated by the client. If the hashes match, the server considers the client authenticated and grants access to the requested resource.

Example (bWapp)

Using burp suite intruder is possible to capture http digest authentication.

We can perform brute force attack for password using a dictionary and inserting: username value, <Target_IP>, method (http-get) and uri value (/digest/)

hydra -l admin -P wordlist/100-common-passwords.txt <Target_IP> http-get /digest/

and login with credentials found.

📝