Hunting For Password Reset Tokens By Spraying And Using HTTP Pipelining
The password reset tokens were predictable and old tokens remained valid for 10 hours, allowing an attacker to spray many reset requests and brute-force the token space to take over accounts.
Published on trustwave.com
Change theme to light
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Context
This is a proof of concept built around a password reset feature. The normal, good implementation works like this: a user who has forgotten their password selects "forgot password", supplies an e-mail address (or username), and the application e-mails a unique, time limited, one-time link containing a token to the registered address. Following the link with a valid token is what proves ownership of the mailbox, and only then can a new password be set.
The author contrasts this with weaker designs. A bad design issues a new temporary password server side straight away and mails it in cleartext, effectively using the new password as the token, which leads to what he calls "Password Reset DoS". Other weak designs issue links with predictable, static, non-expiring or reusable tokens. The very worst also carry a user-controlled username or id parameter with no HMAC integrity check and no server side validation.
The scenario here is deliberately not the worst: on the face of it the reset mechanism looks reasonable. The weakness is a combination of small design flaws plus the speed of HTTP pipelining, which together allow arbitrary account takeover.
Setup
The researcher reproduces the server side locally. The web server is Apache, serving files from its web root under a /resetpassword/ directory. A request for an existing file returns HTTP 200 OK; a request for a missing one returns HTTP 404 Not Found. This stands in for a valid and an invalid reset token respectively.
The tooling is Burp Suite with the Turbo Intruder extension for the high-speed request phase, plus ordinary Burp Intruder for continuously requesting password resets. The token generation and hunting lists are produced with C, seq or Python, and the token files on the server are created with a bash for loop.
Two preconditions make the attack work, and both are properties of the application rather than the test rig:
- Requesting a new reset link does not invalidate the previous one.
- Each token is valid for 10 hours.
Finding it
The researcher registers an account and requests a password reset. The e-mail contains a link of the form:
Please visit https://[redacted]/resetpassword/36525646 to reset your password.
He requests another reset to compare against the baseline, as a scientist would compare against a control group:
Please visit https://[redacted]/resetpassword/1657177506 to reset your password.
He repeats this until he has 50 tokens, in the order received:
365256460
1657177506
1986055580
741532205
527890360
442059229
987251296
717599616
29792672
825171448
1798342323
498299249
1320462756
800784560
107292283
1986043443
537545646
910649865
1767536999
296777708
929634488
867032357
980003670
1313317313
530880191
1300024965
464686643
1181592875
693890782
829894330
1718925158
1468835528
837921297
1336689766
362190361
808466195
206029262
433891936
1158511253
1455609935
1893679034
799600364
1521862935
863837241
966780233
257827295
1272555532
494910317
197257454
118248652
Sorting them numerically with sort -n gives the same 50 values from smallest to largest:
29792672
107292283
118248652
197257454
206029262
257827295
296777708
362190361
365256460
433891936
442059229
464686643
494910317
498299249
527890360
530880191
537545646
693890782
717599616
741532205
799600364
800784560
808466195
825171448
829894330
837921297
863837241
867032357
910649865
929634488
966780233
980003670
987251296
1158511253
1181592875
1272555532
1300024965
1313317313
1320462756
1336689766
1455609935
1468835528
1521862935
1657177506
1718925158
1767536999
1798342323
1893679034
1986043443
1986055580
The smallest is 29792672 ("29 million something") and the largest is 1986055580 ("1 billion something"). That is a wide range, but it is bounded, and the values look like the output of a seeded pseudo-random number generator rather than a cryptographically random token.
Exploitation
Step 1: model the token generator
From a black box position the researcher does not know the server's internals. Based on the observed range of the output, he writes a small program using srand() with a minimum of 10000000 and a maximum of 2000000000 to reproduce the same kind of output.

