Forum Moderators: coopster

Message Too Old, No Replies

is this a hijack script for stripslashes and magicquotes?

         

surrealillusions

12:29 pm on Oct 29, 2008 (gmt 0)

10+ Year Member



Found this file on my server on one of my sites after a contact form got hijacked. My php knowledge is basic, but it looks to me they're checking for magicquotes and stripslashes functions, and forcing the script they're hijacking to ignore them, so they can inject a load of nasty stuff into the form?

function nukeMagicQuotes() {
if (get_magic_quotes_gpc()) {
function stripslashes_deep($value) {
$value = is_array($value) ? array_map('stripslashes_deep', $value) : stripslashes($value);
return $value;
}
$_POST = array_map('stripslashes_deep', $_POST);
$_GET = array_map('stripslashes_deep', $_GET);
$_COOKIE = array_map('stripslashes_deep', $_COOKIE);
}
}

jatar_k

6:18 pm on Oct 29, 2008 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



it looks like a standard function for nuking magicquotes

as magicquotes is quite undesirable most software has something like this in it

dreamcatcher

7:17 pm on Oct 29, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Its just a rewrite of a function mentioned on the PHP website.

[uk.php.net...]

dc

surrealillusions

8:31 pm on Oct 29, 2008 (gmt 0)

10+ Year Member



ok..thanks..

maybe its just me been over paranoid

:)

dreamcatcher

8:32 am on Oct 30, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Not necessarily a bad thing being over paranoid. Magic Quotes are being removed in PHP6 btw.

dc