Skip to content
File upload Write-up Beginner

Bandit Tours & Travel — Where Your Journey Might Lead to S

A travel-themed web application passed a user-supplied page parameter straight into a PHP file include, so the author could read local system files and include a remotely hosted script. That allowed reading files on the server and running their own code through remote file inclusion.

Shah kaif Follow

Published on infosecwriteups.com

By Shah kaif | “Book flights, find hotels, or just include shell.php and take a tour of our file system.” | LinkedIn

Shah kaif, 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

Root cause

Likely the application passed the raw page request parameter into a PHP include without validating or restricting it, and remote URL inclusion was enabled.

Impact

An attacker could read files on the server and execute their own code on it, leading to full compromise of the application host.

What the attacker needed

Reachable web app; no login needed

The fix

The page parameter should be checked against a fixed allow-list of known template names, and remote URL inclusion should be turned off.

How it was found

  1. Visit the site and notice the page parameter in the URL.
  2. Change the parameter to a path traversal sequence to read a local system file.
  3. Point the parameter at an externally hosted script to confirm remote inclusion.
  4. Enumerate files, find a hidden HTML page and read the flag.

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 site had a link like ?page=flights.php that told the server which page file to load. The server trusted whatever was in that link, so a visitor could point it at other files on the machine or even at a script on another website, and the server would load and run it.

What is File upload?

An upload feature accepts a file that the server or other users' browsers then treat as code or as something trusted.

More by Shah kaif

View all

5 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Unrestricted file upload

The lesson behind this report.

An upload feature accepts a file that the server or other users' browsers then treat as code or as something trusted.