| Banned from DF
Posts: 160
Gallery:
0
Comments: 0
Join Date: Oct 2004 Location: Euphoria, all the time... Zodiac Sign:
Capricorn
| Grabbing info via image. -
12-03-04
For my first post I'd like to demonstrate how un-parsed signatures can be used for obtaning IP addresses and other info.
UNPARSED SIGNATURES: Forum sigs that allow links to progs like *.php and *.cgi within the image tag. Lets move on to the PHP code, first, we'll start out with getting the user info.
$ip = $_SERVER['REMOTE_ADDR']; // declare the IP
$userAgent = $_SERVER['HTTP_USER_AGENT']; // get the user-agent (browser OS, // etc.
then we'll store the info within a text file after creating the input string.
$inputString = "IP: " . $ip . "\n" . "USER AGENT: " . $userAgent . "\n\n";
$fp = fopen( "userInfo/ipList.txt" , "a" ); //opens a file for append
fwrite( $fp, $inputString ); //actualy writes to the file
fclose( $fp ); //closes file. Now to make the image: //create the image canvas...
$img_number = imagecreate(300, 80);
Declare colors.
//Create the Color Variables
$white = imagecolorallocate($img_number,255,255,255);
$black = imagecolorallocate($img_number,0,0,0); Fill the image.
imagefill($img_number,0,0,$black); Create some strings.
$ipPrint="Your IP is: ";
$line2Print = "I Now have your IP ";
$line3Print = "And your OS/Browser Info.";
$line4Print = "A public service announcement from webgovernor."; Print the info to the image.
Imagestring($img_number,4,5,5,$ipPrint,$white);
Imagestring($img_number,9,100,5,$ip,$white);
Imagestring($img_number,4,5,35,$line2Print,$white);
Imagestring($img_number,4,5,50,$line3Print,$white);
Imagestring($img_number,2,5,65,$line4Print,$white);
And, finally, we'll display the info. header("Content-type:image/jpeg"); //output header
imagejpeg($img_number); //print the image to the screen.
?> To access this image, use the URL to the program, ie:
img src="http://www.yourdomain.com/php/image.php"
There ya have it, that's most of my signature, the rest I don't really care to share.
I've got more fun things like that...
Please share, educating the community can be excellent... heh...
-Web |