Skip to content
Account takeover Write-up Beginner

How I hacked all the [REDACT] Agents accounts

The POS application used by agents had a predictable user ID format and many accounts used a default password, allowing an attacker to log in to thousands of agent accounts and access sensitive personal and customer data.

Neeraj Sonaniya Follow

Published on medium.com

Bounty$100 View original

The sole purpose of this article is educationaland for testing of your own applications. This is not intended for piracy or any other non-legal use.

Neeraj Sonaniya, on medium.com

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.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 6 min read.

Context

The target is a POS (point of sale) application used by agents of a telecom-style company, whose name the researcher withholds as [REDACT]. Agents use the app for top-ups and SIM activation. When an agent registers, they submit identity documents such as an Aadhar card, address proof ID and voter ID. After verification the company issues the agent a USER ID and a USER PASSWORD.

The USER ID is a 10-digit number that starts with 068, so it looks like 068XXXXXXX, where each X is a digit from 0 to 9. That predictable, sequential format is the foundation of everything that follows: once you know the prefix and the length, the whole agent population becomes an enumerable keyspace.

The report does not name the application version, the backend framework or the API host.

Setup

The researcher needed two things before testing: a working copy of the POS application and a way to see its traffic. The app was downloaded, and a proxy was configured to intercept requests from it with Burpsuite, following the standard Android CA certificate setup linked in the write-up.

The credentials side came from people, not from the app. The researcher found a person working with the same company as a retailer and was told their POS password, of the form Zxq@1XXX. A second person using the application gave the same password. Two independent agents sharing one password pattern is the signal that the value is a default rather than a personal choice.

No account of the researcher's own was described as being used for the enumeration; the login request captured from the app was replayed against other agents' IDs.

Finding it

Two observations combined into a hypothesis:

  1. Agent USER IDs are 10-digit numbers beginning with 068, so they can be generated rather than discovered.
  2. At least two agents used the same password pattern, Zxq@1XXX, which suggests a default assigned at registration.

If both hold, then a login endpoint that accepts a UserID and a password can be brute-forced across the ID space with a single password guess per ID. The researcher downloaded the POS application and set up the proxy to capture the login request the app sends.

Exploitation

Step 1: Capture the login request

With the proxy in place, the app's authentication request was captured in Burpsuite:

From the original on medium.com

The screenshot shows the captured request. In it, MacID is the device Media Access Control ID of the device. The request therefore carries the UserID, the password and a device identifier; the report does not say whether the server validates the MacID against anything.

Step 2: Enumerate the last four digits

The captured request was sent to Burpsuite Intruder, with the last 4 digits of the UserID as the payload position and the default password fixed for every attempt. This covers IDs of the form 068XXXXXX plus four varying digits.

The responses were distinguished by length:

  • Response length around 9500: sign-in success.
  • Response length around 330: sign-in failure.
From the original on medium.com

The screenshot shows the Intruder results with the two response lengths. Roughly 3000 IDs out of 9000 had the default password.

Step 3: Widen to the last six digits

The Intruder request was then reconfigured to vary the last 6 digits of the UserID, again with the default password. This found approximately 26,000 accounts out of 90,000 vulnerable to the same default-credential login.

Step 4: What the authenticated session exposed

Once logged in as an agent, the account returned:

  • Aadhar card numbers
  • Email addresses
  • The agent's account secret keys
  • Permanent address
  • Mobile number
  • Customer details, including the people the agent had recharged
  • The agent's documents, in PDF format
  • "and many more"

Step 5: Disclosure

HackerOne's Disclosure Assistance Program helped reach the company. The company awarded a bounty of 100 USD, which the researcher considered insufficient for the exposure described.

From the original on medium.com

The screenshot accompanies the researcher's list of what a bad guy could do with the data: log in to any agent's account and read customer and agent details, download all verification documents as PDFs, sell the data on the black market, and top up any mobile number on any network from any agent's account.

The researcher also describes a later exchange: after submitting a private write-up and asking whether it could be shared, a call came from the company's Vice President of Security, who threatened a complaint to the Cyber Crime investigation department if the issue were disclosed publicly and stated that the company held logs of the brute-forcing from the researcher's IP address. The researcher says the VP promised to help his career and then did not reply to messages.

Root cause

The design flaw is a default password shared across agent accounts, combined with a predictable, sequential User ID. Neither element is dangerous alone; together they turn authentication into a single-guess-per-account problem across the entire agent population.

The login request includes MacID, but the report gives no indication that the server tied a session to a known device.

Impact

Under the conditions shown, anyone who can reach the login endpoint and knows the default password can authenticate as any agent still using it: roughly 3000 of 9000 in the four-digit sweep and roughly 26,000 of 90,000 in the six-digit sweep. From such a session an attacker can read the agent's identity documents, Aadhar numbers, address, email, mobile number, account secret keys and the details of customers the agent recharged, and can perform top-ups on any network from the agent's account. The researcher notes the data could be sold on the black market.

The report does not quantify financial loss or state how many of the vulnerable accounts were actually accessed by others.

Fix

What the findings call for:

  • Replace the shared default password with a per-account secret that must be changed at first login, and force a reset for every account still holding the default.
  • Stop using a sequential, guessable User ID as the sole account identifier, or add a second factor that is not derivable from it.
  • Add server-side rate limiting, lockout and anomaly detection on the login endpoint, keyed by account and by source, so that a single password tried against thousands of IDs is blocked.
  • If MacID is collected, bind sessions to it server-side, or drop it.
  • Restrict access to stored identity documents and secret keys to the minimum needed, and log reads.

Variants to test

  1. Default password with a predictable identifier. On any agent, reseller or retailer portal, register one account, note the ID format, and try the password you were issued against neighbouring IDs. A positive result is a successful login on an ID you do not own.
  2. Response-length or status oracle. Send the same login request with a wrong password and with a correct one and compare body length, status code and timing. A stable, distinguishable difference means the endpoint can be enumerated even without a default password.
  3. Device identifier trust. Capture a login request containing a device ID or fingerprint, replay it from a different device or with the field altered, and see whether the session is still issued. A positive result is a valid session with a mismatched or missing device ID.
  4. Password pattern reuse. Collect the passwords issued to several accounts in the same programme and check whether they share a prefix or structure. A positive result is a common pattern that reduces the guess space to a few characters.
  5. Post-login data exposure. After authenticating as a low-privilege agent, request the document, key and customer endpoints directly and check whether they return data beyond what the agent needs. A positive result is identity documents or customer records in the response.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 11 min read.

What happened, in plain words

A security researcher found that a company's mobile app for its sales agents could be logged into with a password that many agents shared, and that agent account numbers followed a simple pattern. By trying that one password against thousands of account numbers, he could sign in to thousands of agent accounts. Once inside, he could see the agents' identity documents, addresses, phone numbers, email addresses, secret keys and details of the customers those agents had served, and could top up any mobile number from the agent's account. The company paid a 100 USD bounty and, according to the researcher, later threatened him when he asked to publish his write-up.

This article walks through the same story for someone who has never done security testing. Every technical idea is explained from scratch the first time it appears.

The target: a POS app for agents

The company, whose name the researcher hides as [REDACT], runs a POS application. POS stands for point of sale: software used at the counter to carry out transactions. In this case the app is used by the company's agents for top-ups (adding credit to a mobile number) and SIM activation (switching on a new mobile SIM card).

To become an agent, a person registers with the company and submits identity documents: an Aadhar card (India's national identity card), an address proof ID and a voter ID. After the company verifies those documents, it gives the agent a USER ID and a USER PASSWORD for the app.

Two facts about the USER ID matter for everything that follows:

  • It is a 10-digit number.
  • It always starts with 068.

So an agent's USER ID looks like 068XXXXXXX, where each X is any digit from 0 to 9. That is a very regular shape. If you know the prefix and the length, you can write down every possible ID without ever meeting an agent. Security people call the full set of possible values a keyspace: the range of keys you would have to try. A predictable ID format turns the whole population of agents into a list you can generate yourself.

The report does not name the app version, the technology behind it, or the address of the server it talks to.

Getting ready to look at the app's traffic

Before testing, the researcher needed two things: a copy of the POS app, and a way to see the messages it sends to the company's server.

When a mobile app talks to a server, it sends requests over the internet and receives responses. Normally you cannot see them. A proxy is a program that sits between the app and the server, like a post office clerk who opens every letter, copies it, and then sends it on. The researcher used Burpsuite, a popular proxy tool for security testing, and followed the standard instructions for making an Android phone trust the proxy (the link in the write-up points to PortSwigger's guide for installing a CA certificate on an Android device). A CA certificate is what lets the phone accept the proxy as a trusted middleman; without it, the app would refuse to send its traffic through the proxy.

The password side of the story did not come from the app at all. It came from people. The researcher found someone who worked with the same company as a retailer and asked what password they used for the POS application. The answer was a password of the form Zxq@1XXX. He then found a second person using the application, and that person gave the same password.

Two different agents using exactly the same password is a strong hint. People rarely pick identical passwords by coincidence. It suggests the company hands out this password as a default: a starting password assigned automatically at registration, which the agent is expected to change (or perhaps never told to change). A default password is like a new door lock that comes with the same factory key for every door in the building.

The report does not say whose account the captured login request came from; it was replayed against other agents' IDs.

Putting two observations together

Two observations combined into a single idea:

  1. Agent USER IDs are 10-digit numbers beginning with 068, so they can be generated rather than discovered.
  2. At least two agents used the same password pattern, Zxq@1XXX, which suggests a default assigned at registration.

If both are true, then the login screen, which accepts a UserID and a password, can be attacked across the whole ID space with a single password guess per ID. Trying many passwords against one account is called brute force; here it is a variation, one password against many accounts. The researcher downloaded the POS application and set up the proxy to capture the login request the app sends.

Step 1: Capture the login request

With the proxy in place, the app's authentication request was captured in Burpsuite:

From the original on medium.com

The screenshot shows the captured request. In it, MacID is the device Media Access Control ID of the device. A MAC address is a hardware identifier burned into a phone or computer's network chip; it looks like a long string of letters and numbers and is meant to identify the physical device on a local network.

So the login request carries three things: the UserID, the password, and a device identifier. That matters later: if the server really tied each session to a known device, replaying the request from elsewhere would fail.

Step 2: Try the last four digits

The captured request was sent to Burpsuite Intruder. Intruder is the part of Burpsuite that takes a request and repeats it many times, each time swapping one part for a different value from a list. Think of it as a machine that fills in one blank on a form over and over, automatically.

Here the blank was the last 4 digits of the UserID, and the default password was fixed for every attempt. This covers IDs of the form 068XXXXXX plus four varying digits: the first six digits stay as they are, and the final four run through every combination.

The responses were told apart by their length, meaning how many bytes of data came back. That is a common trick: a successful login usually returns a bigger page (the account dashboard, the agent's details) than a failed one (a short error message).

  • Response length around 9500: sign-in success.
  • Response length around 330: sign-in failure.
From the original on medium.com

The screenshot shows the Intruder results with the two response lengths. Roughly 3000 IDs out of 9000 had the default password. In other words, about one in three of the accounts tried still used the password the company had given them.

Step 3: Widen to the last six digits

The Intruder request was then reconfigured to vary the last 6 digits of the UserID, again with the default password. This covers a much larger slice of the ID space. It found approximately 26,000 accounts out of 90,000 vulnerable to the same default-credential login.

Step 4: What the logged-in session exposed

Once logged in as an agent, the account returned:

  • Aadhar card numbers
  • Email addresses
  • The agent's account secret keys
  • Permanent address
  • Mobile number
  • Customer details, including the people the agent had recharged
  • The agent's documents, in PDF format
  • "and many more"

A secret key here is a piece of confidential data tied to the account, the kind of value that is supposed to prove identity or authorise actions. If someone else can read it, they may be able to act as the account holder elsewhere.

Step 5: Telling the company

The researcher contacted the company through Twitter and email and received no response. HackerOne is a platform where security researchers report bugs to companies and coordinate the process; its Disclosure Assistance Program helped reach the company when direct contact failed. The company awarded a bounty of 100 USD, which the researcher considered insufficient for the exposure described.

From the original on medium.com

The screenshot accompanies the researcher's list of what a bad guy could do with the data:

  1. Log in to any agent's account and read customer and agent details.
  2. Download all the verification documents as PDFs.
  3. Sell the data on the black market.
  4. Top up any mobile number on any network from any agent's account.

The researcher also describes a later exchange. After submitting a private write-up and asking whether it could be shared, a call came from the company's Vice President of Security. According to the researcher, that person threatened a complaint to the Cyber Crime investigation department if the issue were disclosed publicly, and stated that the company held logs of the brute-forcing from the researcher's IP address. An IP address is the number that identifies a connection on the internet, roughly like a return address on an envelope. The researcher says the VP promised to help his career and then did not reply to messages.

Why it worked

The design flaw is a default password shared across agent accounts, combined with a predictable, sequential User ID. Neither element is dangerous alone. A shared password is bad, but if IDs were random and unguessable, an attacker could not find the accounts to try it on. A guessable ID is bad, but if every account had its own strong password, knowing the ID would not help. Together they turn authentication into a single-guess-per-account problem across the entire agent population.

The login request includes MacID, but the report gives no indication that the server tied a session to a known device.

What an attacker could do

Under the conditions shown, anyone who can reach the login endpoint and knows the default password can authenticate as any agent still using it: roughly 3000 of 9000 in the four-digit sweep and roughly 26,000 of 90,000 in the six-digit sweep. From such a session an attacker can read the agent's identity documents, Aadhar numbers, address, email, mobile number, account secret keys and the details of customers the agent recharged, and can perform top-ups on any network from the agent's account. The researcher notes the data could be sold on the black market.

The report does not quantify financial loss or state how many of the vulnerable accounts were actually accessed by others.

What should be fixed

What the findings call for:

  • Replace the shared default password with a per-account secret that must be changed at first login, and force a reset for every account still holding the default.
  • Stop using a sequential, guessable User ID as the sole account identifier, or add a second factor that is not derivable from it.
  • Add server-side rate limiting, lockout and anomaly detection on the login endpoint, keyed by account and by source, so that a single password tried against thousands of IDs is blocked.
  • If MacID is collected, bind sessions to it server-side, or drop it.
  • Restrict access to stored identity documents and secret keys to the minimum needed, and log reads.

Similar things to test on other sites

  1. Default password with a predictable identifier. On any agent, reseller or retailer portal, register one account, note the ID format, and try the password you were issued against neighbouring IDs. A positive result is a successful login on an ID you do not own.
  2. Response-length or status oracle. Send the same login request with a wrong password and with a correct one and compare body length, status code and timing. A stable, distinguishable difference means the endpoint can be enumerated even without a default password. An oracle here means any observable difference that leaks information.
  3. Device identifier trust. Capture a login request containing a device ID or fingerprint, replay it from a different device or with the field altered, and see whether the session is still issued. A positive result is a valid session with a mismatched or missing device ID.
  4. Password pattern reuse. Collect the passwords issued to several accounts in the same programme and check whether they share a prefix or structure. A positive result is a common pattern that reduces the guess space to a few characters.
  5. Post-login data exposure. After authenticating as a low-privilege agent, request the document, key and customer endpoints directly and check whether they return data beyond what the agent needs. A positive result is identity documents or customer records in the response.

Glossary

  • Aadhar card: India's national identity card, carrying a unique number.
  • API: the set of addresses and rules a program uses to talk to a server; here, the login and data requests the app sends.
  • Brute force: trying many values automatically until one works.
  • Burpsuite: a proxy tool used by security testers to capture, inspect and replay web traffic.
  • CA certificate: a certificate that lets a device trust a proxy as a middleman for encrypted traffic.
  • CAPTCHA: a puzzle meant to prove a human, not a script, is making a request.
  • Default password: a starting password assigned automatically, often the same for many accounts.
  • Endpoint: a specific address on a server that accepts a particular kind of request, such as a login endpoint.
  • Enumeration: systematically walking through a list of possible values, such as account IDs.
  • Intruder: the Burpsuite component that repeats a request many times with different values in one position.
  • IP address: the number identifying a connection on the internet.
  • Keyspace: the full set of possible values an attacker would have to try.
  • Lockout: temporarily blocking an account after too many failed attempts.
  • MAC address (MacID): a hardware identifier for a device's network chip.
  • Oracle: any observable difference in a response that leaks information, such as length or timing.
  • POS (point of sale): software used at a counter to carry out transactions such as top-ups and SIM activation.
  • Proxy: a program that sits between a client and a server and can inspect the traffic.
  • Rate limiting: a cap on how many requests a client may make in a given time.
  • Request / response: the message a client sends to a server, and the message the server sends back.
  • Secret key: confidential data tied to an account, used to prove identity or authorise actions.
  • Session: the state of being logged in, kept alive by the server after a successful login.
  • Top-up: adding credit to a mobile number.
  • USER ID: the account identifier issued to each agent, here a 10-digit number starting with 068.

More by Neeraj Sonaniya

View all

3 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Account takeover

The lesson behind this report.

Getting into someone else's account through a flaw in sign-in, password reset, second factor, single sign-on or session handling.