Figure 1. Code to generate random values between 10000000 and 2000000000 to simulate the server logic.
He is explicit that this model may be wrong, and probably is: the seed could be time based, static, or something else. The point is only to establish whether there is something viable to attack.
Step 2: spray reset requests
The concept borrowed here is heap spraying. In its original form, code that sprays the heap puts a chosen sequence of bytes at a predetermined location in a target process by allocating large blocks and filling them with the right values. The researcher applies the same idea to the reset mechanism: the more valid tokens that exist server side at once, the greater the chance that one of them falls inside the range he can enumerate.
He uses Burp Intruder to continuously request password resets for the proof of concept account. This has to be throttled and limited, because every request causes server side work involving the mail server and can amount to a denial of service, and because in a real attack the victim would be spammed. The reset requests do not need to be fast; they need to start early enough to fill the imaginary "heap" (not an actual memory heap) before the hunt begins.
Step 3: build the token list to hunt for
He generates every value in a chosen range and writes it to a file. In this example the range is 10 million to 99 million, chosen to keep the proof of concept manageable; in reality the same approach would be repeated in segments up to 2 billion if the first range did not get lucky.

Figure 4. Code to create our list of tokens to hunt for.
The highest number this code generates is actually 98999999, because the loop starts at 0. If the token happened to be 99000000 the loop could be tweaked to go up to 99000001, but for illustrative purposes the researcher leaves it as is.

Figure 5. Last 10 lines of our list of tokens file to hunt for (full file contains 89 million tokens).
The output goes into numbers_to_hunt_for.txt, which after a couple of minutes contains all values from 10 million up to just short of 99 million.
Step 4: recreate the server side
To represent tokens being created on the server, he seeds 50 token values randomly between 10 million and 2 billion using the earlier code and saves them to 50.txt.

Figure 2. Last 10 lines of the 50 token values randomly generated earlier (full file contains 50 tokens).
He then creates one file per number, with no file extension, inside the web root under /resetpassword/, so that 1313317317 becomes /resetpassword/1313317317. A bash for loop does this.

Figure 3. Creating files with numbers as the actual filenames to represent valid tokens to live on the web server.
Apache serves these files. A request for an existing file returns HTTP 200 OK; anything else returns HTTP 404 Not Found. This reproduces a valid reset link and an invalid one, and represents the spraying having happened, but only 50 times.
Step 5: fire the requests with HTTP pipelining
HTTP pipelining, as the researcher quotes from Wikipedia, is an HTTP/1.1 feature that allows multiple requests to be sent over a single TCP connection without waiting for the corresponding responses. Servers are required to respond correctly with non-pipelined but valid responses even if they do not support pipelining, though many legacy HTTP/1.1 servers do not, which is why most clients avoid it. The F5 article he also quotes describes it as "shoving" all the requests at the server at once to save the round trip time that would otherwise be spent waiting after each request.
He starts Apache, opens Burp, and configures Turbo Intruder with numbers_to_hunt_for.txt. He does not show the configuration, deliberately, so the post does not become a step-by-step tutorial. Testing locally, without accounting for network latency, he measured in the region of 10,500 requests per second from Turbo Intruder.
Step 6: watch the logs and find the token
Tailing the web server logs during the attack shows a stream of HTTP 404 responses scrolling past, the server telling the attacker that the supplied token is invalid.

Figure 7. View from the web server of invalid token requests, scrolling past at light speed.
Around 30 minutes later the needle is found: Burp shows an HTTP 200 for token 29792672, that is /resetpassword/29792672.

Figure 8. Turbo Intruder finding a valid token of "29792672" with a HTTP 200 OK response.
The server side view shows the same thing: a run of HTTP 404 responses followed by the valid token at the bottom returning HTTP 200.

Figure 9. View from the web server of invalid tokens (HTTP 404) followed by a valid token ("29792672") at the bottom (HTTP 200).
In the real world the next step is to connect using that token and set a new password for the user. The researcher also notes that on a real application there may be other active reset tokens already in the wild, triggered by genuine users, which this method could stumble upon.
Root cause
The tokens fall in a bounded numeric range consistent with a seeded pseudo-random generator, though the researcher says his model of the server may be wrong. That alone reduces the search space, but the decisive flaws are the two design issues identified earlier. First, generating a new token does not invalidate the old one, so old tokens remain valid and the attacker can accumulate valid tokens by triggering resets. Second, tokens live for 10 hours, which gives a pipelined brute force far more time than it needs. The researcher describes the failure to nuke the old token as "the great fail" in this example, and the expiry time as the other contributing factor.
Impact
An attacker who can trigger password resets for a victim account and then enumerate the token range can obtain a valid reset token and set a new password, taking over the account. The attack requires the ability to request resets repeatedly, and it is not quiet: the victim would be spammed with reset e-mails and the server does substantial work, with potential for denial of service. The 10 hour validity window and the retention of old tokens are what make the enumeration feasible within the token lifetime. The researcher also notes that tokens belonging to genuine users may be found along the way.
Fix
Reset tokens should be random and unique, using the secure facilities the framework provides. When a new token is generated, the old one must be invalidated. Token expiry should be reduced substantially, to something like an hour, or as little as 5 minutes depending on the criticality of the application and the threat model.
Variants to test
- Token invalidation on reissue. Request several resets for one account and try each older token. A positive result is any older token still returning a valid reset page or
HTTP 200. - Token lifetime. Record when a token is issued and test it at intervals. A positive result is a token still accepted well beyond a sensible window, here 10 hours.
- Token predictability. Collect a sample of tokens, sort them numerically, and look at the range and distribution. A positive result is a bounded numeric range consistent with a seeded PRNG rather than high-entropy random values.
- Enumeration speed. Point a pipelining-capable tool such as Turbo Intruder at a candidate token list against a test instance. A positive result is a throughput high enough to cover the range within the token lifetime, as with the roughly 10,500 requests per second measured here.
- Response oracle. Check whether a valid token and an invalid token are distinguishable by status code alone, as
HTTP 200versusHTTP 404here. A positive result is a clean, automatable difference. - Tokens of genuine users. On a live application, run the enumeration while real users are active. A positive result is a valid token that does not belong to the test account.
What happened, in plain words
A security researcher, Tom Neaves, wrote up a proof of concept about a password reset feature. Password reset is the "forgot my password" button you have almost certainly used: you type your e-mail address, the site sends you an e-mail with a link, you click the link, and you get to choose a new password.
The link contains a long number called a token. The token is the site's way of checking that the person clicking the link really owns the e-mail address. If the token is correct, the site lets you set a new password. If it is wrong, the site refuses.
The researcher found that in this particular application the tokens were not truly random. They were numbers between roughly 10 million and 2 billion, and the researcher modelled them as coming from a seeded random number generator. On top of that, two design choices made things worse: asking for a new reset link did not cancel the old ones, and every token stayed valid for 10 hours.
He then showed that a tool can guess millions of token values very quickly, because of a web feature called HTTP pipelining that lets many requests travel over one connection without waiting for each reply. In his local test he reached around 10,500 guesses per second, and after about 30 minutes he found a valid token. With a valid token, an attacker can set a new password on someone else's account, which is called account takeover.

