• Resolved stonegauge

    (@stonegauge)


    Is it possible for someone to add malicious code to a theme file (functions.php or perhaps footer.php) that would allow someone to gain aspect to the Link function on the WordPress admin panel?

    I ask this because twice in the last week, I’ve had a friend (using the i-feel-dirty theme that was customized lightly by me) have a link pop up in the blogroll that was not added by her or myself.

    As of yesterday afternoon the link wasn’t on the blogroll of her site, and yet this morning it was there. I checked google analytics for referral sites or anything out of the ordinary and came across this “search keyword” with the source being AOL:

    22b7e2832e87a6bc463fc8b73c8075e7

    I’m not going to repeat the link that was placed on the blogroll here, it was for a casino site. The point is — well, the initial question: is it possible to add code to a theme in order to achieve this (malicious) ends? I’ve removed code that I found in the footer file that seemed to have been out of place and un-necessary just in case that was the source of this problem… But I don’t truly know if that was it or if it’s somewhere else (A plugin) in the site in question.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter stonegauge

    (@stonegauge)

    disregard. Something else is wrong with the site that led to the code being inserted into the footer to begin with. I don’t have a copy of the code either as I deleted it before asking questions…

    Just some input on this … whether it could be considered “malicious” or not is conjecture, but there have been instances in a few themes where footers.php especially has contained obfuscated code that would lead users to sites they probably would not want on their site if they had to choose. A few members here have done a lot of poking through these codes and uncovered what these authors were up to and it’s not good.

    I think you were smart to delete this theme you mention when you did.

    Just curious–I’ve noticed something similar all of a sudden with my site (https://www.lucidityllc.com). Until around this morning, it seemed fine; then a few hours ago, a tiny little link “Pharmacy” popped up in the top left-hand corner of the screen. I have no idea how this happened, but have been trying to find out where in the body of my theme I can discover the code to delete it! Can anyone help? I don’t know what to do–there’s no div id called “wraps” that I can discover!

    <meta name="generator" content="WordPress 2.8.6">
    <link rel="shortlink" href="https://wp.me/PdVIm-4"><style type="text/css" media="screen">
    <!-- @import url( https://www.lucidityllc.com/wordpress/wp-content/themes/blue-zinfandel/style.css ); -->
    </style>
    <strong></head><body>
    <div id="wraps"><a href="https://www.onlinepharmacy4.com/">pharmacy</a></div></strong>
    
    <script language="javascript">
    var wt = 'get'+'Element'
    var stl = 'st'+'yle';
    var _0xd22c=["function seeThat(elem) { eval(x22elem.x22+stl+x22.display=x27blockx27;x22); }"];
    _0xd22c[0x0] = _0xd22c[0x0].replace(/block/i,"none");
    eval(_0xd22c[0x0]);
    </script>
    <script>
    var str = 'seeThat(document.getElementById("link"));';
    eval(str.replace(/link/i,'wraps'));
    </script><div id="header">
    	<a href="https://www.lucidityllc.com/">Lucidity</a><br />
    	Clarity is Everything</div>
    
    <div id="navbar">

    OK start with the real basics access your admin panel and go to appearence, You should see a link for Editor. This will allow you to edit the pages on your site. You need to open header.php see if the code is there – in your source code it is on this page – if it is you can delete it.

    delete this `<div id=”wraps”>pharmacy</div>

    <script language=”javascript”>
    var wt = ‘get’+’Element’
    var stl = ‘st’+’yle’;
    var _0xd22c=[“function seeThat(elem) { eval(x22elem.x22+stl+x22.display=x27blockx27;x22); }”];
    _0xd22c[0x0] = _0xd22c[0x0].replace(/block/i,”none”);
    eval(_0xd22c[0x0]);
    </script>
    <script>
    var str = ‘seeThat(document.getElementById(“link”));’;
    eval(str.replace(/link/i,’wraps’));
    </script>
    `
    That should at least get rid of it even in the short time – that might allow you/give you a bit more time to look at the other files – don’t forget it may not be something that is a direct result of your site it could be something to do with your hosts, but look at your site first.

    Hope helps

    Thanks for the tip. I went into the header, but couldn’t locate that string of code anywhere…I’d tried editing the header earlier as well, but somehow, the code doesn’t show up there.

    Am just going to delete the whole thing and try again later on. The links etc. don’t seem to show up if I use a different theme, so I’ll shift across to something else until I can figure out what the problem here is.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Malicious Code in a Theme?’ is closed to new replies.