Skip to content
Info disclosure Write-up Beginner

Hacking the Docker Registry with Burp Suite

The Docker registry exposed its catalog and repository manifests without authentication, allowing an attacker to list repositories and pull image contents. The author demonstrates brute-forcing directory names to find the repository file and then using docker pull to download files.

h1xploit Follow

Published on medium.com

In this blog post, we will walk through the process of finding security bugs in a Docker registry by using Burp Suite with Intruder feature. Specifically, we will focus on how to brute-force directory names to find the repository file, and then demonstrate how to exploit the repository to get files.

H1Xploit, 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. 4 min read.

Context

A Docker registry is the service that stores and serves container images. Clients such as the Docker daemon talk to it over the HTTP API under the /v2/ path, and the registry exposes endpoints for listing repositories, fetching image manifests and pulling layers. When a registry is reachable from the internet without authentication, its contents can be enumerated and downloaded by anyone who can reach it.

This write-up walks through finding and exploiting such a registry on a target referred to only as redacted.com, using Burp Suite and its Intruder feature. The approach has two parts: brute-forcing directory names to locate the repository file, and then using the registry API to pull the repository contents to a local machine.

Setup

  1. Run Burp Suite as an intercepting proxy, with the proxy listener on its default port 8080.
  2. Configure the browser to send HTTP traffic through Burp by setting the proxy host to localhost and the port to 8080.
  3. Have the wordlist directory-list-2.3-medium.txt available locally. The author describes it as a medium-sized list of common directory names.

No account or credential is mentioned at any point, which is consistent with the registry being reachable without authentication.

Finding it

The starting point is simply browsing to redacted.com with Burp running, so that the request to the Docker registry is captured. The captured request is then used as the template for a directory brute-force against the registry path.

Exploitation

Step 1: Capture the request and send it to Intruder

Browse to redacted.com through Burp, open the Proxy tab, locate the captured request in the history, right-click it and choose Send to Intruder.

Step 2: Define the payload position

