Iddo's Bizzare Computing
Adventures


A simple PHP script that pretends to be an image. Fetches basic information about the target.
image.php
                ?php
                header('Content-type: image/png');
                
                $http_x_forwarded_for = (isset($_SERVER['HTTP_X_FORWARDED_FOR']) || !empty($_SERVER['HTTP_X_FORWARDED_FOR']));
                $http_client_ip = (isset($_SERVER['HTTP_CLIENT_IP']) || !empty($_SERVER['HTTP_CLIENT_IP']))
                
                $INFO = "----------------------------\n";
                $info .= "INFO ABOUT VISITOR:";
                $info .= "HTTP_USER_AGENT: " . $_SERVER['HTTP_USER_AGENT'] . "\n";
                $info .= "REMOTE_ADDR: " . $_SERVER['REMOTE_ADDR'] . "\n";
                $info .= "HTTP_X_FORWARDED_FOR: " . ($http_x_forwarded_for ? $_SERVER['HTTP_X_FORWARDED_FOR'] : "not set") . "\n";
                $info .= "HTTP_CLIENT_IP: " . ($http_client_ip  ? $_SERVER['HTTP_CLIENT_IP'] : "not set") . "\n";
                $info .= "\n";
                $file = fopen('details.txt', 'a');
                fwrite($file, $info);
                fclose($file);
                imagepng(imagecreatefrompng('coolcat.png'));
                ?>
            
.htaccess
                RewriteEngine On

                RewriteRule ^definitely_not_anything_fishy\.png$ /image.php [L,NC]
                RewriteRule ^images/123908234.png$   /image.php [L,NC]