CTF Authentication Vulnerabilities via Burp Repeater part 1

Depov

Moderator
Staff member
MODERATOR
ULTIMATE
SUPREME
PREMIUM
MEMBER
Joined
Feb 18, 2025
Messages
790
Reaction score
1,510
How authentication works in CTF tasks

Before hacking anything, it's worth understanding what exactly the task authors are introducing as a vulnerability. In web CTFs, authentication and session management errors are among the most common vectors. They fall under the A01:2021 category—Broken Access Control— according to the OWASP classification, where 94% of tested applications contained some form of access control violation. For more details, see our detailed analysis of creating CTF tasks .
Session, token, cookie — basic concepts

For those unfamiliar, here's a quick overview of the basics. When you enter your username and password, the server creates a session —a record that a specific user has been verified. To avoid prompting for a password every time you click, the server issues a token —a unique string that verifies your identity. The token is most often stored in a cookie —a piece of data that the browser automatically attaches to every request to the same domain.

In MITRE ATT&CK terms, the theft or counterfeit of this token is described by several techniques: - Steal Web Session Cookie (T1539, Credential Access) - interception of an existing session cookie - Forge Web Credentials: Web Cookies (T1606.001, Credential Access) - creating a fake token - Web Session Cookie (T1550.004, Lateral Movement) - using a stolen cookie to access other resources - Browser Session Hijacking (T1185, Collection) - interception of an active browser session

CTF challenge authors intentionally introduce common errors into authentication mechanisms:

Predictable values - token session=1, session=2instead of a cryptographically strong string
Cleartext data—the user's role is stored in an unsigned cookie: role=user or role=dXNlcg== (base64)
Weak cryptography - JWT is signed with a secret secretor algorithm none
Lack of server validation - the server accepts any data from the client without verification

The goal is to find the point where trust in client data exceeds reasonable limits. Burp Repeater allows you to do this methodically, without guesswork.
Burp Repeater for manual authentication analysis

Repeater is a tab in Burp Suite where you can manually send HTTP requests, change any parameters, and immediately see the server's response. Unlike Proxy (which intercepts requests on the fly), Repeater lets you run a single request dozens of times, changing a single variable each time. This is the key advantage of Burp Repeater for HTTP header analysis: you isolate a single change and monitor the response.
From Interceptor to Repeater: Five Actions

Enable interception: Proxy tab → Intercept , the Intercept button is on
Open the built-in browser: Proxy → Open Browser (works in Community Edition)
Go to the target website, log in – Burp will intercept the POST request with your credentials
Right-click on the request → Send to Repeater
Switch to the Repeater tab - the query is ready for modification

The right panel of the Repeater displays the server response. For CTF authentication challenges, focus on two areas:

in the response headers Look Set-Cookiewith session token, security headers ( X-Frame-Options, Content-Security-Policy), non-standard headers. Sometimes the flag is hidden in a custom header like X-Flag- Yes, it can be that straightforward.

contains The response body HTML with hints in the comments, JSON with access rights fields, and a redirect to /admin or /dashboard.

A nuance that trips up newbies: while Intercept is enabled, every request from the browser waits for the Forward button to be pressed. When you switch to Repeater, disable Intercept, otherwise the browser will freeze. Repeater works independently.
Manipulating Cookies in Burp Suite: From Encoding to Privileges

Cookie spoofing is the most common authentication vulnerability in entry-level and intermediate-level CTF tasks. The server stores user permissions directly in a cookie, and the only "protection" is encryption (not encryption!). This encryption can be deployed in seconds.
How to recognize encoding

Seeing in the answer Set-Cookie: session=eyJ1c2VyIjoiZ3Vlc3QifQ==, first of all, determine the format:

Base64 — letters, numbers, symbols +, /, one or two =at the end. Decode in the Decoder tab: paste the string, click Decode as → Base64
URL-encoding — symbol %20, %3Dinstead of spaces and special characters
Hex is a string of hexadecimal characters: 61646d696e (This admin)
JWT - three parts separated by a dot: xxxxx.yyyyy.zzzzz(disassembled separately)

