|
|
|
|
Menu |
|
|
Home |
| |
|
Discussions |
| |
|
Tools |
| |
|
Affiliates |
| |
|
Content |
| |
|
Info |
| | |
|
|
|
|
|
User Info |
|
Membership:
Latest: MichaelSnaRe
New Today: 0
New Yesterday: 0
Overall: 9144
People Online:
Visitors: 88
Members: 0
Total: 88
|
|
|
|
|
|
Full disclosure |
|
|
|
|
|
|
|
|
|
IT Security and Insecurity Portal |
|
|
can i learn any file's size on another site |
|
Posted: Fri Jul 30, 2004 3:08 pm |
|
|
emrag |
Regular user |
|
|
Joined: Jun 03, 2004 |
Posts: 20 |
Location: TURKEY |
|
|
|
|
|
|
for example i can learn a file's size filesize("blah.gif") but this works only if file is on my server. So can i learn any file's size on another site
for example www.site.com/blah.gif
sorry for bad english |
|
|
|
|
Posted: Fri Jul 30, 2004 11:24 pm |
|
|
madman |
Active user |
|
|
Joined: May 24, 2004 |
Posts: 46 |
|
|
|
|
|
|
|
Use fsockopen() or fopen() (if remote open is enabled in php conf). Read the incoming buffer and count the length.
Code: | $string = "";
$fp = fsockopen("http://foo.bar", 80, $errno, $errstr, 15);
if ($fp) {
fputs($fp, "GET images/image.gif HTTP/1.0\r\n");
fputs($fp, "HOST: http://foo.bar\r\n\r\n");
while(!feof($fp)) {
$pagetext = fgets($fp,300);
$string .= chop($pagetext);
}
fputs($fp,"Connection: close\r\n\r\n");
fclose($fp);
}
echo "Image size is " . strlen($string) ."bytes\n"; |
If you know PHP, you know what I mean. |
|
_________________ ch88rs,
madman |
|
|
|
www.waraxe.us Forum Index -> Php
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
All times are GMT
Page 1 of 1
|
|
|
Powered by phpBB © 2001-2008 phpBB Group
|
|
|
|
|
|
|