Bypassing authentication via HTTP headers
Not all vulnerabilities are hidden in cookies. Sometimes the server makes authorization decisions based on HTTP headers, which the client has complete control over. Searching for vulnerabilities in HTTP headers is a separate area, which Russian-language resources rarely cover.
X-Forwarded-For: Simulate an internal IP
The web application behind the reverse proxy determines the client's IP from the header X-Forwarded-ForIf the application trusts this header without checking, well, it's simple:
GET /admin HTTP/1.1
Host: target.ctf
X-Forwarded-For: 127.0.0.1
Cookie: session=ваш_токен
If the admin panel is only accessible from 127.0.0.1and the server takes the IP from the header—you're in. This is a combination of Exploit Public-Facing Application (T1190, Initial Access) and Broken Access Control. Try not only 127.0.0.1, but also 10.0.0.1, 192.168.1.1, ::1(IPv6 loopback). IPv6 worked on one CTF.
X-Original-URL и X-Rewrite-URL
Some frameworks support headers. X-Original-URL or X-Rewrite-URL, which override the request path on the backend. A typical scenario: the front server blocks /adminaccording to the URL rule, but the backend reads the path from the header. You send GET /with a title X-Original-URL: /admin— the frontend passes it, the backend processes it as a request to a protected resource.
In Repeater, this is checked in seconds: add a header, click Send, and compare the response with the previous one.
Referrer-based access control
It's rare, but it happens in CTF: the server checks the header Refererto ensure that the request came from the "correct" page. If the endpoint /admin/delete-userchecks that Referercontains /admin/dashboard- add this header to the Repeater, and the limitation is removed.
The general principle for all three cases is: you send an original request, you get a refusal ( 403 Forbidden), add or change one header, resend, and compare responses. Systematically iterating through known headers using Repeater is a method that addresses a whole class of problems.
Exploiting session fixation and session hijacking through cookies in CTF
Session Fixation: Imposing a Known Token
Session fixation is an attack in which the attacker pre-fixes a session identifier. Once the victim logs in with this identifier, it becomes valid—and the attacker uses it to gain access.
In CTF tasks, the check looks like this: 1. Intercept the server response before authentication - pay attention to Set-Cookie: session=abc123 2. Log in and send a request via Repeater 3. Check if the value has changed session V Set-Cookie after successful login 4. If the value remains abc123— session fixation confirmed
Correct implementation: after successful authentication, the server must generate a new session identifier and invalidate the old one. If this doesn't happen, anyone who knew the old token gains access to the authenticated session. Simple and painful.
Privilege Escalation via Session Cookie Substitution
Method via Repeater (described in PortSwigger's privilege testing documentation ):
Log in as a user with high privileges (in CTF this is usually admin:adminor credentials from the prompt), go through the admin functionality - all requests will go to Proxy → HTTP History
Log out and log in as a normal user.
In HTTP History, find the last request of a regular user, copy its cookie (value session=...)
Find the admin request to the protected endpoint ( /admin/users, /admin/panel), send it to Repeater
Replace the admin cookie with a standard user cookie
Click Send and review the response.
The server returned 200 OKwith the contents of the admin panel instead 401 or 403Access control is broken. The server checks session validity but does not check user privileges for a specific endpoint.
For automation across a large number of endpoints, the Autorize extension from the BApp Store is suitable—it replicates each request with another user's cookie and highlights discrepancies. However, it's best to start manually using Repeater to understand the mechanics before enabling automation. Manual first, then automation.
Step-by-step workflow: from interception to flagging
Here's the algorithm I apply to every CTF authentication challenge. The process is the same for challenges of any level; the depth of analysis at each step varies.
Just do it once: intercept and read. Enable Proxy Intercept, open the target application in Burp's built-in browser. Register (if there is a registration form), log in. Go to Proxy → HTTP History , find the login request (usually a POST to /login or /auth). Send it to Repeater. Read each response header: Set-Cookie, X-Powered-By, Server, any non-standard headers. Decode all cookie values using Decoder - try base64, URL decode, hex. If the value contains dots and looks like xxx.yyy.zzz— this is JWT, take it apart piece by piece.
Do two: modify and compare. Change one value in the cookie: user → admin, id=5 → id=1, role=0 → role=1Click Send. Compare the responses: has the status code changed? The body? The length? Are there any new headers? If there are no changes, try different values. If it's a JWT token, try an attack. algorithm noneand payload modification. Add headers: X-Forwarded-For: 127.0.0.1, X-Original-URL: /admin, Referer: /adminChange only one thing at a time—otherwise, you won't know what worked.
Do three: confirm and commit. If the response has changed, repeat the request two or three times to confirm consistency. Determine the specific change that led to the result. In a CTF, look for a flag in the response body, headers, or cookie values. In a real pentest, document the endpoint, parameter, before and after value, and OWASP and MITRE ATT&CK classification.
This workflow covers most Easy and Medium tasks on CTF platforms. The gist: the scanner didn't find a vulnerability, but you manually changed a parameter using Burp Repeater and saw a difference in server behavior.
Typical mistakes beginners make when analyzing sessions
"Changing the cookie, but nothing happens" - check that you're sending the request to a secure endpoint. Changing the cookie in the request to the main page may not produce a visible result. Send to /admin, /dashboard, /api/users- where the difference in rights manifests itself.
"JWT not accepted after modification" - if you changed the payload but left the old signature with the HS256 algorithm, the server will reject the token. Make sure you changed the algorithm to noneand removed the signature, or guessed the secret key. A common mistake: forgetting to remove symbols =from base64url (URL-safe base64 does not use padding).
"I don't see a cookie in Repeater" - the cookie is set through Set-Cookiein the server response (right panel), and is transmitted through Cookiein the query (left panel). Beginners confuse the direction. In Repeater, you modify the query on the left and read the results on the right.
"Tried everything, nothing works" - expand your search beyond cookies. Sometimes the token is passed in the URL ( ?token=), in a hidden form field ( <input type="hidden">), in the title Authorization: Bearer ...or even in the body of a POST request as JSON. Repeater allows you to modify any of these options equally.
"Burp shows an HTTPS error" - To intercept HTTPS traffic, the browser must trust Burp's certificate. Open http://burpsuitein the built-in browser, download and install the CA certificate. Without it, Burp won't be able to proxy encrypted requests, and most CTF platforms operate over HTTPS.
A separate point that even experienced participants miss: check all requests , not just POST to /loginSometimes a vulnerability hides in a GET request to an API, a WebSocket connection, or a request to load a "static" resource that's actually dynamic. Burp Repeater is great for web application pentesting because it allows you to monitor every byte of the request.
Most CTF newbies spend their first months mastering automated tools like sqlmap, nikto, and dirsearch, and miss the key: the skill of manually reading HTTP traffic. Automated tools will detect an SQL injection in a GET parameter, but they won't notice that role=dXNlcg==in the cookie it's base64 from userEight out of ten CTF authentication challenges are solved not by exploits, but by paying attention to Repeater: read the headers, decode the value, replace one byte, send—a flag.
Not all vulnerabilities are hidden in cookies. Sometimes the server makes authorization decisions based on HTTP headers, which the client has complete control over. Searching for vulnerabilities in HTTP headers is a separate area, which Russian-language resources rarely cover.
X-Forwarded-For: Simulate an internal IP
The web application behind the reverse proxy determines the client's IP from the header X-Forwarded-ForIf the application trusts this header without checking, well, it's simple:
GET /admin HTTP/1.1
Host: target.ctf
X-Forwarded-For: 127.0.0.1
Cookie: session=ваш_токен
If the admin panel is only accessible from 127.0.0.1and the server takes the IP from the header—you're in. This is a combination of Exploit Public-Facing Application (T1190, Initial Access) and Broken Access Control. Try not only 127.0.0.1, but also 10.0.0.1, 192.168.1.1, ::1(IPv6 loopback). IPv6 worked on one CTF.
X-Original-URL и X-Rewrite-URL
Some frameworks support headers. X-Original-URL or X-Rewrite-URL, which override the request path on the backend. A typical scenario: the front server blocks /adminaccording to the URL rule, but the backend reads the path from the header. You send GET /with a title X-Original-URL: /admin— the frontend passes it, the backend processes it as a request to a protected resource.
In Repeater, this is checked in seconds: add a header, click Send, and compare the response with the previous one.
Referrer-based access control
It's rare, but it happens in CTF: the server checks the header Refererto ensure that the request came from the "correct" page. If the endpoint /admin/delete-userchecks that Referercontains /admin/dashboard- add this header to the Repeater, and the limitation is removed.
The general principle for all three cases is: you send an original request, you get a refusal ( 403 Forbidden), add or change one header, resend, and compare responses. Systematically iterating through known headers using Repeater is a method that addresses a whole class of problems.
Exploiting session fixation and session hijacking through cookies in CTF
Session Fixation: Imposing a Known Token
Session fixation is an attack in which the attacker pre-fixes a session identifier. Once the victim logs in with this identifier, it becomes valid—and the attacker uses it to gain access.
In CTF tasks, the check looks like this: 1. Intercept the server response before authentication - pay attention to Set-Cookie: session=abc123 2. Log in and send a request via Repeater 3. Check if the value has changed session V Set-Cookie after successful login 4. If the value remains abc123— session fixation confirmed
Correct implementation: after successful authentication, the server must generate a new session identifier and invalidate the old one. If this doesn't happen, anyone who knew the old token gains access to the authenticated session. Simple and painful.
Privilege Escalation via Session Cookie Substitution
Method via Repeater (described in PortSwigger's privilege testing documentation ):
Log in as a user with high privileges (in CTF this is usually admin:adminor credentials from the prompt), go through the admin functionality - all requests will go to Proxy → HTTP History
Log out and log in as a normal user.
In HTTP History, find the last request of a regular user, copy its cookie (value session=...)
Find the admin request to the protected endpoint ( /admin/users, /admin/panel), send it to Repeater
Replace the admin cookie with a standard user cookie
Click Send and review the response.
The server returned 200 OKwith the contents of the admin panel instead 401 or 403Access control is broken. The server checks session validity but does not check user privileges for a specific endpoint.
For automation across a large number of endpoints, the Autorize extension from the BApp Store is suitable—it replicates each request with another user's cookie and highlights discrepancies. However, it's best to start manually using Repeater to understand the mechanics before enabling automation. Manual first, then automation.
Step-by-step workflow: from interception to flagging
Here's the algorithm I apply to every CTF authentication challenge. The process is the same for challenges of any level; the depth of analysis at each step varies.
Just do it once: intercept and read. Enable Proxy Intercept, open the target application in Burp's built-in browser. Register (if there is a registration form), log in. Go to Proxy → HTTP History , find the login request (usually a POST to /login or /auth). Send it to Repeater. Read each response header: Set-Cookie, X-Powered-By, Server, any non-standard headers. Decode all cookie values using Decoder - try base64, URL decode, hex. If the value contains dots and looks like xxx.yyy.zzz— this is JWT, take it apart piece by piece.
Do two: modify and compare. Change one value in the cookie: user → admin, id=5 → id=1, role=0 → role=1Click Send. Compare the responses: has the status code changed? The body? The length? Are there any new headers? If there are no changes, try different values. If it's a JWT token, try an attack. algorithm noneand payload modification. Add headers: X-Forwarded-For: 127.0.0.1, X-Original-URL: /admin, Referer: /adminChange only one thing at a time—otherwise, you won't know what worked.
Do three: confirm and commit. If the response has changed, repeat the request two or three times to confirm consistency. Determine the specific change that led to the result. In a CTF, look for a flag in the response body, headers, or cookie values. In a real pentest, document the endpoint, parameter, before and after value, and OWASP and MITRE ATT&CK classification.
This workflow covers most Easy and Medium tasks on CTF platforms. The gist: the scanner didn't find a vulnerability, but you manually changed a parameter using Burp Repeater and saw a difference in server behavior.
Typical mistakes beginners make when analyzing sessions
"Changing the cookie, but nothing happens" - check that you're sending the request to a secure endpoint. Changing the cookie in the request to the main page may not produce a visible result. Send to /admin, /dashboard, /api/users- where the difference in rights manifests itself.
"JWT not accepted after modification" - if you changed the payload but left the old signature with the HS256 algorithm, the server will reject the token. Make sure you changed the algorithm to noneand removed the signature, or guessed the secret key. A common mistake: forgetting to remove symbols =from base64url (URL-safe base64 does not use padding).
"I don't see a cookie in Repeater" - the cookie is set through Set-Cookiein the server response (right panel), and is transmitted through Cookiein the query (left panel). Beginners confuse the direction. In Repeater, you modify the query on the left and read the results on the right.
"Tried everything, nothing works" - expand your search beyond cookies. Sometimes the token is passed in the URL ( ?token=), in a hidden form field ( <input type="hidden">), in the title Authorization: Bearer ...or even in the body of a POST request as JSON. Repeater allows you to modify any of these options equally.
"Burp shows an HTTPS error" - To intercept HTTPS traffic, the browser must trust Burp's certificate. Open http://burpsuitein the built-in browser, download and install the CA certificate. Without it, Burp won't be able to proxy encrypted requests, and most CTF platforms operate over HTTPS.
A separate point that even experienced participants miss: check all requests , not just POST to /loginSometimes a vulnerability hides in a GET request to an API, a WebSocket connection, or a request to load a "static" resource that's actually dynamic. Burp Repeater is great for web application pentesting because it allows you to monitor every byte of the request.
Most CTF newbies spend their first months mastering automated tools like sqlmap, nikto, and dirsearch, and miss the key: the skill of manually reading HTTP traffic. Automated tools will detect an SQL injection in a GET parameter, but they won't notice that role=dXNlcg==in the cookie it's base64 from userEight out of ten CTF authentication challenges are solved not by exploits, but by paying attention to Repeater: read the headers, decode the value, replace one byte, send—a flag.