Skip to content
Misconfiguration Write-up Advanced

My secret to API privesc: Tapping compromised web servers

During a red team engagement, the author compromised a frontend Nginx server and used its mirroring feature to silently copy API traffic to an external listener. This captured credentials and headers for an internal token exchange service, allowing the red team to mint administrative tokens and gain access to every host on the cluster.

Dana Epp Follow

Published on danaepp.com

The spring rain was beating down with a weird cadence, like drummers were marching us into the weekend. Hey, it’s the Pacific Northwest.

Dana Epp (@DanaEpp), on danaepp.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.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the Nginx mirror module was enabled without restricting outbound connections, and sensitive internal API traffic (including credentials) was routed through the frontend server.

Impact

The red team could forge administrative tokens and gain administrative access to every host on the cluster.

What the attacker needed

Foothold on Nginx server; external listener server; ability to modify Nginx config

How it was found

  1. Gain a foothold on a frontend Nginx server that routes API traffic.
  2. Set up an external listener to receive mirrored requests.
  3. Configure Nginx mirror directive to copy requests to the listener, with timeouts and headers.
  4. Deploy the configuration to production servers and let it run over the weekend.
  5. Collect gigabytes of mirrored traffic, including credentials and headers for an internal token exchange service.
  6. Use the captured credentials to mint administrative tokens and access all hosts on the cluster.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

The attacker had already broken into a web server that sits in front of the company's APIs. They turned on a built-in feature that copies incoming requests to another server they control, without slowing down the real service. Later, they found that the copied traffic included secret passwords and special headers that let them create admin tokens for the whole system.

What is Misconfiguration?

Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.

More by Dana Epp

View all

2 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Security misconfiguration

The lesson behind this report.

Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.