---
title: "2. Basic HTTP Auth bruteforce"
date: 2024-09-25
draft: false
---

The HTTP specification provides two parallel authentication mechanisms:

1. `Basic HTTP AUTH` is used to authenticate the user to the HTTP server.
2. `Proxy Server Authentication` is used to authenticate the user to an intermediate proxy server.

Basic HTTP auth scheme uses userID and password for authentication 
- Client sends request without auth info as first request
- Server response contains `WWW-Authenticate` header field, requesting credentials 
	- Header defines details of auth process as well
- Client asked to submit auth
- Response - Server transmits `realm` - char string telling client who is requesting the data
- Client uses b64 method for encoding identifier and password. Encoded character string transmitted to server in Authorization header field. 

![](/img/Pasted image 20240925183518.png)

|**Password Attack Type**|
|---|
|`Dictionary attack`|
|`Brute force`|
|`Traffic interception`|
|`Man In the Middle`|
|`Key Logging`|
|`Social engineering`|
We focus on first 2. 

Brute force put simply == trying all possible character combinations for length specified. 
PW Length of 4 = A-Z,0-9. 
- Using only english characters this has 456,976 permutations
- PW length increase + mixed casing + numbers + special chars, eventually this would take millions of years. 
- Pure bruteforces are not ideal, especially over network. 
- Thus we have dictionary attacks. 

Dict attacks guess with lists. 