No guessing required: just paste the string into Decoder and click Smart decode – Burp will try to determine the format and display the result.
Practice: Role substitution via base64 cookie

After logging in, the server set a cookie. role=dXNlcg==Procedure:

Copy dXNlcg==→ Decoder → Decode as Base64 → result: user
Enter admin→ Encode as Base64 → result: YWRtaW4=
Go back to Repeater, find the header in the request Cookie: role=dXNlcg==
The replacements of Cookie: role=YWRtaW4=
Click Send.

If the response changes, the admin panel appears, the content is different, and a flag indicates the vulnerability is confirmed. The server decodes base64 and trusts the result without checking its integrity. Classic Broken Access Control (OWASP A01:2021) and Forge Web Credentials: Web Cookies (T1606.001) according to MITRE ATT&CK.

Don't limit yourself to one substitution. Try different values: admin, administrator, root, superuser, numeric IDs ( 0, 1, -1). CTF task authors sometimes include non-standard roles - I came across god And debug.
Cookie Flags: Developer Tips

Headline Set-CookieContains not only a value but also security attributes. In CTFs, their absence is often a clue:

If there's no HttpOnly , the cookie can be read via JavaScript. The author of the task hints: look for XSS, steal the session via document.cookieNo Secure —the cookie is transmitted over HTTP without encryption; in a real pentest, this is intercepted via MitM. SameSite = Noneor missing - CSRF attacks are possible.

See Set-Cookie: session=abc123; Path=/Without a single safety flag? You have several potential vectors right in front of you. A red carpet, essentially.
Manually forging JWT tokens in CTF tasks

JWT (JSON Web Token) is a token format consisting of three parts separated by periods: a header, a payload, and a signature. Each part is encoded in base64 URL. JWT hacking in CTF challenges is a popular category because implementation errors are common.
Parsing the structure in Burp Decoder

Token eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyIjoiZ3Vlc3QifQ.XXXXXIt's broken down into parts. Take the first part before the dot and decode it in Decoder as Base64:

# Заголовок (первая часть после base64url decode):
{"alg":"HS256"}

# Payload (вторая часть после base64url decode):
{"user":"guest","role":"viewer"}

The header specifies the signature algorithm. The payload contains the user data—the data you want to modify. The third part is the signature, which "guarantees" integrity. This guarantee only works if implemented correctly. This can be problematic in CTF tasks (and even in production, for that matter).
Algorithm none attack

Some JWT libraries support the algorithm none— an unsigned token. If the server doesn't whitelist the allowed algorithms, the attack looks like this:

Decode the header, replace "alg":"HS256"on "alg":"none"
Change the payload: "user":"guest" → "user":"admin"
Encode both parts back to base64url (in Decoder: Encode as Base64, then replace +on -, /on _, remove =)
Collect the token: новый_заголовок.новый_payload.- the third part is empty, but the point remains
Insert the token into the Repeater (header Cookie: token=... or Authorization: Bearer ...), click Send

Did the server return the administrator credentials? Vulnerability confirmed. This is a Cryptographic Failure (OWASP A02:2021): the server does not validate the signature algorithm.
Selecting a weak secret

When the algorithm HS256and attack nonedidn't work, try another vector: weak secret key. The HMAC signature is calculated with the secret, and if the key is dictionary ( secret, password, 123456, changeme), you can crack it offline. Take the token, run it through a list of common passwords, and check for a signature match. But the first step is always the same: use Repeater to detect that the server is using a JWT and parse its structure.

In CTFs, you can often find a hint right in the page's source code or in a non-standard response header—the secret or part of it. Check HTML comments ( <!-- secret: ... -->) and all answer headers. Problem authors like to hide the keys in plain sight.
 
Top Bottom