Support » Plugin: Ultimate Member - User Profile & Membership Plugin » Malware files being uploaded

  • We keep getting malware files in {YARA}php_in_image : /public_html/wp-content/uploads/ultimatemember/temp/HZFvdBHRk7nURFmQ6vq4c3b2iwwUYkrZ5HPlENcA/stream_photo_1d5fe5f28152556169e98d1b87593122_5b5d1603ec638.php
    There are a few sites that get these php files uploaded to ultimatemember/temp folder. Any idea what might be causing this?

Viewing 13 replies - 1 through 13 (of 13 total)
  • Plugin Support Ultimate Member Support

    (@ultimatemembersupport)

    Hi @2by2host,

    This is an Ultimate member temporary file. You can remove this file by clearing user cache in Ultimate member -> Dashboard. We will remove this file and make changes to the temporary files so you won’t see it after the next plugin update.

    Regards.

    Are you sure you have the latest version installed? The reply by UMS strikes me as odd, as this should already be fixed:

    https://www.cvedetails.com/cve/CVE-2018-0587/

    Yes, we use the latest version – 2.0.21.

    I manage 2 WordPress websites that use UltimateMember. In both cases our hoster contacted us to say that we have malware on our webspace in the folder wp-content/uploads/ultimatemember/temp.

    In today’s case the name of the file in question is stream_photo_9c8d90bc587c22ae9aef83fcdb2a02d0_5b6aa0e798e7b.php and it’s said to contain the malware PHP.EVAL.CRYPT.

    I deleted all the files within the temp directory and cleared the UM user cache. Running the latest UM version 2.0.21.

    Can you confirm that this is a file by UM and it is no malware?

    It IS malware. And it puts other nasty stuff into your Worpress installation. Do a scan with an anti-malware plugin (like this one: https://de.wordpress.org/plugins/gotmls/ ) to get a better idea of your problem.

    Strange thing: I’ve been chasing this issue since yesterday, but I have (had) version 1.3.84. Can you guys confirm that you actually got INFECTED with the newest UM version installed? Possibly you upgraded after the malware was already in place?

    After re-reading the security bulletin, it says that the exploit was around since 2015 until at least version 2.0.4 (this year).

    What it doesn’t say is that it was actually ever fixed.

    So I am assuming the current issue isn’t new – the only novelty is that there’s someone out there taking advantage of it.

    > Possibly you upgraded after the malware was already in place?

    That is possible. We probably ran 2.0.4 at some time.

    Our website was shut down now by the hoster. I will run the anti-malware plugin when we have reactivated the site. Hope this will get fixed very soon since 2 of my clients sites are down 🙁

    Also see this ticket by another affected UM user: https://wordpress.org/support/topic/danger-security-issue/

    > Can you guys confirm that you actually got INFECTED with the newest UM version installed?

    Yes, this is correct. Today the malware file has appeared in that folder again.

    /wp-content/uploads/ultimatemember/temp/ZzpcpQ7UKg7ZV1YsVPf2qICkqYTBRL6yUKUnBi85/stream_photo_9c8d90bc587c22ae9aef83fcdb2a02d0_5b69c02e2c664.php

    And this happens on a few separate hosting accounts.

    DISCLAIMER: I am not a security expert. Just someone stuck with the same problem.

    First thing you should do is delete um-image-upload.php – it is in the /lib/upload folder.

    Secondly, using the Anti-Malware plugin didn’t do the trick for me, as it didn’t find all files. But it helps see the scope of the problem.

    I am uploading a full backup of the compromised account as I am typing this. If you have recent backups, you are in luck. Just keep in mind that it won’t help if you use a backup that is infected as well (needless to say). To find the time of the infection, check your apache logs – look for the first occurance of that nasty file in UM’s upload folder. Or look for entries related to um-image-upload.php. Good luck.

    • This reply was modified 1 year, 8 months ago by yosmc.

    Ran across this on a clients site today.

    The files are spoofed gif images. So the mime-type will detect as gif. But then have php embedded in them. When pushed through the php processor the gif parts are passed through to the browser just like html in the file would be and showing up as garbage on the screen, and then the php is executed behind the scenes once it is encountered.

    These are usually file uploader, or php shell scripts, (I have not decoded these ones personally) which allow the hacker to upload more files and effectively at that point have complete control over your accounts content. That includes ‘addon domains’ that may also be running under the same user.

    While it doesn’t solve the problem of the code being uploaded, the standard security step of disabling php processing in the uploads directory preemptively defangs the attack and stops the hackers from actually running the uploaded code.

    This particular attack, as it’s based on random tempdir names and filenames, is also co-dependent on ‘Indexes’ being enabled on the server. As the temp dir is a known location, without any index file, if indexes are enabled, and you go to that url, you will be happily presented with a list of the randomly named temporary directories that you can click on and then get a list of the ‘temp’ files in that directory that you can then click on to run. Since the temp file is named ‘.php’, if PHP is not disabled, you’ve just been hacked.

    Adding the following to an .htaccess file in the uploads folder will help to protect your site from this and future similar attacks as well.

    `
    <Files *.php>
    deny from all
    </Files>
    `

    Luckily in my case this was already in place, so no further infection was found.

    I’d recommend to the programmers in this case, if they are hell bent on using the ‘uploads’ folder as a ‘temp’ directory to ensure that they have an empty index.html file in the temp directory to help stop this attack vector.

    And I would recommend to all wordpress users to disable/block php from running in the uploads folder(as above), because it’s not only these programmers that have decided that the uploads folder is a great place to use for general plugin data storage.

    I’d go further and propose to all plugin coders that they stop this practice and instead create/support a non-web-accessible directory for such purposes which completely removes the attack vector in its entirety.

    I’m no security expert and don’t pretend to be, so take this advice at own risk.

    For people who have been hacked through the upload flaw. I contacted the people at Plugin Vulnerabilities https://pluginvulnerabilities.com. They are aware of this issue and have given me a temporary fixed until the authors update their code. This will disable the upload capability of UM though.

    Below is what they told me. I changed the code and had no issues with other upload areas of WordPress. It just disabled UM uploading.
    ______________

    One quick temporary fullproof solution to prevent that functionality from being abused, if you can live with not being able to upload images through that functionality, is to add the lines

    $ret[‘error’] = __(‘Functionality disabled’);
    exit(json_encode($ret));

    right after the line

    function ajax_image_upload() {

    in the file /includes/core/class-files.php. That will cause the function to exit before going through the upload process.

    Just realized I’ve had this same exploit happening to me through UM for the last several days, maybe 5-10 days at most, that I’ve noticed.

    The first signs were myself being redirected to other spammy websites when visiting my homepage. These spammy websites were trying to convince me to turn on chrome notifications for these sites, and I of course closed these tabs with out interacting with them.

    Then today someone else I know emailed me letting me know they got the same results.
    I also get these redirect attempts when I visit the wp-admin portal to login to my dashboard.

    I’ve run the WordFence scan at high sensitivity, and it found a plethora of mainstream WP files infected. 10-15 or so. Here are some examples of infected files:

    location: wp-content/plugins/um-recaptcha/uninstall.php
    Details: This file appears to be installed or modified by a hacker to perform malicious activity. If you know about this file you can choose to ignore it to exclude it from future scans. The text we found in this file that matches a known malicious file is: ${“\x47\x4c\x4fB\x41\x4c\x53”}. The infection type is: A backdoor known as qd5f27f0.

    location: wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php
    Details: This file appears to be installed or modified by a hacker to perform malicious activity. If you know about this file you can choose to ignore it to exclude it from future scans. The text we found in this file that matches a known malicious file is: ${“\x47\x4c\x4fB\x41\x4c\x53”}. The infection type is: A backdoor known as qd5f27f0.

    location: wp-super_cache.php
    Details: This file appears to be installed or modified by a hacker to perform malicious activity. If you know about this file you can choose to ignore it to exclude it from future scans. The text we found in this file that matches a known malicious file is: “cr”.”eat”.”e_fun”.”cti”.”on”. The infection type is: Pattern commonly seen in PHP malware.

    and the kicker, which brought me to this thread actually:
    Filename: wp-content/uploads/ultimatemember/temp/ZdCQEGllparORuQ7TMjwLlWw7pVcbzJmVXtCUiT7/stream_photo_9c8d90bc587c22ae9aef83fcdb2a02d0_5b69a8f8885c8.php
    Details: This file appears to be installed or modified by a hacker to perform malicious activity. If you know about this file you can choose to ignore it to exclude it from future scans. The text we found in this file that matches a known malicious file is: <?php eval($_POST[. The infection type is: A backdoor known as EP.

    the stream_photo_….php file opens as an image, spoofed of course. it has code inside. the image was of an 8bit cat. I did a reverse google image search and this did not turn up anywhere else on the internet. Image uploaded here if you want to check it out.
    https://ibb.co/kWi2GU

    The only readable code in the spoofed image php file was this bit. Screenshot below:
    https://ibb.co/etW6bU

    it uses the php function file_put_contents() to write base64 encoded text to a new file, called n.php. This file was actually in a couple of the temp folders as well next to the error log.
    This is a screenshot of what n.php looked like:
    https://ibb.co/dEpjwU

    there was also an error log in 2 of the temp folders, I presume from the hacker making mistakes or certain parts of the code not executing as expected? It looked like this:
    https://ibb.co/hSqk39

    hope this helps – would love to know more about this and also get this fixed asap.

    @lucasmorgan: Your description is very helpful, especially for people googling certain keywords or file names.

    A fix has already been released: See https://wordpress.org/support/topic/danger-security-issue/#post-10575091 and https://wordpress.org/plugins/ultimate-member/#developers

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Malware files being uploaded’ is closed to new replies.