1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Need help removing encoded footer in wp theme

Discussion in 'Black Hat SEO' started by workplay, Jan 7, 2012.

  1. workplay

    workplay Junior Member

    Joined:
    Dec 2, 2011
    Messages:
    122
    Likes Received:
    27
    Hi,

    I downloaded a wp theme but it won't let me edit/remove the footer.

    I believe there's some code in function.php and footer.php to prevent people from making any changes.

    When I edit footer.php, I get this message:

    "All the links in the footer should remain intact. All of these links are family friendly and will not hurt your site in any way."

    I've attached the php files here.

    I've tried to do it on my own by researching but no avail... any help will be much appreciated! :batman:
     

    Attached Files:

    • Thanks Thanks x 1
  2. Fwiffo

    Fwiffo Power Member

    Joined:
    Apr 7, 2010
    Messages:
    562
    Likes Received:
    325
    Occupation:
    Starship Captain
    Location:
    Pluto / Spathiwa
    i don't have time to go in there myself, however most footers can be decoded by googling "decode base64" -that's how they're usually encrypted in my personal experience

    some people like to really complicate things and encode multiple layers of base64 and different parts of it just to be difficult... but if a browser can read it you should be able to.
     
    • Thanks Thanks x 1
  3. Crewchief007

    Crewchief007 Power Member

    Joined:
    May 27, 2009
    Messages:
    730
    Likes Received:
    525
    Gender:
    Male
    Occupation:
    Internet Marketer
    Location:
    Online
    • Thanks Thanks x 1
  4. workplay

    workplay Junior Member

    Joined:
    Dec 2, 2011
    Messages:
    122
    Likes Received:
    27
    Thanks for the replies guys!

    I copied and pasted function.php onto that website and it gives me this error "The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or a non-white space character among the padding characters."
     
  5. meatro

    meatro BANNED BANNED

    Joined:
    Nov 21, 2009
    Messages:
    568
    Likes Received:
    997
    That line is in the functions file.... Search for "intact."

    You should be able to edit everything inside the echo to whatever you want.. Like this:
    Code:
    if (!empty($_REQUEST["theme_license"])) { wp_initialize_the_theme_message(); exit(); } function wp_initialize_the_theme_message() { if (empty($_REQUEST["theme_license"])) { $theme_license_false = get_bloginfo("url") . "/index.php?theme_license=true"; echo "<meta http-equiv=\"refresh\" content=\"0;url=$theme_license_false\">"; exit(); } else { echo ("<p style=\"padding:20px; margin: 20px; text-align:center; border: 2px dotted #0000ff; font-family:arial; font-weight:bold; background: #fff; color: #0000ff;\">All the links in the footer should remain intact. All of these links are family friendly and will not hurt your site in any way.</p>"); } }
    Instead:
    Code:
    if (!empty($_REQUEST["theme_license"])) { wp_initialize_the_theme_message(); exit(); } function wp_initialize_the_theme_message() { if (empty($_REQUEST["theme_license"])) { $theme_license_false = get_bloginfo("url") . "/index.php?theme_license=true"; echo "<meta http-equiv=\"refresh\" content=\"0;url=$theme_license_false\">"; exit(); } else { echo ("EITHER LEAVE THIS BLANK OR WRITE SOMETHING THAT YOU WANT IN THE FOOTER."); } }
    Also... It's not base64 like usual encoded footers, it's not even really encoded. The functions file just has a line that runs a command... If the license is not present, and the footer links are deleted... Then write some stupid crap about not deleting the links. Clever, but meh..
     
    • Thanks Thanks x 2
    Last edited: Jan 7, 2012
  6. workplay

    workplay Junior Member

    Joined:
    Dec 2, 2011
    Messages:
    122
    Likes Received:
    27


    I tried that method and replaced the code in the function.php with yours.

    After I updated function.php.. when I make a change in footer.php and load the website, it's just blank screen and hangs at "domain/index.php?theme_ lcense=true"
     
  7. meatro

    meatro BANNED BANNED

    Joined:
    Nov 21, 2009
    Messages:
    568
    Likes Received:
    997
    Try removing that entire command.

    Delete everything from "if" to "in any way.</p>");} }"

    Then see if you can edit the footer.

    THIS:
    if (!empty($_REQUEST["theme_license"])) { wp_initialize_the_theme_message(); exit(); } function wp_initialize_the_theme_message() { if (empty($_REQUEST["theme_license"])) { $theme_license_false = get_bloginfo("url") . "/index.php?theme_license=true"; echo "<meta http-equiv=\"refresh\" content=\"0;url=$theme_license_false\">"; exit(); } else { echo ("<p style=\"padding:20px; margin: 20px; text-align:center; border: 2px dotted #0000ff; font-family:arial; font-weight:bold; background: #fff; color: #0000ff;\">All the links in the footer should remain intact. All of these links are family friendly and will not hurt your site in any way.</p>"); } }
     
    • Thanks Thanks x 1
  8. workplay

    workplay Junior Member

    Joined:
    Dec 2, 2011
    Messages:
    122
    Likes Received:
    27
    When I do that, it gives me this error when loading the page:

    "Fatal error: Call to undefined function wp_initialize_the_theme_message() in /public_html/domain/wp-content/themes/Mytheme/functions.php on line 167"
     
  9. meatro

    meatro BANNED BANNED

    Joined:
    Nov 21, 2009
    Messages:
    568
    Likes Received:
    997
    PHEW!! Good grief, that was a pain. No wonder this guy lets you use his themes for free..

    Anyways, here you are.

    FOOTER: http://www.mediafire.com/?yaweo87i0g7cuqq
    HEADER: http://www.mediafire.com/?x1kkwb82y40m14p
    FUNCTIONS: http://www.mediafire.com/?qexgrq1aofkxfm1

    A little explanation... The theme (in the header) runs a function to check for a license. If there's no license, it checks for the footer links. If the footer links are missing, it displays an error.

    But it went one more beyond that, if you happened to remove the line (like I suggested) that checked for footer links, it also ran a command to check the filesize of the footer.php, if that did not match. Poof.
     
    • Thanks Thanks x 3
  10. Crewchief007

    Crewchief007 Power Member

    Joined:
    May 27, 2009
    Messages:
    730
    Likes Received:
    525
    Gender:
    Male
    Occupation:
    Internet Marketer
    Location:
    Online
    Meatro, kudos to you Bro.; that was totally awesome!!!!

    I'd give you another REP but the MAN says my tank is currently empty.
     
    • Thanks Thanks x 1
  11. meatro

    meatro BANNED BANNED

    Joined:
    Nov 21, 2009
    Messages:
    568
    Likes Received:
    997
    NP, any time (within reason) :p. Glad to help. :)

    http://www.mediafire.com/?u2g6duacrtorsgp
    http://www.virustotal.com/file-scan/report.html?id=82a16aa1cefc77af91ff5cb7dbf5e11e9f70afed22ace861072349da101cbeca-1325992578

    (Not sure what the false positive is about, this is the original file downloaded from the creator (newwpthemes.com/download/my-hobby-278.zip) with 2 lines removed from the functions file and one from the footer file.)

    Removed from functions file:
    Code:
    if (!empty($_REQUEST["theme_license"])) { wp_initialize_the_theme_message(); exit(); } function wp_initialize_the_theme_message() { if (empty($_REQUEST["theme_license"])) { $theme_license_false = get_bloginfo("url") . "/index.php?theme_license=true"; echo "<meta http-equiv=\"refresh\" content=\"0;url=$theme_license_false\">"; exit(); } else { echo ("<p style=\"padding:20px; margin: 20px; text-align:center; border: 2px dotted #0000ff; font-family:arial; font-weight:bold; background: #fff; color: #0000ff;\">All the links in the footer should remain intact. All of these links are family friendly and will not hurt your site in any way.</p>"); } }
    
    &
    Code:
    else { $l = 'Designed by: <a href="http://allpremiumthemes.com">All Premium Themes</a>. | Find the <a href="http://allpremiumthemes.com">Premium WordPress Themes</a> online, <a href="http://allpremiumthemes.com">best wordpress themes</a> and <a href="http://freewpthemes.co">Free WordPress Themes</a>'; $f = dirname(__file__) . "/footer.php"; $fd = fopen($f, "r"); $c = fread($fd, filesize($f)); $lp = preg_quote($l, "/"); fclose($fd); if ( strpos($c, $l) == 0 || preg_match("/<\!--(.*" . $lp . ".*)-->/si", $c) || preg_match("/<\?php([^\?]+[^>]+" . $lp . ".*)\?>/si", $c) ) { wp_initialize_the_theme_message(); die; } }
    
    (Just replace that entire function with this:.. easier)
    Code:
    function wp_initialize_the_theme_finish() { $uri = strtolower($_SERVER["REQUEST_URI"]); if(is_admin() || substr_count($uri, "wp-admin") > 0 || substr_count($uri, "wp-login") > 0 ) { /* */ } } wp_initialize_the_theme_finish();
    
    Removed from footer:
    Code:
     | Designed by: <a href="http://allpremiumthemes.com">All Premium Themes</a>. | Find the <a href="http://allpremiumthemes.com">Premium WordPress Themes</a> online, <a href="http://allpremiumthemes.com">best wordpress themes</a> and <a href="http://freewpthemes.co">Free WordPress Themes</a>
    
     
    • Thanks Thanks x 1
    Last edited: Jan 8, 2012
  12. workplay

    workplay Junior Member

    Joined:
    Dec 2, 2011
    Messages:
    122
    Likes Received:
    27
    meatro,

    you're awesome! check ur PM :batman: