Skip to content
Info disclosure Write-up Beginner

#BugBounty How I Hack Billion $ Company

A directory search revealed a publicly accessible archive containing the company's full source code, including payment account details and owner identities. The author claims this allowed them to download the entire codebase and run a similar website.

Sadiq West Follow

Published on medium.com

Bounty$500 View original

A very simple to any pentester, but most ’em show no care about it and yet critical vulnerability to the company, i know it wasn’t very hard to discover but i am writing this one down just to express my methodology. So as always, I initiated with reconnaissance on this website, I’m not an expert and there will…

Sadiq West, 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 is a website the author refers to only as [REDACTED.COM], described as an online investment platform that presents itself as a Saudi Arabian based investment company. The author notes that the owners of the site hide their identity. The platform offers user sign-up and, according to the author, was vulnerable to several classes of issue, including XSS, IDOR and SQL injection. The feature that matters for this write-up is the web server's handling of directories and files: a directory that returned a large archive of the application's source code.

The author frames the finding as a directory listing / exposed file issue, reached through content discovery rather than through the application's own functionality.

Setup

  • A registered account on the platform, created by signing up.
  • The tool used for discovery is dirsearch, run against the target.
  • No specific version of dirsearch, browser or server is given in the report.
  • The author had spent over 30 days on the platform, which they say was vulnerable to XSS, SQL injection and IDOR.

The author states that the target is http://redacted.com and that the site name cannot be disclosed.

Finding it

The author's stated method is what they call "The power of Dirsearch": running a directory brute-force against the target after the earlier manual testing had produced only the XSS, SQL injection and IDOR. The reasoning given is that most researchers forget to do this, and that digging deeper into the web application tends to be fruitful.

The first dirsearch run produced three interesting lines:

Text
Target: http://redacted.com
[08:35:15] 200–87MB — /new -> http://redacted.com/new/
[08:35:15] 200–235B — /.git
[08:35:16] 200–235B — /plugins.log

What stands out is the size of the first result: a 200 response of 87MB at /new, redirecting to http://redacted.com/new/. A response that large from a directory path is unusual. The /.git and /plugins.log entries returned 200 with 235 bytes each, which the author lists but does not investigate further in the write-up.

The author says the directory surprised them, and that the 87MB file made them think the developers were either lazy or busy. A second dirsearch run identified the file name as web.zip.

source code From the original on medium.com

source code

From the original on medium.com

Exploitation

Step 1: Enumerate directories

Run dirsearch against the target. The report does not give the exact command line, only the output shown above. The relevant result is the 87MB 200 at /new, which redirects to /new/.

Step 2: Identify the file

A second dirsearch run revealed that the large file is named web.zip. The report does not show the request or the exact URL used to fetch it.

Step 3: Download and inspect the archive

The author downloaded web.zip and obtained the whole company source code, which they say allowed them to run a website similar to the platform. The archive is described as containing the company owners' identity and the company's Stripe, PayPal and RavePay account details.

an xss from the redacted From the original on medium.com

an xss from the redacted

From the original on medium.com
hacking the planet

hacking the planet

Step 4: Report

The author wrote a report and sent it to the company's email address. After seven days with no response, they reported it through the company's Telegram channel.

From the original on medium.com

The report gives the following timeline:

Event Date
Bug report 26/04/2018
Patched 1/05/2018
Bounty awarded 18/05/2018

The bounty is stated as $500,000 in the body of the write-up. The platform metadata for this write-up records $500.00 USD, so the two figures disagree; the report itself does not reconcile them.

Root cause

What can be said from the evidence is that a directory path, /new/, served a large archive, web.zip, containing the application's source code, and that the archive was reachable without any authentication step being described. The report does not document the cause. The /.git and /plugins.log entries returned 200 with 235 bytes each; the report does not investigate them further.

Why existing defences did not stop it is not stated in the report. A static file served from the document root bypasses application-level authorisation entirely, which is consistent with the author reaching it through directory enumeration rather than through a logged-in feature.

Impact

With the source code in hand, the author says they could run a website similar to the platform. The archive is described as containing the owners' identity and the company's Stripe, PayPal and RavePay account details. The author also notes that the platform was vulnerable to XSS, IDOR and SQL injection, found separately, but those are not demonstrated in this write-up.

Fix

The report states that the issue was patched on 1/05/2018 but does not say what was changed. What should be done, and what the report's evidence supports, is to remove build and deployment artefacts such as web.zip from any web-accessible directory, and to ensure that directories like /.git and log files such as /plugins.log are not served by the web server. Serving only the intended public files from the document root, and blocking access to archives, VCS metadata and logs at the server level, would address the exposure shown here.

Variants to test

  1. Run dirsearch (or any content discovery tool) against the target and look for 200 responses with unusually large sizes. A positive result is a directory or file returning a body far larger than a normal page, as with the 87MB /new entry here.
  2. Check for common archive names in web-accessible directories, such as web.zip, backup.zip, site.zip or source.zip. A positive result is a downloadable archive that extracts to application source.
  3. Request /.git and similar VCS paths. A positive result is a 200 response, as the report shows for /.git at 235 bytes, which can indicate exposed repository metadata.
  4. Request log files such as /plugins.log. A positive result is a 200 response containing log content, as the report shows at 235 bytes.
  5. Look for deployment directories such as /new/ that may hold a staged copy of the application. A positive result is a directory listing or a downloadable artefact inside it.
  6. After obtaining source, search it for payment integration credentials and identity data, which is what the author reports finding in web.zip.

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

What happened, in plain words

A security researcher spent over 30 days testing a website that presents itself as an online investment platform, said to be a Saudi Arabian based investment company. The owners of the site hide their identity, and the researcher refers to it only as [REDACTED.COM] because the name cannot be disclosed. During that time the researcher found an XSS, a SQL injection and an IDOR, but nothing bigger. Then they tried a simple technique that many people skip: asking the web server for lots of common folder and file names, one after another, to see which ones exist. That technique is called directory brute-force, and the tool used here is called dirsearch.

The scan turned up a folder called /new that answered with a file of 87MB. That is enormous for a web page, so the researcher looked closer, ran the scan again, and found the file was called web.zip. Downloading it gave the whole source code of the company's website: the files the developers wrote to build the platform. According to the researcher, that archive contained the company owners' identity and the company's Stripe, PayPal and RavePay account details. With the source code, the researcher says they could run a website similar to the platform.

The researcher emailed the company and got no reply within seven days, then reported it through the company's Telegram channel. The report gives a timeline: reported on 26/04/2018, patched on 1/05/2018, bounty awarded on 18/05/2018. The body of the write-up states a bounty of $500,000, while the platform metadata for this write-up records $500.00 USD. The two figures disagree and the report does not reconcile them.

This is a beginner's walkthrough of that story. Every step is explained from zero, including what the tools and terms mean, so you can follow it with nothing more than a browser and a computer.

Background: what the target is

The target is a website that offers user sign-up and presents itself as an online investment platform. The researcher signed up and tested it as a normal user would. The report says the platform was vulnerable to several kinds of issue, including XSS, IDOR and SQL injection, but those are not demonstrated in this write-up. The issue that matters here is how the web server handles folders and files: one folder handed out a large archive of the application's source code.

A quick word on the three issues named above, because they come up again:

  • XSS (cross-site scripting): a way of getting your own JavaScript to run inside another person's browser session on a site. Imagine someone slipping a note into a letter you are about to read, so that you follow instructions written by the attacker rather than the sender.
  • SQL injection: a way of sneaking database commands into a form or URL so the site's database runs them. Imagine writing extra instructions on a form and the clerk typing them into the computer as if they were part of the form.
  • IDOR (insecure direct object reference): a site that lets you change a number in a URL, such as ?id=5 to ?id=6, and shows you someone else's record. Imagine a hotel where every room key opens every door because the room number is the only check.

None of those is the bug in this write-up. The bug here is simpler: a file that should never have been public was sitting in a public folder, and the server happily served it to anyone who asked.

Setup: what you need

  • A registered account on the platform, created by signing up. The researcher had one because they had invested money there and kept visiting.
  • The tool used for discovery is dirsearch. It is a program that runs on your own computer and sends many requests to a website, one for each name in a list, to see which names exist. Think of it as trying every key on a big keyring in a door, one after another, and noting which ones turn.
  • No specific version of dirsearch, browser or server is given in the report.
  • The researcher had spent over 30 days on the platform, which they say was vulnerable to XSS, SQL injection and IDOR.

The researcher states the target is http://redacted.com and that the site name cannot be disclosed.

Finding it

The researcher's stated method is what they call "The power of Dirsearch": running a directory brute-force against the target after the earlier manual testing had produced only the XSS, SQL injection and IDOR. The reasoning is that most researchers forget to do this, and that digging deeper into the web application tends to be fruitful.

Why does this work? A website is made of files and folders on a server, much like folders on your own computer. Some of those folders are meant to be public, such as the ones holding images and pages. Others are not: backups, logs, source code, configuration. The server does not always know the difference. If a folder is reachable from the internet and the server is set to hand out whatever is inside it, then anyone who guesses the name can download it. dirsearch is simply a fast way of guessing names.

The first dirsearch run produced three interesting lines:

Text
Target: http://redacted.com
[08:35:15] 200–87MB — /new -> http://redacted.com/new/
[08:35:15] 200–235B — /.git
[08:35:16] 200–235B — /plugins.log

Line by line:

  • Target: http://redacted.com is the address being scanned. http:// is the unencrypted version of the web protocol; https:// is the encrypted one. The report uses http:// here.
  • [08:35:15] 200–87MB — /new -> http://redacted.com/new/ means: at 08:35:15, the server answered with status code 200 and a body of 87MB for the path /new, and that path redirects to http://redacted.com/new/. A status code is the three-digit number a server sends back with every answer. 200 means "here you go, everything is fine". A redirect means "the thing you asked for is actually over there, go look at that address instead".
  • [08:35:15] 200–235B — /.git means the path /.git also answered 200, with a body of 235 bytes. .git is the hidden folder that version control software Git uses to store the history of a project. It is never meant to be public, because it can contain the whole history of the code.
  • [08:35:16] 200–235B — /plugins.log means a log file, plugins.log, also answered 200 with 235 bytes. A log file is a running diary a program writes as it works. Logs can contain all sorts of internal detail and are not meant to be downloadable.

What stands out is the size of the first result: a 200 response of 87MB at /new, redirecting to http://redacted.com/new/. A response that large from a folder path is unusual. For comparison, a normal web page is measured in kilobytes, and 87MB is thousands of times larger. The /.git and /plugins.log entries returned 200 with 235 bytes each, which the researcher lists but does not investigate further in the write-up.

The researcher says the folder surprised them, and that the 87MB file made them think the developers were either lazy or busy. A second dirsearch run identified the file name as web.zip.

source code From the original on medium.com

source code

From the original on medium.com

Exploitation

Step 1: Enumerate directories

Run dirsearch against the target. The report does not give the exact command line, only the output shown above. The relevant result is the 87MB 200 at /new, which redirects to /new/.

Why this step: before you can download a file you have to know it exists. The scan is the equivalent of walking down a corridor trying every door handle. Most handles do not move. One does, and behind it is something far bigger than a door should hide.

Step 2: Identify the file

A second dirsearch run revealed that the large file is named web.zip. The report does not show the request or the exact URL used to fetch it.

Why a second run: the first scan told the researcher that something large lived at /new/, but not what it was called. Running the scan again, with the folder in view, surfaced the file name. A .zip file is a compressed archive, a single file that holds many files inside it, like a box packed with folders. That explains the 87MB: it is not one page, it is a whole project bundled together.

Step 3: Download and inspect the archive

The researcher downloaded web.zip and obtained the whole company source code, which they say allowed them to run a website similar to the platform. The archive is described as containing the company owners' identity and the company's Stripe, PayPal and RavePay account details.

Why this matters: source code is the recipe for the website. It shows how every feature works, how the database is structured, and often contains keys and passwords the developers left inside. Stripe, PayPal and RavePay are payment services; the report says the archive contained the company's account details for them.

an xss from the redacted From the original on medium.com

an xss from the redacted

From the original on medium.com
hacking the planet

hacking the planet

Step 4: Report

The researcher wrote a report and sent it to the company's email address. After seven days with no response, they reported it through the company's Telegram channel.

Why report at all: the point of finding a bug is to get it fixed. A responsible researcher tells the owner, gives them time to act, and only then talks about it publicly. Here the email went unanswered, so the researcher used a second channel.

From the original on medium.com

The report gives the following timeline:

Event Date
Bug report 26/04/2018
Patched 1/05/2018
Bounty awarded 18/05/2018

The bounty is stated as $500,000 in the body of the write-up. The platform metadata for this write-up records $500.00 USD, so the two figures disagree; the report itself does not reconcile them.