The rest of this article walks through the same story step by step, explaining every term as it appears.
The good version of a password reset
Before looking at what went wrong, it helps to know what a correct password reset looks like. The researcher describes it like this:
- You forget your password and click "forgot password".
- The site asks for your e-mail address (or username).
- The site creates a unique, time limited, one-time link and e-mails it to the address on file.
- You open the e-mail, click the link, and set a new password.
- Only at the moment the link with a valid token is followed does the site treat you as the real owner of that mailbox.
The key idea is that the e-mail inbox is the proof of identity. Anyone can type someone else's e-mail address into the form, but only the owner of that inbox can read the link.
A token here is simply a value that is hard to guess and is tied to one request. Think of a cloakroom ticket: the person at the desk gives you a numbered ticket, and only the matching ticket gets the coat back. If someone could guess ticket numbers, they could collect other people's coats.
The bad versions
The researcher lists several ways this goes wrong.
- Issuing a new temporary password straight away. Some sites, as soon as you ask for a reset, generate a new temporary password on the server and e-mail it to you in plain text. The new password effectively acts as the token. This lets anyone trigger resets for other people over and over, which he calls "Password Reset DoS". DoS stands for denial of service: making a service unusable, here by flooding it with reset requests.
- Predictable tokens. The link contains a token that can be guessed, for example because it is a simple counter or a value produced by a weak random generator.
- Static tokens. The same token value is used every time.
- Tokens that never expire. A leaked or guessed token works forever.
- Reusable tokens. The same link can be used again and again.
- The very worst: a user-controlled parameter. The link also contains a username or id that the user can change, with no HMAC integrity check and no server side validation. HMAC is a way of signing a value so the server can tell it has not been tampered with, like a wax seal on an envelope. Without it, changing the id in the link can point the reset at a different account.
The scenario in this article is deliberately not the worst. On the surface the reset mechanism looks reasonable. The problem is a combination of small design flaws plus the speed of HTTP pipelining.
Setting up the test
Because this is a proof of concept, the researcher rebuilds the server side on his own machine instead of attacking a live site.
The setup is:
- Apache, a very common web server program, serving files from a folder under its web root. The web root is the directory whose contents the server makes available over the web.
- A directory called
/resetpassword/inside that web root. - One file per token value, named after the number, with no file extension. For example, the number
1313317317becomes the file/resetpassword/1313317317. - When a requested file exists, Apache answers
HTTP 200 OK. When it does not exist, Apache answersHTTP 404 Not Found.
HTTP 200 and HTTP 404 are status codes, short numbers a web server sends back with every response. 200 means "here it is, all good". 404 means "I have nothing at that address". You have probably seen a 404 page in a browser.
In this test rig, a 200 stands for "valid reset token" and a 404 stands for "invalid reset token". That is the whole trick of the simulation: the server's answer tells the attacker whether a guess was right.
The tools used are:
- Burp Suite, a program security testers use to watch and modify web traffic. Think of it as a clipboard and magnifying glass for everything your browser sends and receives.
- Turbo Intruder, an extension for Burp that sends huge numbers of requests very fast.
- Ordinary Burp Intruder, used here for repeatedly requesting password resets.
- C,
seqor Python to generate lists of numbers. These are programming languages and command line tools;seqis a small program that prints a sequence of numbers. - A bash
forloop, a way to repeat a command many times in a terminal.
Two preconditions make the attack work, and both are properties of the application, not of the test rig:
- Requesting a new reset link does not invalidate the previous one.
- Each token is valid for 10 hours.
Finding it
The researcher registers an account and asks for a password reset. The e-mail contains a link like this:
Please visit https://[redacted]/resetpassword/36525646 to reset your password.
Line by line: the message tells the user to visit a web address. https:// means the connection is encrypted. [redacted] is the special address a computer uses to talk to itself, here standing in for the test server. /resetpassword/ is the folder, and 36525646 is the token. The sentence after it explains what the link is for.
He asks for another reset, to compare against the first one, the way a scientist compares against a control group. A control group is the baseline sample in an experiment, the one you do not change, so you can tell what changed in the others.
Please visit https://[redacted]/resetpassword/1657177506 to reset your password.
Same structure, different number: 1657177506. Already you can see the token is a plain number, not a long jumble of letters and digits.
He repeats this until he has 50 tokens, in the order they arrived:
365256460
1657177506
1986055580
741532205
527890360
442059229
987251296
717599616
29792672
825171448
1798342323
498299249
1320462756
800784560
107292283
1986043443
537545646
910649865
1767536999
296777708
929634488
867032357
980003670
1313317313
530880191
1300024965
464686643
1181592875
693890782
829894330
1718925158
1468835528
837921297
1336689766
362190361
808466195
206029262
433891936
1158511253
1455609935
1893679034
799600364
1521862935
863837241
966780233
257827295
1272555532
494910317
197257454
118248652
Each line is one token, in the order the e-mails arrived. The order itself is not important; what matters is the set of values.
He then sorts them numerically with sort -n. sort is a command line program that puts lines in order, and -n tells it to compare them as numbers rather than as text, so that 9 comes before 10 instead of after it.
29792672
107292283
118248652
197257454
206029262
257827295
296777708
362190361
365256460
433891936
442059229
464686643
494910317
498299249
527890360
530880191
537545646
693890782
717599616
741532205
799600364
800784560
808466195
825171448
829894330
837921297
863837241
867032357
910649865
929634488
966780233
980003670
987251296
1158511253
1181592875
1272555532
1300024965
1313317313
1320462756
1336689766
1455609935
1468835528
1521862935
1657177506
1718925158
1767536999
1798342323
1893679034
1986043443
1986055580
The smallest value is 29792672, which he calls "29 million something". The largest is 1986055580, "1 billion something". That is a wide range, but it is bounded, and the values look like the output of a seeded pseudo-random number generator rather than a cryptographically random token.
Two terms there. A pseudo-random number generator, or PRNG, is a program that produces numbers that look random but are actually the result of a fixed recipe. If you know the recipe and the starting point, you can reproduce the sequence exactly. The starting point is called the seed. A cryptographically random value, by contrast, is produced in a way designed so that nobody can predict or reproduce it, even with the same software.
Why does this matter? Because a bounded range of guessable numbers can be written down and tried one by one. A truly random token of sufficient length cannot.
Exploitation
Step 1: model the token generator
From the outside, the researcher cannot see the server's code. This is called a black box position: you can send inputs and watch outputs, but you cannot look inside. Based on the observed range of the output, he writes a small program using srand() with a minimum of 10000000 and a maximum of 2000000000 to reproduce the same kind of output.
srand() is a function in the C programming language that sets the seed for the standard random number generator. It is the "starting point" mentioned above.

