Web Request Part 2
Welcome back, cyber crew! In [Part 1](Web_Requests_Blog_Part1.md), we covered **HTTP**, **URLs**, **DNS**, and **cURL**—the basics of how web requests work. Now, in Part 2, we’re diving deeper into the **Web Requests** TryHackMe room to explore **HTTPS**, **HTTP requests and responses**, **headers**, **methods**, and **authentication**. These are the nuts and bolts of secure web communication and common attack vectors. I’ll keep it chill, like we’re geeking out over coffee, with real-world examples and some extra research to make it practical. Let’s get to it!

HTTPS, HTTP Requests, Headers, and Authentication [HTB]
HTTPS: Locking Down HTTP
HTTP sends data in plain text, meaning anyone sniffing the network (like on public Wi-Fi) can read it. Enter HTTPS (HTTP Secure), which encrypts traffic using TLS/SSL to keep it private. HTTPS uses port 443 and is now the standard—most browsers won’t even let you visit HTTP sites anymore. You’ll spot HTTPS by the https:// in the URL and the lock icon in your browser.
Here’s how HTTPS works:
- You visit
http://inlanefreight.com. - The server redirects you to
https://inlanefreight.com(port 443) with a 301 Moved Permanently response. - Your browser and the server perform a TLS handshake, exchanging SSL certificates to establish encryption.
- Once secure, HTTP communication continues, but it’s encrypted.
HTB task: Use cURL to send a request to an HTTPS site. If the SSL certificate is invalid, cURL blocks it unless you use the -k flag to bypass (useful for testing but risky in practice).
Real-world example: In 2022, attackers used HTTP downgrade attacks to trick users into unencrypted connections, stealing credentials. HTTPS prevents this, but misconfigured certificates can still be exploited.
HTTP Requests and Responses
HTTP communication is a dance between requests (client to server) and responses (server back to client). A request includes:
- Method: Like GET or POST, defining the action.
- Path: The resource, like
/login.php. - Version: HTTP/1.1 or 2.0.
- Headers: Metadata like
HostorUser-Agent. - Body: Data, like form inputs (mostly for POST).
A response includes:
- Version: HTTP/1.1.
- Status Code: Like
200 OKor404 Not Found. - Headers: Like
ServerorContent-Type. - Body: The resource, like HTML or JSON.
TryHackMe task: Use cURL with -v to see a request like GET / HTTP/1.1 and its response, like HTTP/1.1 401 Unauthorized. This helps you analyze headers and status codes.
Real-world vibe: In the 2021 Log4j attack, attackers sent malicious HTTP requests to exploit servers. SOC analysts used request logs to spot and block these.
HTTP Headers: The Metadata Magic
Headers carry extra info in requests and responses. TryHackMe breaks them into five types:
-
General Headers:
Date: Timestamp (e.g.,Wed, 16 Feb 2022 10:38:44 GMT).Connection:keep-alive(stay connected) orclose.
-
Entity Headers:
Content-Type: Liketext/html; charset=UTF-8.Content-Length: Size of the body (e.g.,385bytes).Content-Encoding: Likegzipfor compression.
-
Request Headers:
Host: The domain (e.g.,inlanefreight.com).User-Agent: Client info (e.g.,curl/7.77.0).Cookie: Session data (e.g.,PHPSESSID=b4e4fbd93540).Authorization: Auth tokens, likeBasic YWRtaW46YWRtaW4=.
-
Response Headers:
Server: Server type (e.g.,Apache/2.2.14).Set-Cookie: Sets client cookies.WWW-Authenticate: Signals auth needed (e.g.,Basic realm="localhost").
-
Security Headers:
Content-Security-Policy: Blocks untrusted scripts to prevent XSS.Strict-Transport-Security: Forces HTTPS.Referrer-Policy: ControlsRefererheader data.
TryHackMe task: Use curl -I to fetch headers or -H to set custom headers like User-Agent. This mimics how attackers manipulate headers to bypass filters.
Research note: A 2024 X post from @WebSecGuru noted that missing security headers like Content-Security-Policy were exploited in 30% of web attacks last year.
HTTP Methods: The Verbs of the Web
HTTP methods tell the server what to do. Common ones include:
- GET: Fetches a resource (e.g., a webpage).
- POST: Sends data, like login forms.
- HEAD: Gets headers only, no body.
- PUT: Creates or updates resources.
- DELETE: Removes resources.
- OPTIONS: Lists allowed methods.
- PATCH: Partially updates resources.
TryHackMe task: Analyze a GET request to search.php?search=le to see how parameters are passed. You’ll also use browser DevTools to monitor methods used by a page.
Real-world example: In 2023, attackers used unauthorized PUT requests to upload malicious files to misconfigured APIs, causing data breaches. Understanding methods helps you spot these in logs.
HTTP Authentication: Getting Past the Gate
Basic HTTP Authentication is a simple way servers protect pages. Instead of a login form, you get a popup asking for a username and password (e.g., admin:admin). The credentials are base64-encoded in the Authorization header (e.g., Basic YWRtaW46YWRtaW4=).
TryHackMe task: Use cURL with -u admin:admin or a URL like http://admin:admin@<SERVER_IP>:<PORT>/ to authenticate and grab a flag. You’ll also inspect the Authorization header with -v.
Real-world vibe: In 2020, attackers brute-forced basic auth on exposed routers, gaining access to networks. SOC analysts can detect this by monitoring for repeated 401 Unauthorized responses.
Pro tip: Modern apps use JWT (JSON Web Tokens) or cookies for authentication, but basic auth is still common in legacy systems or internal tools.
Browser DevTools: Your Web Inspector
Browser DevTools (hit F12 or Ctrl+Shift+I) are a pentester’s best friend. The Network tab shows all requests and responses, including methods, headers, and status codes. You can filter requests, view raw data, or copy requests as cURL commands.
TryHackMe task: Use the Network tab to find a flag in a request to search.php?search=flag. This teaches you how to analyze dynamic web apps, like spotting hidden API calls.
Real-world example: In 2022, pentesters used DevTools to find unsecured API endpoints in a retail app, leaking customer data. DevTools are key for bug bounty hunters.
Final Thoughts
This part of the Web Requests HTB Module levels up your web security skills. HTTPS keeps data safe, headers reveal critical info, methods define actions, and authentication controls access. Whether you’re a SOC analyst spotting malicious POST requests or a pentester crafting cURL exploits, these concepts are your foundation. Practice with TryHackMe’s exercises, like using DevTools to find flags or cURL to bypass auth, to build real-world skills. Got a favorite DevTools trick or cURL hack? Share it in the comments!
Enjoyed this report?
If it helped, like it and pass it on to someone who needs it.
WebFeaturedWeb Requests Cheat Sheet: Mastering cURL, APIs, and DevTools for Bug Bounties
Hey, cyber sleuths! If you're diving into bug bounty hunting or sharpening your skills as a penetration tester, understanding web requests is your secret weapon. Tools like cURL let you poke, prod, and probe web applications with precision, uncovering vulnerabilities that automated scanners might miss. This blog takes the classic web requests cheat sheet—covering cURL commands, API interactions, and Browser DevTools shortcuts—and expands it with in-depth explanations. We'll dive into why each flag or technique is used, its core description, and how it fits into real-world scenarios. Plus, I'll throw in some advanced cURL techniques tailored for bug bounties, drawn from proven methodologies. Whether you're a junior SOC analyst monitoring traffic or a bug hunter chasing bounties, let's break it down step by step!
WebCRUD API Operations HTB
Hey, cyber warriors! Ready to dive into the world of APIs? In the **Web Requests** TryHackMe room, the **CRUD API** section explores how web applications use APIs to interact with databases, letting you create, read, update, and delete data with HTTP methods. This is like wielding a Swiss Army knife for web data manipulation—essential for SOC analysts spotting malicious API calls or pentesters exploiting misconfigured endpoints. We’ll break down the CRUD operations (Create, Read, Update, Delete), walk through TryHackMe’s hands-on tasks, and sprinkle in real-world examples and research to keep it practical. Let’s get started!
WebHTTP POST Requests Explained: Login Forms, Cookies and JSON
How HTTP POST requests work and why they matter for security: login forms, authenticated session cookies and JSON APIs, with the cURL command to send each one.