Skip to content

Instantly share code, notes, and snippets.

@vah13
Last active January 24, 2019 15:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vah13/bc7a1ae2105857860acbf5df2c61b4d6 to your computer and use it in GitHub Desktop.
Save vah13/bc7a1ae2105857860acbf5df2c61b4d6 to your computer and use it in GitHub Desktop.
Evil content-disposition
<?php
$fileList = glob('/var/www/html/uploads/*.jpg');
$fname = pathinfo($fileList[0])['basename'];
header('Content-Type: image/jpeg');
header("Content-disposition: attachment; filename=$fname");
readfile("/var/www/html/uploads/".$fname);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment