Hacking a Telecommunication company(MTN)
The MTN web application used a 4-digit OTP for login and did not limit the number of attempts, so an attacker could brute-force the code. By using a fast request tool, the author guessed the correct OTP within a minute and logged into their own account.
#### Afolic
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
MTN Group Limited is a South African multinational telecommunications company operating across Africa, Europe and Asia, with its head office in Johannesburg. As of 30 June 2016 it recorded 232.6 million subscribers, making it the eighth largest mobile network operator in the world and the largest in Africa. It is active in over 20 countries, and one third of company revenue comes from Nigeria, where it holds about 35% market share.

The target of this write-up is the MTN Nigeria web application. The feature in question is account login: a user visits the main MTN Nigeria site, clicks the login button, and is redirected to the account portal, where they enter a phone number. The application then sends a one-time password (OTP) by SMS to that number, and the user is authenticated on the web application only after entering the correct OTP. The researcher found that this flow could be abused to take over any MTN user's web account through their phone number.
The vulnerability class is CWE-307, Improper Restriction of Excessive Authentication Attempts: the application fails to limit or restrict the number of authentication trials that can be attempted against its server.
Setup
The work was done around December 2019. The researcher used his own MTN web account and Burp Suite, with the browser configured so that requests from MTN were logged in Burp. Burp Suite Intruder was used first, and later the Turbo Intruder extension, a Burp Suite plugin written by James Kettle that performs the same job as Intruder at higher speed. A wordlist of all possible 4 digit combinations was prepared. No special role or privileged account was needed: the only precondition was the ability to reach the login page and receive an OTP on a number the researcher controlled.
Finding it
The researcher had wanted to test MTN's security for some time. One night, with a low PC battery, he decided to check a sub-domain of the MTN web application because his mid-night data bundle was exhausted and every site he visited redirected him there to buy a new data plan. Within 15 minutes of testing he found a SQL injection on that sub-domain, which encouraged him to keep looking. A few days later he tested the main MTN Nigeria website and found the account takeover described here.
The observation that started it was simple: the OTP sent to the phone number was only 4 digits. A 4 digit code has a small enough keyspace to be brute forced, so the question was whether the application restricted the number of attempts. It did not: there was no protection against brute forcing, and the application relied solely on the OTP expiring. That made it possible for an attacker to brute force an OTP without getting blocked, provided the guessing was fast enough to finish before expiry.
Exploitation
Step 1: Reach the login flow
The researcher visited the main MTN Nigeria site:
https://www.mtnonline.com/
Scrolling down the page, he clicked the button to log in to his MTN account. The button redirected him to the account portal:
https://mymtn.com.ng/
On that page he was asked to enter a phone number, after which an OTP code was sent to that number. Entering his phone number, he received a 4 digit OTP by SMS.
Step 2: Capture the OTP request
He fired up Burp Suite and configured his browser so that any request from MTN was logged in Burp. He then created a wordlist of all possible 4 digit combinations. With intercept turned on in Burp, he went back to the web application, intentionally entered a wrong OTP code and sent the request. He switched to Burp, captured the OTP request, right clicked it and sent it to Intruder.
Step 3: First brute force attempt with Intruder
Running Intruder against the captured request, he kept getting an error message saying the session ID had expired. He requested another OTP code and tried again, and got the same error. The conclusion was that the OTP does expire, and that Burp Suite Intruder was not fast enough to find the right code within that time constraint.
Step 4: Brute force with Turbo Intruder
He installed Turbo Intruder and repeated the process, this time sending the captured request to Turbo Intruder instead of Intruder. After about a minute, Turbo Intruder brute forced the correct OTP code and he was logged in to his MTN web account.
Step 5: Report and timeline
He wrote a vulnerability report and submitted it through the bug bounty programme on HackerOne. The timeline was:
| Event | Date |
|---|---|
| Initial report submitted | 18 December 2019 |
| Report triaged by an MTN staff member | a few minutes later |
| Vulnerability fixed, researcher asked to confirm the fix | 19 December 2019 |
| Fix confirmed by the researcher | a few minutes later |
Root cause
The login flow authenticates a user solely on possession of the OTP delivered to their phone number. The application implemented no form of protection against brute forcing and relied on the OTP expiring as its only defence. Expiry bounds the window in which guesses are useful, but it does not bound the number of guesses: if the endpoint accepts requests fast enough, the whole 4 digit keyspace can be covered inside that window. The obstacle the researcher hit was the throughput of his tooling against the OTP expiry window, and switching to a faster tool removed it. The short 4 digit length made the keyspace small enough for this to succeed in about a minute.
Impact
An attacker who knows a victim's phone number could take over that victim's MTN web account by brute forcing the OTP sent to it, without being blocked. The researcher describes the issue as one that could have allowed him to take over any MTN user web account through their phone number. The attack depends on completing the guesses before the OTP expires, which in practice requires tooling fast enough to cover the keyspace within that window.
Fix
On 19 December 2019 the researcher was asked to confirm the fix, and he confirmed it a few minutes later. The researcher notes that a lot of changes have been made to the MTN web application since the finding. In the current behaviour, when someone tries to brute force an OTP code, the victim receives a text message notifying them that a brute force attack is going on, the attacker is blocked for some time, and the OTP code sent is now 6 digits instead of the previous 4. Something similar to this:

Variants to test
- OTP length and keyspace. Check the length of OTPs on other login and verification flows. A positive result is a short numeric code (4 digits or similar) combined with an endpoint that accepts many attempts.
- Rate limiting on the verification endpoint. Send repeated wrong OTPs for one session and watch for blocking, lockout or error responses. A positive result is a long run of ordinary wrong-code responses with no throttling.
- Session expiry versus attempt speed. Measure how long an OTP stays valid and how many requests per second the endpoint sustains. A positive result is enough throughput to cover the keyspace before expiry, as happened here with Turbo Intruder.
- Notification and lockout behaviour. Check whether the account owner is told about failed attempts and whether the attacker is blocked after a threshold. A positive result is silent, unlimited guessing.
- Other OTP-protected actions. Apply the same test to password reset, registration confirmation and transaction confirmation flows that use SMS OTPs, since the same verification logic is often reused.
What happened, in plain words
A security researcher found a way to log in to any MTN Nigeria customer's web account using only that customer's phone number. MTN is a large mobile phone company. When you want to log in to your MTN account on their website, MTN does not ask for a password. Instead, it sends a short number to your phone by text message. You type that number into the website, and if it matches, you are logged in. That short number is called a one-time password, or OTP.
The problem was that the OTP was only 4 digits long, and the website put no limit on how many times someone could guess it. A 4 digit code only has 10,000 possible values (0000 through 9999). A computer can try all of them very quickly. The only thing standing in the way was that the code expires after a short time, so you have to guess fast. The researcher used a tool that sends many guesses per second, and within about a minute it found the right code. He was then logged in as the account owner.
He reported it to MTN through their bug bounty programme, and the next day he was asked to confirm the fix. This article walks through the whole story from the beginning, explaining every term as it comes up.
The company and the target
MTN Group Limited, formerly called M-Cell, is a South African multinational telecommunications company. It operates in many African, European and Asian countries, and its head office is in Johannesburg. As of 30 June 2016 it had 232.6 million subscribers, which made it the eighth largest mobile network operator in the world and the largest in Africa. It is active in over 20 countries, and one third of the company's revenue comes from Nigeria, where it holds about 35% of the market.

A mobile network operator is a company that runs a mobile phone network: it sells SIM cards, connects calls and provides mobile data. A subscriber is a customer with a phone number on that network.
The target here is the MTN Nigeria website, specifically the login feature. Here is how that feature works, step by step:
- You go to the main MTN Nigeria website.
- You click a button to log in to your MTN account.
- The site sends you to a separate account portal (a different web address that handles accounts).
- On that portal you type your phone number.
- MTN sends a one-time password (OTP) to that phone number by SMS.
- You type the OTP into the website.
- Only if the OTP is correct are you logged in.
An SMS is a text message sent to a phone number. An OTP (one-time password) is a short code that is valid for one login and then expires. The idea is that only the person holding the phone can read the code, so only that person can log in. This is often called two-factor authentication when combined with a password, but here it is the only factor: the OTP alone is enough.
The researcher found that this login flow could be abused to take over any MTN user's web account, using only their phone number.
The vulnerability class
The vulnerability is classified as CWE-307, which stands for "Improper Restriction of Excessive Authentication Attempts". CWE is a public catalogue of common software weaknesses, each with an ID number. This particular weakness means the application does not limit how many times someone can try to log in or verify a code.
A simple comparison: imagine a door with a keypad lock. If the lock lets you try as many codes as you like, as fast as you like, and never locks you out, then eventually you will hit the right code. A well-designed lock stops accepting attempts after a few wrong ones, or makes you wait between tries. The MTN login page was like the first kind of lock.
In this case, the application had no protection against brute forcing. Brute forcing means trying every possible value until one works. The application relied only on the OTP expiring. Expiry means the code stops being valid after some time. That limits how long you can guess, but it does not limit how many guesses you can make in that time. If your tool is fast enough, you can try the whole set of possible codes before the code expires.
Setting up
The work was done around December 2019. The researcher had an MTN web account. He used a tool called Burp Suite, which is a program that sits between your browser and a website and lets you see and change every request your browser sends. A request is the message your browser sends to a web server asking for a page or asking it to do something (like "check this OTP"). A response is what the server sends back.
To use Burp Suite, you configure your browser to send all its traffic through Burp instead of directly to the website. Burp then shows you each request and response, and lets you pause, edit and resend them. This is called a proxy: a middleman that forwards traffic.
He also used a feature of Burp Suite called Intruder, which takes a captured request and automatically sends it many times with different values in a chosen position (for example, trying every possible OTP). Later he switched to Turbo Intruder, an extension (plugin) for Burp Suite written by James Kettle. Turbo Intruder does the same job as Intruder but much faster.
He prepared a wordlist of all possible 4 digit combinations. A wordlist is simply a text file with one candidate value per line. For 4 digits, that is 0000, 0001, 0002, and so on up to 9999, which is 10,000 lines.
No special account or privileged role was needed. The only precondition was being able to reach the login page and receive an OTP on a phone number he controlled.
How he found it
The researcher had wanted to test MTN's security for some time. One night his PC battery was running low, so he quickly decided to check a sub-domain of the MTN web application. A sub-domain is a web address that is part of a larger site, for example something.mtn.com is a sub-domain of mtn.com. He chose that sub-domain because his mid-night data bundle was exhausted, and every website he visited redirected him there to buy a new data plan. A data bundle is a prepaid package of mobile internet.
Within 15 minutes of testing that sub-domain, he found a SQL injection. SQL injection is a flaw where user input is inserted into a database query in a way that lets an attacker change the query. A database is where a website stores its data, and SQL is the language used to ask it questions. Finding that encouraged him to keep looking. A few days later he tested the main MTN Nigeria website and found the account takeover described here.
The observation that started it was simple: the OTP sent to the phone number was only 4 digits. A 4 digit code has a small enough keyspace to be brute forced. The keyspace is the total set of possible values: here, 10,000. The question was whether the application restricted the number of attempts. It did not. There was no protection against brute forcing, and the application relied solely on the OTP expiring. That made it possible to brute force an OTP without getting blocked, provided the guessing was fast enough to finish before expiry.
Exploitation
Step 1: Reach the login flow
The researcher visited the main MTN Nigeria site:
https://www.mtnonline.com/
This is a URL, the address you type into a browser. https:// means the connection is encrypted. www.mtnonline.com is the domain name, the human-readable name of the server. Visiting it loaded the MTN webpage.
Scrolling down the page, he clicked the button to log in to his MTN account. The button redirected him to the account portal:
https://mymtn.com.ng/
A redirect is when one web address automatically sends your browser to another address. Here, the main site handed him off to a separate portal that handles accounts. mymtn.com.ng is a different domain from mtnonline.com, but both belong to MTN.
On that page he was asked to enter a phone number, after which an OTP code was sent to that number. Entering his phone number, he received a 4 digit OTP by SMS.
Step 2: Capture the OTP request
He fired up Burp Suite and configured his browser so that any request from MTN was logged in Burp. He then created a wordlist of all possible 4 digit combinations. With intercept turned on in Burp (a mode where Burp pauses each request so you can look at it before it is sent), he went back to the web application, intentionally entered a wrong OTP code and sent the request. He switched to Burp, captured the OTP request, right clicked it and sent it to Intruder.
Why enter a wrong code on purpose? Because he wanted to capture the exact request the browser sends when it checks an OTP. That request contains the structure the server expects: the address it goes to, the fields it carries, and any session information. By capturing it once, he could then replay it thousands of times with different OTP values, without touching the browser again.
A session is a short-lived record the server keeps about your visit, so it can remember who you are between requests. The browser holds a session ID (a long random string) and sends it with each request. If the session expires, the server no longer recognises the requests and rejects them.
Step 3: First brute force attempt with Intruder
Running Intruder against the captured request, he kept getting an error message saying the session ID had expired. He requested another OTP code and tried again, and got the same error. The conclusion was that the OTP does expire, and that Burp Suite Intruder was not fast enough to find the right code within that time constraint.
This is an important lesson. The code and the session both expire, which sets a deadline for guessing. But expiry only sets a deadline. If your tool can send enough guesses before the deadline, expiry does not save you. Intruder was too slow, so the deadline won. The obstacle was the speed of his tooling against the expiry window.
Step 4: Brute force with Turbo Intruder
He installed Turbo Intruder and repeated the process, this time sending the captured request to Turbo Intruder instead of Intruder. After about a minute, Turbo Intruder brute forced the correct OTP code and he was logged in to his MTN web account.
Turbo Intruder sends requests much faster than Intruder, so it could cover the 10,000 possible codes before the OTP expired. Once the right code was found, the server accepted it and the researcher was authenticated as the account owner. Authenticated means the server has accepted your proof of identity and treats you as logged in.
Step 5: Report and timeline
He wrote a vulnerability report and submitted it through the bug bounty programme on HackerOne. A bug bounty programme is a scheme where a company invites researchers to report security flaws and often pays a reward. HackerOne is a platform that hosts such programmes. Triaged means the company has reviewed the report and confirmed it is valid.
The timeline was:
| Event | Date |
|---|---|
| Initial report submitted | 18 December 2019 |
| Report triaged by an MTN staff member | a few minutes later |
| Vulnerability fixed, researcher asked to confirm the fix | 19 December 2019 |
| Fix confirmed by the researcher | a few minutes later |
Root cause
The login flow authenticates a user solely on possession of the OTP delivered to their phone number. The application implemented no form of protection against brute forcing and relied on the OTP expiring as its only defence. Expiry bounds the window in which guesses are useful, but it does not bound the number of guesses. If the endpoint accepts requests fast enough, the whole 4 digit keyspace can be covered inside that window. An endpoint is a specific address on a server that performs a particular action, such as checking an OTP. The only obstacle the researcher hit was the throughput of his tooling, not any control in the application, and switching to a faster tool removed it. The short 4 digit length made the keyspace small enough for this to succeed in about a minute.
Impact
An attacker who knows a victim's phone number could take over that victim's MTN web account by brute forcing the OTP sent to it, without being blocked. The researcher describes the issue as one that could have allowed him to take over any MTN user web account through their phone number. The attack depends on completing the guesses before the OTP expires, which in practice requires tooling fast enough to cover the keyspace within that window.
Fix
On 19 December 2019 the researcher was asked to confirm the fix, and he confirmed it a few minutes later. The researcher notes that a lot of changes have been made to the MTN web application since the finding. In the current behaviour, when someone tries to brute force an OTP code, the victim receives a text message notifying them that a brute force attack is going on, the attacker is blocked for some time, and the OTP code sent is now 6 digits instead of the previous 4. Something similar to this:

