Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
basic PHP image proxy (that works ... )
<?php
$url = "";
if( isset( $_GET['url'] ) )
{
$url = $_GET[ 'url' ];
}
else
{
exit();
}
$imginfo = getimagesize( $url );
header("Content-type: ".$imginfo['mime']);
readfile( $url );
?>
@zyuiop

This comment has been minimized.

Copy link

@zyuiop zyuiop commented Sep 3, 2017

Completely insecure (...php?url=/etc/passwd)

@carloscarucce

This comment has been minimized.

Copy link

@carloscarucce carloscarucce commented Oct 5, 2017

Thanks!
I've made some validations and security checks in this version: https://gist.github.com/xxnoobmanxx/89329fa61997b3775487b0c155cda41f

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment