Skip to content
Access control Write-up Intermediate

“Potato Hacks a Machine” — A Fun & Interactive Pentest

An FTP service on a non-standard port allowed anonymous login and exposed a backup of the login page's PHP source, revealing hardcoded credentials. The login page's use of strcmp() could be bypassed by sending an array parameter, and a sudo rule allowing /bin/nice on files under /notes/ could be escaped with path traversal to run an arbitrary script as root.

IshhIshneet Follow

Published on medium.com

There are machines that fight… There are machines that hide… …and then there is this machine — a smug little box sitting at 192.168.238.101, daring me to break in.

IshhIshneet, 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 a combination of an anonymously accessible FTP exposing source backups, a loose strcmp() authentication check, and a sudo rule that did not restrict the path to the intended directory.

Impact

An attacker could gain an interactive root shell on the machine and read the final flag.

What the attacker needed

Network access to the target; anonymous FTP enabled; sudo rule for /bin/nice on /notes/*

How it was found

  1. Scan all ports on the target and find SSH, HTTP, and FTP on port 2112.
  2. Log in to FTP anonymously and download index.php.bak and welcome.msg.
  3. Read the backup to find the admin username and password.
  4. Use Gobuster to discover the /admin/ login page.
  5. Intercept the login request and send the password as an array to bypass strcmp().
  6. Brute-force SSH with Nmap to get webadmin credentials, then log in.

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 found a backup copy of a website's login code on an open file server, which showed the admin password. The login check could also be fooled by sending the password as a list instead of text, because the comparison function behaves oddly with lists. Later, a permission rule let the user run a helper program on files in one folder, but by using '..' in the path they could run their own script outside that folder as the all-powerful root user.

What is Access control?

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.