Figure 1. Code to generate random values between 10000000 and 2000000000 to simulate the server logic.
He is explicit that this model may be wrong, and probably is. The seed could be based on the current time, it could be a fixed value, or it could be something else entirely. The point is not to reproduce the server exactly; the point is to establish whether there is something viable to attack. In other words: is the range small enough and predictable enough that guessing is worth trying?
Step 2: spray reset requests
The concept borrowed here is heap spraying. In its original form, heap spraying is a technique used in exploits: code allocates large blocks of memory on a program's heap and fills them with chosen values, so that a certain sequence of bytes ends up at a predictable place. The heap is the area of memory a program uses for data it creates while running.
The researcher applies the same idea to the reset mechanism. Every time he asks for a reset, the server creates a new valid token and, crucially, keeps the old ones. So the more resets he requests, the more valid tokens exist on the server at once. The more valid tokens that exist, the greater the chance that one of them falls inside the range he can enumerate. He compares it to buying lottery tickets: the more you buy, the better your chance of winning, even if each extra ticket only adds a tiny amount.
He uses Burp Intruder to continuously request password resets for the proof of concept account. This has to be throttled and limited, for two reasons:
- Every request causes work on the server, including the mail server, and can amount to a denial of service.
- In a real attack the victim would be spammed with reset e-mails. This is not a quiet attack.
The reset requests do not need to be fast. What matters is that they start early enough to fill the imaginary "heap" before the hunt begins. He stresses that this is not an actual memory heap; it is just the same idea applied to tokens.
Step 3: build the token list to hunt for
He generates every value in a chosen range and writes it to a file. In this example the range is 10 million to 99 million, chosen to keep the proof of concept manageable. In reality the same approach would be repeated in segments up to 2 billion if the first range did not get lucky.

Figure 4. Code to create our list of tokens to hunt for.
The highest number this code generates is actually 98999999, because the loop starts at 0. A loop is a programming instruction that repeats a block of code; starting at 0 and stopping before the upper limit is a common convention in programming, which is why the last value is one less than you might expect. If the token happened to be 99000000, the loop could be tweaked to go up to 99000001, but for illustrative purposes the researcher leaves it as is.

Figure 5. Last 10 lines of our list of tokens file to hunt for (full file contains 89 million tokens).
The output goes into a file called numbers_to_hunt_for.txt. After a couple of minutes it contains all values from 10 million up to just short of 99 million: 89 million numbers, one per line.
Step 4: recreate the server side
To represent tokens being created on the server, he seeds 50 token values randomly between 10 million and 2 billion using the earlier code and saves them to 50.txt.

Figure 2. Last 10 lines of the 50 token values randomly generated earlier (full file contains 50 tokens).
He then creates one file per number, with no file extension, inside the web root under /resetpassword/, so that 1313317317 becomes /resetpassword/1313317317. A bash for loop does this.

