Skip to content
Business logic Write-up Beginner

Petshop Pro

The write-up covers a Hacker101 practice CTF where the price of an item could be changed to zero, and a login endpoint was found by directory brute-forcing and then attacked with username and password guessing. An attacker could buy items for free and, if credentials were guessed, log in as another user.

dasmanish6176 Follow

Published on medium.com

ffuf -u https://aa1a4ce451abaa6349ea51c9a469b3b9.ctf.hacker101.com/login -w username -X POST -d “username=FUZZ&password=admin” -H “Content-Type: application/x-www-form-urlencoded” -mr “Invalid password”

Dasmanish, 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.

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 server trusted a price value sent by the client and had no rate limiting on login attempts.

Impact

An attacker could buy items for free and could gain access to accounts whose passwords were guessed.

What the attacker needed

A free account; ability to intercept requests; wordlists for guessing

How it was found

  1. Change the item price to zero in the purchase request.
  2. Find the login endpoint by directory brute-forcing.
  3. Brute-force usernames against the login form.
  4. Brute-force passwords against the login form.

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.

A price field was trusted by the shop, so a user could send a lower price and pay nothing. Separately, the login page could be found by guessing common file and folder names, and then passwords could be guessed repeatedly because nothing slowed the attacker down.

What is Business logic?

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.

More by dasmanish6176

View all

1 more disclosed report, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.