In the Intruder tab, open Positions. Use Clear to remove any existing payload positions, then highlight the path of the request (the author's example is /a/) in the request editor and click Add to mark it as the payload position.

Step 3: Load the wordlist and start the attack

In the Payloads tab, click Load and choose directory-list-2.3-medium.txt. Then go to the attack menu and click Start Attack. Burp begins substituting each directory name from the wordlist into the marked path position.

The goal of this run is to find the repository file. The report does not show the individual responses or say which path produced the hit.

Step 4: List the repositories

Once the repository file is found, the _catalog parameter is added to list the available repositories:

Text
redacted.com/v2/_catalog

/v2/_catalog is the registry API endpoint that returns the names of the repositories the registry holds. The report says this parameter lists the available repositories.

Step 5: Pull the repository contents

Copy the repository URL from the response in Burp. In the author's case the URL has the form:

Text
redacted.com/v2/<repository-name>/manifests/<manifest-tag>

Replace <repository-name> and <manifest-tag> with the actual values from the response, then run the following in a terminal:

Bash
docker pull <repository-url>

Replace <repository-url> with the URL copied from Burp. The command downloads the contents of the repository onto the local machine.

Root cause

The report does not describe the registry's configuration or access control.

Impact

The author's stated outcome is that the contents of the repository can be downloaded to a local machine. The report does not enumerate what the pulled images contained, so the sensitivity of the exposed data is not established here.

Fix

The measures that would address this class of exposure are authentication on the registry API and restricting who can reach it, but the report itself does not say which was implemented.

Variants to test

  1. Unauthenticated _catalog on other registries. Request /v2/_catalog on any registry you are authorised to test. A positive result is a JSON body listing repository names rather than a 401.
  2. Directory brute-force for the repository file. Repeat the Intruder run with directory-list-2.3-medium.txt against other hosts. A positive result is a path that returns a registry response instead of a generic error page.
  3. Manifest retrieval. For each repository name returned by _catalog, request /v2/<repository-name>/manifests/<manifest-tag>. A positive result is a manifest document that can then be pulled with docker pull.
  4. Pull with the Docker client. Run docker pull <repository-url> against a candidate registry URL. A positive result is the image downloading without credentials being supplied.

Reference

The author points to https://notsosecure.com/anatomy-of-a-hack-docker-registry for further reading.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store From the original on medium.com
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store

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

What happened, in plain words

A researcher walked through finding and exploiting a Docker registry on a target site. A Docker registry is a storage service for container images: packaged bundles of software that a computer can run. By browsing the site through a tool called Burp Suite, the researcher captured the request the browser sent, then used a feature of that tool to try a long list of common folder names until the registry's file listing was found. From there, the _catalog parameter listed the available repositories, and a Docker command downloaded the repository contents to the local machine.

The target is referred to only as redacted.com. No account or password appears anywhere in the story, which fits the idea that the registry answered anyone who asked.

Background: the pieces you need to know

Before the steps make sense, here are the few ideas they rely on.

A server and a request. When you type an address into a browser, the browser sends a request over the internet to a server, and the server sends back a response. Most of the time you only see the finished page, not the conversation.

An API. An API is a way for programs to talk to a server without a human clicking anything. Think of a restaurant: the menu and the waiter are the API. You do not walk into the kitchen; you ask through a fixed set of requests, and the kitchen answers in a fixed format. A Docker registry has an API, and its requests all live under a path that starts with /v2/.

A Docker registry. Docker is software for building and running containers. A container image is a ready-made package containing an application and everything it needs. A registry is the warehouse where those images are stored and from which they are downloaded. The Docker program on your computer is a client: it asks the registry for images and saves them locally.

A repository and a manifest. Inside a registry, images are grouped into repositories, each with a name. A manifest is a small document describing one version of an image: which pieces it is made of and how they fit together. A tag is a label for a particular version, much like a version number on a box.

A proxy. A proxy sits between your browser and the internet and copies every request and response that passes through. Burp Suite is a proxy made for security testing: it records the traffic and lets you change it before it is sent.

Brute-forcing. Brute-forcing means trying many possibilities automatically instead of guessing cleverly. It is like trying every key on a large keyring until one opens the door. Here the possibilities are common folder names taken from a wordlist, a plain text file with one name per line.

Authentication. Authentication is the server checking who you are, usually with a username and password or a token. A token is a short piece of text that proves you already logged in, a bit like a wristband at an event. If a service has no authentication, it does not ask for either.

Setting up Burp Suite

The first job is to make the browser send all its traffic through Burp so the researcher can see and replay it.

  1. Open Burp Suite and make sure its proxy listener is running on the default port 8080. A port is a numbered door on a computer; 8080 is simply the door Burp uses by default.
  2. Configure the browser to use Burp as its proxy, with the host set to localhost and the port set to 8080. localhost means "this same computer", so the browser sends its traffic to Burp running on the same machine rather than straight out to the internet.
  3. Have the wordlist directory-list-2.3-medium.txt saved locally. The author describes it as a medium-sized list of common directory names.

No account or credential is mentioned at any point in the process, which is consistent with the registry being reachable without authentication.

Finding the registry file

The starting point is simply browsing to redacted.com with Burp running, so that the request to the Docker registry is captured. That captured request then becomes the template for a directory brute-force against the registry path.

Step 1: Capture the request and send it to Intruder

Browse to redacted.com through Burp, open the Proxy tab, find the captured request in the history, right-click it and choose Send to Intruder. Intruder is Burp's feature for sending the same request many times with one part changed each time. Sending the request there means the researcher does not have to build it by hand.

Step 2: Define the payload position

In the Intruder tab, open Positions. Use Clear to remove any existing payload positions, then highlight the path of the request (the author's example is /a/) in the request editor and click Add to mark it as the payload position.

The path is the part of the address after the domain, the part that names which folder or page you want. Marking it tells Burp: this is the spot where each word from the list should be dropped in. Clearing first removes any positions Burp guessed automatically, so only the intended spot changes.

Step 3: Load the wordlist and start the attack

In the Payloads tab, click Load and choose directory-list-2.3-medium.txt. Then go to the attack menu and click Start Attack. Burp begins substituting each directory name from the wordlist into the marked path position, one request per word.

The goal of this run is to find the repository file. The report does not show the individual responses or say which path produced the hit.

Step 4: List the repositories

Once the repository file is found, the _catalog parameter is added to list the available repositories:

Text
redacted.com/v2/_catalog

Line by line: redacted.com is the target site. /v2/ is the fixed prefix that every Docker registry API request uses, so it is the doorway to the registry's programmatic interface rather than its normal web pages. _catalog is the specific request that asks the registry to return the names of all the repositories it holds. In effect the researcher is asking the warehouse for its inventory list. The report says this parameter lists the available repositories.

Step 5: Pull the repository contents

Copy the repository URL from the response in Burp. In the author's case the URL has the form:

Text
redacted.com/v2/<repository-name>/manifests/<manifest-tag>

Line by line: redacted.com/v2/ is the same registry doorway as before. <repository-name> is a placeholder for the name of one repository taken from the _catalog answer, and manifests asks for the description document for one version of that image. <manifest-tag> is a placeholder for the version label. The angle brackets are not typed literally; they mark the spots where real values from the response go.

Replace <repository-name> and <manifest-tag> with the actual values from the response, then run the following in a terminal:

Bash
 docker pull <repository-url>

Line by line: docker starts the Docker program on the local machine. pull tells it to fetch an image from a registry and save it locally, the opposite of pushing an image up. <repository-url> is the placeholder for the URL copied from Burp, with the real repository name and tag filled in. Replace it with the actual URL, and the command downloads the contents of the repository onto the local machine. That completes the exploitation described in the report.

Why it worked

The report does not describe the registry's configuration or access control.

What the exposure means

The author's stated outcome is that the contents of the repository can be downloaded to a local machine. The report does not enumerate what the pulled images contained, so the sensitivity of the exposed data is not established here.

How it would be fixed

The measures that would address this class of exposure are authentication on the registry API and restricting who can reach it, but the report itself does not say which was implemented.

Other places to try the same checks

  1. Unauthenticated _catalog on other registries. Request /v2/_catalog on any registry you are authorised to test. A positive result is a JSON body listing repository names rather than a 401. A 401 is the standard "you are not allowed in" answer from a server.
  2. Directory brute-force for the repository file. Repeat the Intruder run with directory-list-2.3-medium.txt against other hosts. A positive result is a path that returns a registry response instead of a generic error page.
  3. Manifest retrieval. For each repository name returned by _catalog, request /v2/<repository-name>/manifests/<manifest-tag>. A positive result is a manifest document that can then be pulled with docker pull.
  4. Pull with the Docker client. Run docker pull <repository-url> against a candidate registry URL. A positive result is the image downloading without credentials being supplied.

Further reading

The author points to https://notsosecure.com/anatomy-of-a-hack-docker-registry for more on the same subject.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store From the original on medium.com
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store

Glossary

  • API: a fixed set of requests a program can send to a server to get information or make it do something, like a menu you order from.
  • Authentication: the server checking who you are, usually with a password or a token.
  • Brute-force: trying many possibilities automatically until one works.
  • Burp Suite: a tool that sits between your browser and the internet, records the traffic and lets you replay and change it.
  • Container image: a packaged bundle of an application and everything it needs to run.
  • Docker: software for building, storing and running container images.
  • Docker registry: the storage service that holds container images and serves them to clients.
  • Intruder: Burp Suite's feature for sending the same request many times with one part swapped for each word in a list.
  • localhost: the name a computer uses for itself.
  • Manifest: a small document describing one version of an image and the pieces it is made of.
  • Payload position: the marked spot in a request where Burp inserts each word from the wordlist.
  • Port: a numbered door on a computer that a service listens on; Burp's default is 8080.
  • Proxy: an intermediary that traffic passes through, so it can be seen and altered.
  • Repository: a named group of images inside a registry.
  • Request: the message a browser or program sends to a server.
  • Response: the message the server sends back.
  • Tag: a label for a particular version of an image.
  • Token: a short piece of text proving you have already logged in.
  • Wordlist: a plain text file with one candidate name per line, used for brute-forcing.
  • 401: the standard server answer meaning you are not allowed in without credentials.

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.