Figure 3. Creating files with numbers as the actual filenames to represent valid tokens to live on the web server.
A file extension is the part of a filename after the dot, like .txt or .jpg. Leaving it off means the URL is just the number, which matches the shape of the reset links in the e-mails.
Apache serves these files. A request for an existing file returns HTTP 200 OK; anything else returns HTTP 404 Not Found. This reproduces a valid reset link and an invalid one, and represents the spraying having happened, but only 50 times.
Step 5: fire the requests with HTTP pipelining
Now the main technique. HTTP is the language browsers and web servers use to talk to each other: the browser sends a request, the server sends a response. HTTP/1.1 is a version of that language. TCP is the underlying connection protocol that carries the conversation.
HTTP pipelining, as the researcher quotes from Wikipedia, is an HTTP/1.1 feature that allows multiple requests to be sent over a single TCP connection without waiting for the corresponding responses. Servers are required to respond correctly with non-pipelined but valid responses even if they do not support pipelining, though many legacy HTTP/1.1 servers do not, which is why most clients avoid it.
An everyday comparison: normally a conversation is one question, one answer, one question, one answer. Pipelining is asking ten questions in a row before listening to any of the answers. The time saved is the waiting time between each question and its answer, called the round trip time, or RTT.
The F5 article he also quotes describes it as "shoving" all the requests at the server at once to save the round trip time that would otherwise be spent waiting after each request.
He starts Apache, opens Burp, and configures Turbo Intruder with numbers_to_hunt_for.txt. He does not show the configuration, deliberately, so the post does not become a step-by-step tutorial. Testing locally, without accounting for network latency, he measured in the region of 10,500 requests per second from Turbo Intruder. Network latency is the delay caused by data travelling across a network; on a real internet connection it would slow things down compared with a test on one machine.
Step 6: watch the logs and find the token
Logs are the records a server keeps of what it has been asked for. Tailing the web server logs during the attack shows a stream of HTTP 404 responses scrolling past. Each one is the server telling the attacker that the supplied token is invalid.

Figure 7. View from the web server of invalid token requests, scrolling past at light speed.
Around 30 minutes later the needle is found: Burp shows an HTTP 200 for token 29792672, that is /resetpassword/29792672.

Figure 8. Turbo Intruder finding a valid token of "29792672" with a HTTP 200 OK response.
The server side view shows the same thing: a run of HTTP 404 responses followed by the valid token at the bottom returning HTTP 200.