Root cause

What can be said from the evidence is that a folder path, /new/, served a large archive, web.zip, containing the application's source code, and that the archive was reachable without any authentication step being described. The report does not document the cause. A static file is one the server just hands over as-is, without running any program or checking who is asking. The /.git and /plugins.log entries returned 200 with 235 bytes each; the report does not investigate them further. The document root is the folder on the server that the website is allowed to show to the world; anything inside it is fair game unless the server is told otherwise.

Why existing defences did not stop it is not stated in the report. A static file served from the document root bypasses application-level authorisation entirely, which is consistent with the researcher reaching it through directory enumeration rather than through a logged-in feature. In plain terms: the website's own login checks never got a chance to run, because the request never reached the website's code. The server answered directly, like a receptionist handing out a file from the drawer without asking who you are.

Impact

With the source code in hand, the researcher says they could run a website similar to the platform. The archive is described as containing the owners' identity and the company's Stripe, PayPal and RavePay account details. Source code disclosure of this kind gives an attacker the application's logic, any embedded credentials or keys, and the payment integration details, which is what the researcher highlights. The researcher also notes that the platform was vulnerable to XSS, IDOR and SQL injection, found separately, but those are not demonstrated in this write-up.

Fix

The report states that the issue was patched on 1/05/2018 but does not say what was changed. What should be done, and what the report's evidence supports, is to remove build and deployment artefacts such as web.zip from any web-accessible folder, and to ensure that folders like /.git and log files such as /plugins.log are not served by the web server. Serving only the intended public files from the document root, and blocking access to archives, version control metadata and logs at the server level, would address the exposure shown here.

Variants to test

  1. Run dirsearch (or any content discovery tool) against the target and look for 200 responses with unusually large sizes. A positive result is a folder or file returning a body far larger than a normal page, as with the 87MB /new entry here.
  2. Check for common archive names in web-accessible folders, such as web.zip, backup.zip, site.zip or source.zip. A positive result is a downloadable archive that extracts to application source.
  3. Request /.git and similar version control paths. A positive result is a 200 response, as the report shows for /.git at 235 bytes, which can indicate exposed repository metadata.
  4. Request log files such as /plugins.log. A positive result is a 200 response containing log content, as the report shows at 235 bytes.
  5. Look for deployment folders such as /new/ that may hold a staged copy of the application. A positive result is a folder listing or a downloadable artefact inside it.
  6. After obtaining source, search it for payment integration credentials and identity data, which is what the researcher reports finding in web.zip.

Glossary

  • XSS (cross-site scripting): a bug that lets an attacker run their own JavaScript inside another user's browser session on a website.
  • SQL injection: a bug that lets an attacker slip database commands into a form or URL so the site's database executes them.
  • IDOR (insecure direct object reference): a bug where changing an identifier in a request, such as a number in a URL, gives access to another user's data.
  • Directory brute-force: trying a long list of common folder and file names against a website to discover which ones exist.
  • dirsearch: a tool that performs directory brute-force by sending many requests, one per name in a list, and reporting the responses.
  • Status code: the three-digit number a web server returns with every response; 200 means success.
  • Redirect: a server response telling the browser that the requested thing is at a different address.
  • Document root: the folder on a web server that is allowed to be served publicly; anything inside it can be requested unless blocked.
  • Static file: a file the server hands over as-is, without running any program or checking who is asking.
  • Source code: the files developers write to build an application; they describe how every feature works and may contain secrets.
  • Archive: a single file that contains many files inside it, often compressed, such as a .zip file.
  • .git: the hidden folder Git uses to store a project's version history; it is never meant to be public.
  • Log file: a running diary a program writes as it works, which can contain internal detail and is not meant to be downloadable.
  • Authentication: the process of proving who you are, usually by logging in.
  • Authorisation: the process of deciding what a proven user is allowed to do.
  • Bounty: a reward a company pays a researcher for reporting a security bug responsibly.
  • Stripe, PayPal, RavePay: payment services companies use to receive and move money; their account details are sensitive credentials.
  • Reconnaissance: the information-gathering phase of security testing, before any exploitation.
  • Hall of Fame: a public list some companies keep of researchers who have reported valid bugs to them.

More by Sadiq West

View all

1 more disclosed report, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Information disclosure

The lesson behind this report.

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.