sonicadam123 Posted October 29, 2010 Share Posted October 29, 2010 Hey guys, i'm not just new here but i'm new to php.. I've been trying to edit some wordpress templates i was given, but there is some code in the footer/copyright files that i really don't understand at all .. Here is an example of the code ... <?php $_F=__FILE__;$_X='Pz4JCQkJCTxkNHYgNGQ9ImYyMnQ1ciI+DQoJCQkJCQkNCgkJCQkJCTxwIGNsMXNzPSJjMnB5cjRnaHQiPkMycHlyNGdodCAmYzJweTsgYTAwOCAtIDwxIGhyNWY9Imh0dHA6Ly8xc3MzcjFuYzVjMm1wbDVtNW50MTRyNXMxbnQ1LjJyZyIgdDR0bDU9ImQ1djRzIGMybXBsNW01bnQxNHI1IHMxbnQ1IGMybXAxcjF0NGYgMXNzM3IxbmM1IG0xbDFkNDUgbTN0MzVsbDUiPmQ1djRzIGMybXBsNW01bnQxNHI1IHMxbnQ1IGMybXAxcjF0NGYgMXNzM3IxbmM1IG0xbDFkNDUgbTN0MzVsbDU8LzE+PC9wPg0KCQkJCQkJDQoJCQkJCQk8cCBjbDFzcz0icDJ3NXI1ZCI+DQogICAgICAgICAgICAgICAgICAgICAgICA8MSBocjVmPSJodHRwOi8vczRtM2wxdDQybjFzczNyMW5jNXY0NS5jMm0iIHQ0dGw1PSJzNG0zbDF0NDJuIDFzczNyMW5jNSB2NDUgcjVuZDVtNW50IG0zbHQ0c3MzcDJydCB0MTN4IGMybXAxcjF0NGYiIGNsMXNzPSJ3MjJ0aDVtNXMiPiZuYnNwOzwvMT4NCiAgICAgICAgICAgICAgICAgICAgICAgIDwvcD4NCgkJCQkJDQoJCQkJCTwvZDR2PjwhLS0gRW5kIGYyMnQ1ciAtLT4=';eval(base64_decode('JF9YPWJhc2U2NF9kZWNvZGUoJF9YKTskX1g9c3RydHIoJF9YLCcxMjM0NTZhb3VpZScsJ2FvdWllMTIzNDU2Jyk7JF9SPWVyZWdfcmVwbGFjZSgnX19GSUxFX18nLCInIi4kX0YuIiciLCRfWCk7ZXZhbCgkX1IpOyRfUj0wOyRfWD0wOw=='));?> Could someone please explain if there is a way of decoding this?? Thanks so much Quote Link to comment https://forums.phpfreaks.com/topic/217217-php-newbie-needs-help/ Share on other sites More sharing options...
Adam Posted October 29, 2010 Share Posted October 29, 2010 They've used a series of messy bas64_encode calls to encode the copyright notice.. to try and stop you removing it (at the cost of performance). Quote Link to comment https://forums.phpfreaks.com/topic/217217-php-newbie-needs-help/#findComment-1128056 Share on other sites More sharing options...
sonicadam123 Posted October 29, 2010 Author Share Posted October 29, 2010 Thanks, thats good to know! but how would i go about decoding it? Quote Link to comment https://forums.phpfreaks.com/topic/217217-php-newbie-needs-help/#findComment-1128058 Share on other sites More sharing options...
Adam Posted October 29, 2010 Share Posted October 29, 2010 Using base64_decode you can reverse engineer their efforts fairly easily, just may appear more complicated than it is (which was obviously their intention). Quote Link to comment https://forums.phpfreaks.com/topic/217217-php-newbie-needs-help/#findComment-1128059 Share on other sites More sharing options...
PaulRyan Posted October 29, 2010 Share Posted October 29, 2010 I have given you a little head start <?php // All of previous code broken down into managable strings $string1 = 'JF9YPWJhc2U2NF9kZWNvZGUoJF9YKTskX1g9c3RydHIoJF9YLCcxMjM0NTZhb3VpZScsJ2FvdWllMTIzNDU2Jyk7JF9SPWVyZWdfcmVwbGFjZSgnX19GSUxFX18nLCInIi4kX0YuIiciLCRfWCk7ZXZhbCgkX1IpOyRfUj0wOyRfWD0wOw=='; $string2 = 'Pz4JCQkJCTxkNHYgNGQ9ImYyMnQ1ciI='; $string3 = 'DQoJCQkJCQkNCgkJCQkJCTxwIGNsMXNzPSJjMnB5cjRnaHQiPkMycHlyNGdodCAmYzJweTsgYTAwOCAtIDwxIGhyNWY9Imh0dHA6Ly8xc3MzcjFuYzVjMm1wbDVtNW50MTRyNXMxbnQ1LjJyZyIgdDR0bDU9ImQ1djRzIGMybXBsNW01bnQxNHI1IHMxbnQ1IGMybXAxcjF0NGYgMXNzM3IxbmM1IG0xbDFkNDUgbTN0MzVsbDUiPmQ1djRzIGMybXBsNW01bnQxNHI1IHMxbnQ1IGMybXAxcjF0NGYgMXNzM3IxbmM1IG0xbDFkNDUgbTN0MzVsbDU8LzE='; $string4 = 'PC9wPg0KCQkJCQkJDQoJCQkJCQk8cCBjbDFzcz0icDJ3NXI1ZCI='; $string5 = 'DQogICAgICAgICAgICAgICAgICAgICAgICA8MSBocjVmPSJodHRwOi8vczRtM2wxdDQybjFzczNyMW5jNXY0NS5jMm0iIHQ0dGw1PSJzNG0zbDF0NDJuIDFzczNyMW5jNSB2NDUgcjVuZDVtNW50IG0zbHQ0c3MzcDJydCB0MTN4IGMybXAxcjF0NGYiIGNsMXNzPSJ3MjJ0aDVtNXMiPiZuYnNwOzwvMT4NCiAgICAgICAgICAgICAgICAgICAgICAgIDwvcD4NCgkJCQkJDQoJCQkJCTwvZDR2PjwhLS0gRW5kIGYyMnQ1ciAtLT4='; // Only use this to fix string 2,3,4,5 function fixString($string) { $string = strtr($string,'123456aouie','aouie123456'); return $string; } // Only use this to fix string 1 echo base64_decode($string1); // Only use this to fix string 2,3,4,5 //echo fixString(base64_decode($string2)); ?> Tell me how you get on bud. Regards, Paul. Quote Link to comment https://forums.phpfreaks.com/topic/217217-php-newbie-needs-help/#findComment-1128061 Share on other sites More sharing options...
sonicadam123 Posted October 29, 2010 Author Share Posted October 29, 2010 I have given you a little head start <?php // All of previous code broken down into managable strings $string1 = 'JF9YPWJhc2U2NF9kZWNvZGUoJF9YKTskX1g9c3RydHIoJF9YLCcxMjM0NTZhb3VpZScsJ2FvdWllMTIzNDU2Jyk7JF9SPWVyZWdfcmVwbGFjZSgnX19GSUxFX18nLCInIi4kX0YuIiciLCRfWCk7ZXZhbCgkX1IpOyRfUj0wOyRfWD0wOw=='; $string2 = 'Pz4JCQkJCTxkNHYgNGQ9ImYyMnQ1ciI='; $string3 = 'DQoJCQkJCQkNCgkJCQkJCTxwIGNsMXNzPSJjMnB5cjRnaHQiPkMycHlyNGdodCAmYzJweTsgYTAwOCAtIDwxIGhyNWY9Imh0dHA6Ly8xc3MzcjFuYzVjMm1wbDVtNW50MTRyNXMxbnQ1LjJyZyIgdDR0bDU9ImQ1djRzIGMybXBsNW01bnQxNHI1IHMxbnQ1IGMybXAxcjF0NGYgMXNzM3IxbmM1IG0xbDFkNDUgbTN0MzVsbDUiPmQ1djRzIGMybXBsNW01bnQxNHI1IHMxbnQ1IGMybXAxcjF0NGYgMXNzM3IxbmM1IG0xbDFkNDUgbTN0MzVsbDU8LzE='; $string4 = 'PC9wPg0KCQkJCQkJDQoJCQkJCQk8cCBjbDFzcz0icDJ3NXI1ZCI='; $string5 = 'DQogICAgICAgICAgICAgICAgICAgICAgICA8MSBocjVmPSJodHRwOi8vczRtM2wxdDQybjFzczNyMW5jNXY0NS5jMm0iIHQ0dGw1PSJzNG0zbDF0NDJuIDFzczNyMW5jNSB2NDUgcjVuZDVtNW50IG0zbHQ0c3MzcDJydCB0MTN4IGMybXAxcjF0NGYiIGNsMXNzPSJ3MjJ0aDVtNXMiPiZuYnNwOzwvMT4NCiAgICAgICAgICAgICAgICAgICAgICAgIDwvcD4NCgkJCQkJDQoJCQkJCTwvZDR2PjwhLS0gRW5kIGYyMnQ1ciAtLT4='; // Only use this to fix string 2,3,4,5 function fixString($string) { $string = strtr($string,'123456aouie','aouie123456'); return $string; } // Only use this to fix string 1 echo base64_decode($string1); // Only use this to fix string 2,3,4,5 //echo fixString(base64_decode($string2)); ?> Tell me how you get on bud. Regards, Paul. Thanks Paul, but even from your post i still have no idea where to go next, when i said i was new to php, i meant very very new lol Quote Link to comment https://forums.phpfreaks.com/topic/217217-php-newbie-needs-help/#findComment-1128070 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.