Skip to content
Access control Write-up Beginner

Phantom Level 6 Scheduled Sins Cron Privilege Escalation

A cron job ran a script every minute as a non-root user, and that script was writable by a group the attacker belonged to. The attacker could overwrite the script to execute arbitrary commands as the cron user and read a protected flag file.

Vivek Yadav Follow

Published on infosecwriteups.com

I started as a low-privilege user, Phantom6, with no obvious way to read anything outside my own home directory. The task hint was simple but pointed: something on this box runs every minute — find it, find out who runs it, and find out if it can be changed.

Vivek Yadav, on infosecwriteups.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

Impact

An attacker with membership in the relevant group could execute arbitrary commands as the cron user, leading to privilege escalation and access to protected files.

What the attacker needed

Low-privilege shell access; membership in the group that can write the script

How it was found

  1. Search cron files for entries that run every minute.
  2. Identify the cron job running as user flagkeeper6 and the script it executes.
  3. Check permissions on the cron file and the script.
  4. Confirm group membership grants write access to the script.
  5. Overwrite the script to run commands as flagkeeper6 and verify execution.
  6. Use the overwritten script to read the protected flag file.

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 scheduled task (cron) runs a script automatically at set times. The schedule file was protected, but the script itself could be edited by members of a certain group. Because the attacker was in that group, they could change the script to run their own commands with the scheduled task's permissions.

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.

More by Vivek Yadav

View all

1 more disclosed report, best first.

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.