HTTP Status Codes Cheat Sheet ()

Listen to this Post

An HTTP status code is a 3-digit number returned by a web server to indicate the result of a client’s request. These codes help developers and testers understand how web servers respond to requests.

πŸ” Top 5 Most Common HTTP Status Codes

  • 200 OK – The request was successful.
  • 301 Moved Permanently – The resource has a new permanent location.
  • 403 Forbidden – The server refuses to authorize the request.
  • 404 Not Found – The requested resource could not be found.
  • 500 Internal Server Error – A generic error occurred on the server.

πŸ›‘οΈ Most Relevant Status Codes for Web App Security Testing
– 401 Unauthorized – Appears when authentication is required or failed.
– 403 Forbidden – Indicates restricted access, useful for testing authorization flaws.
– 404 Not Found – Helps detect hidden or non-existent endpoints.
– 500 Internal Server Error – Can reveal weaknesses when input causes server crashes.
– 429 Too Many Requests – Useful for testing rate-limiting defenses.

πŸ” Full HTTP Status Codes Cheat Sheet

You Should Know:

Testing HTTP Status Codes with cURL

 Check for 200 OK 
curl -I https://example.com

Force a 301/302 Redirect Check 
curl -L https://example.com/oldpage

Test Authentication (401) 
curl -u username:password -I https://example.com/secure

Trigger a 403 Forbidden 
curl -I https://example.com/admin

Find Hidden Paths (404) 
curl -I https://example.com/secret-path

Force a 500 Error (Improper Input) 
curl -X POST https://example.com/api --data "malformed=data"

Test Rate Limiting (429) 
for i in {1..100}; do curl -I https://example.com/api; done 

Using Python to Analyze HTTP Responses

import requests

response = requests.get("https://example.com") 
print(f"Status Code: {response.status_code}")

if response.status_code == 200: 
print("Website is accessible!") 
elif response.status_code == 403: 
print("Access forbidden! Check permissions.") 
elif response.status_code == 404: 
print("Page not found!") 
elif response.status_code == 500: 
print("Server error! Possible vulnerability.") 

Linux Commands for Debugging HTTP Issues

 Check HTTP Headers 
wget --server-response --spider https://example.com

Monitor Live HTTP Traffic (tcpdump) 
sudo tcpdump -i eth0 -A port 80

Check DNS & Connectivity (Preventing 5xx Errors) 
dig example.com 
ping example.com 

Windows PowerShell HTTP Testing

 Check HTTP Status Code 
Invoke-WebRequest -Uri "https://example.com" | Select-Object StatusCode

Test Authentication (401) 
$cred = Get-Credential 
Invoke-WebRequest -Uri "https://example.com/login" -Credential $cred

Detect Hidden Files (404 Scan) 
1..100 | ForEach-Object { 
$url = "https://example.com/file$_" 
try { 
$response = Invoke-WebRequest -Uri $url -ErrorAction Stop 
Write-Host "$url exists! ($($response.StatusCode))" 
} catch { 
Write-Host "$url not found (404)" 
} 
} 

What Undercode Say

Understanding HTTP status codes is crucial for cybersecurity professionals, developers, and penetration testers. By analyzing these responses, you can uncover misconfigurations, hidden endpoints, and potential vulnerabilities in web applications.

  • 200 OK means success, but could also indicate exposed data.
  • 403 Forbidden might mean improper access controls.
  • 500 Internal Server Error often reveals backend flaws.
  • 429 Too Many Requests helps test brute-force protections.

Always automate checks with tools like curl, wget, tcpdump, and scripting languages like Python or PowerShell.

Expected Output:

HTTP/1.1 200 OK 
Server: nginx 
Date: Wed, 03 Apr 2025 12:00:00 GMT 
Content-Type: text/html; charset=UTF-8 

πŸ”— Further Reading: HTTP Status Codes Cheat Sheet

References:

Reported By: Housenathan Http – Hackers Feeds
Extra Hub: Undercode MoN
Basic Verification: Pass βœ…

Join Our Cyber World:

πŸ’¬ Whatsapp | πŸ’¬ TelegramFeatured Image