Figure 9. View from the web server of invalid tokens (HTTP 404) followed by a valid token ("29792672") at the bottom (HTTP 200).
In the real world the next step is to connect using that token and set a new password for the user. In the real world the next step would be to connect using that token and set a new password for the user. The researcher also notes that on a real application there may be other active reset tokens already in the wild, triggered by genuine users, which this method could stumble upon.
Root cause
The tokens are not cryptographically random. They fall in a bounded numeric range consistent with a seeded pseudo-random generator. That alone reduces the search space, the set of possible values an attacker has to try.
But the decisive flaws are the two design issues identified earlier:
- Generating a new token does not invalidate the old one, so old tokens remain valid and the attacker can accumulate valid tokens by triggering resets.
- Tokens live for 10 hours, which gives a pipelined brute force far more time than it needs.
A brute force attack is simply trying many possibilities until one works. The researcher describes the failure to nuke the old token as "the great fail" in this example, and the expiry time as the other contributing factor.
Impact
An attacker who can trigger password resets for a victim account and then enumerate the token range can obtain a valid reset token and set a new password, taking over the account.
The attack requires the ability to request resets repeatedly, and it is not quiet: the victim would be spammed with reset e-mails and the server does substantial work, with potential for denial of service. The 10 hour validity window and the retention of old tokens are what make the enumeration feasible within the token lifetime. The researcher also notes that tokens belonging to genuine users may be found along the way.
Fix
Reset tokens should be random and unique, using the secure facilities the framework provides. A framework here means the software library the application is built on; most of them include tested, secure ways to generate random values.
When a new token is generated, the old one must be invalidated. Token expiry should be reduced substantially, to something like an hour, or as little as 5 minutes depending on the criticality of the application and the threat model, which is a description of who might attack you and what they could gain.
Variants to test
If you are testing a password reset feature yourself, these are the checks the researcher's story suggests:
- Token invalidation on reissue. Request several resets for one account and try each older token. A positive result is any older token still returning a valid reset page or
HTTP 200. - Token lifetime. Record when a token is issued and test it at intervals. A positive result is a token still accepted well beyond a sensible window, here 10 hours.
- Token predictability. Collect a sample of tokens, sort them numerically, and look at the range and distribution. A positive result is a bounded numeric range consistent with a seeded PRNG rather than high-entropy random values. Entropy here means the amount of unpredictability in a value.
- Enumeration speed. Point a pipelining-capable tool such as Turbo Intruder at a candidate token list against a test instance. A positive result is a throughput high enough to cover the range within the token lifetime, as with the roughly 10,500 requests per second measured here.
- Response oracle. Check whether a valid token and an invalid token are distinguishable by status code alone, as
HTTP 200versusHTTP 404here. An oracle in security means any signal that tells an attacker whether a guess was right. A positive result is a clean, automatable difference. - Tokens of genuine users. On a live application, run the enumeration while real users are active. A positive result is a valid token that does not belong to the test account.
Glossary
- Account takeover: gaining control of someone else's account, usually by obtaining their credentials or a valid reset token.
- Apache: a widely used web server program that serves files and pages over HTTP.
- API: an interface that lets one program talk to another; here, the web endpoints the browser and tools send requests to.
- Bash: a command line shell, a program where you type commands for the computer to run.
- Black box: testing where you can only send inputs and observe outputs, without seeing the code inside.
- Brute force: trying many possible values until one works.
- Burp Suite: a tool security testers use to intercept, inspect and modify web traffic.
- Control group: the unchanged baseline sample in an experiment, used for comparison.
- Cryptographically random: produced in a way designed so the value cannot be predicted or reproduced.
- Denial of service (DoS): making a service unavailable or unusable, for example by flooding it with requests.
- Entropy: the amount of unpredictability in a value; more entropy means harder to guess.
- File extension: the part of a filename after the dot, such as
.txt, which hints at the file type. - Framework: a software library an application is built on, which usually provides ready-made secure functions.
- Heap: the area of memory a program uses for data it creates while running.
- Heap spraying: a technique that fills large blocks of memory with chosen values so a predictable sequence ends up at a predictable place; here, the same idea applied to creating many valid tokens.
- HMAC: a way of signing a value so the server can verify it has not been tampered with.
- HTTP: the language browsers and web servers use to exchange requests and responses.
- HTTP/1.1: a version of HTTP.
- HTTP pipelining: an HTTP/1.1 feature that sends multiple requests over one connection without waiting for each response.
- HTTP 200 OK: a status code meaning the request succeeded and the content is being returned.
- HTTP 404 Not Found: a status code meaning there is nothing at the requested address.
- Logs: records a server keeps of the requests it has received.
- Loop: a programming instruction that repeats a block of code.
- Network latency: the delay caused by data travelling across a network.
- Oracle: any signal that tells an attacker whether a guess was correct.
- Password reset DoS: a denial of service caused by repeatedly triggering password resets, often because a new temporary password is issued immediately.
- PRNG (pseudo-random number generator): a program that produces numbers that look random but follow a fixed recipe and can be reproduced.
- Proof of concept: a demonstration that an attack is possible, usually in a controlled setup.
- Python: a programming language commonly used for scripting and generating data.
- Round trip time (RTT): the time it takes for a request to reach the server and the response to come back.
- Search space: the set of all possible values an attacker might have to try.
- Seed: the starting value that determines the sequence a pseudo-random number generator produces.
seq: a command line program that prints a sequence of numbers.sort -n: a command that sorts lines, comparing them as numbers rather than text.srand(): a C function that sets the seed for the standard random number generator.- Status code: a short number a web server sends with each response, such as 200 or 404.
- TCP: the underlying connection protocol that carries HTTP conversations.
- Threat model: a description of who might attack a system and what they could gain.
- Token: a value that is hard to guess and tied to one request, used to prove identity or authorise an action.
- Turbo Intruder: a Burp Suite extension that sends very large numbers of requests very quickly.
- Web root: the directory on a server whose contents are made available over the web.