Each of these three changes matters. The notification tells the account owner something is wrong, so they can act. The temporary block (often called rate limiting or lockout) stops the guessing after a threshold. The longer code makes the keyspace much bigger: a 6 digit code has 1,000,000 possible values instead of 10,000, so even a fast tool needs far longer to cover it.
Variants to test
If you are learning to look for this kind of flaw, here are the same checks applied to other places. Each one describes what to look for and what a positive result looks like.
- OTP length and keyspace. Check the length of OTPs on other login and verification flows. A positive result is a short numeric code (4 digits or similar) combined with an endpoint that accepts many attempts.
- Rate limiting on the verification endpoint. Send repeated wrong OTPs for one session and watch for blocking, lockout or error responses. A positive result is a long run of ordinary wrong-code responses with no throttling.
- Session expiry versus attempt speed. Measure how long an OTP stays valid and how many requests per second the endpoint sustains. A positive result is enough throughput to cover the keyspace before expiry, as happened here with Turbo Intruder.
- Notification and lockout behaviour. Check whether the account owner is told about failed attempts and whether the attacker is blocked after a threshold. A positive result is silent, unlimited guessing.
- Other OTP-protected actions. Apply the same test to password reset, registration confirmation and transaction confirmation flows that use SMS OTPs, since the same verification logic is often reused.
Glossary
- Authentication: the process of proving who you are to a system, usually to log in.
- Brute forcing: trying every possible value of a secret until one works.
- Bug bounty programme: a scheme where a company invites researchers to report security flaws, often for a reward.
- Burp Suite: a tool that sits between your browser and a website so you can see, pause, edit and resend requests.
- CWE: a public catalogue of common software weaknesses, each with an ID number.
- CWE-307: the weakness ID for Improper Restriction of Excessive Authentication Attempts, meaning the app does not limit how many login or verification attempts can be made.
- Data bundle: a prepaid package of mobile internet.
- Database: where a website stores its data.
- Endpoint: a specific address on a server that performs a particular action.
- Expiry: the point at which a code or session stops being valid.
- HackerOne: a platform that hosts bug bounty programmes.
- HTTPS: the encrypted version of the protocol browsers use to talk to websites.
- Intercept: a Burp Suite mode that pauses each request so you can inspect it before it is sent.
- Intruder: a Burp Suite feature that resends a captured request many times with different values.
- Keyspace: the total set of possible values for a secret, such as 10,000 for a 4 digit code.
- Lockout: blocking an account or attacker after too many failed attempts.
- Mobile network operator: a company that runs a mobile phone network.
- OTP (one-time password): a short code valid for one login that then expires.
- Proxy: a middleman that forwards traffic between your browser and a website.
- Rate limiting: restricting how many requests can be made in a given time.
- Redirect: when one web address automatically sends your browser to another.
- Request: the message your browser sends to a server asking for a page or an action.
- Response: what the server sends back.
- Session: a short-lived record the server keeps about your visit so it can remember who you are.
- Session ID: a long random string the browser holds and sends with each request to identify the session.
- SMS: a text message sent to a phone number.
- SQL: the language used to ask a database questions.
- SQL injection: a flaw where user input changes a database query in a way the developer did not intend.
- Sub-domain: a web address that is part of a larger site.
- Subscriber: a customer with a phone number on a mobile network.
- Triaged: reviewed and confirmed as valid by the company.
- Turbo Intruder: a Burp Suite extension by James Kettle that does the same job as Intruder but much faster.
- Two-factor authentication: logging in with two different proofs, such as a password plus a code.
- URL: the address you type into a browser.
- Wordlist: a text file with one candidate value per line, used for guessing.