Online Services

Category: Security

  • Hackers Find Fresh WordPress Sites Within 30 Minutes

    Last week our team attended Black Hat and DefCon in Las Vegas, two of the biggest information security conferences on earth. DefCon alone attracts approximately 20,000 information security professionals, researchers, government employees and fans. To say it is very busy is an understatement.

    One of the interesting presentations at DefCon this year discussed a way for attackers to quickly find new WordPress installations to target. The presentation was given by Hanno Böck, and in it he discusses a method attackers can use to find a WordPress website just 30 minutes after it has been installed for the first time.

    About three weeks ago, we published a blog post titled “The WPSetup Attack: New Campaign Targets Fresh WordPress Installs” where we discuss how we are seeing attackers specifically target fresh WordPress installs and how to avoid being attacked. Hanno expands on this risk in his presentation.

    Certificate Transparency is an open standard that allows the online community to monitor SSL certificates that have been issued to websites. This allows, for example, websites like Facebook to monitor if someone has ordered an SSL certificate for one of their domains. It also allows security teams to monitor if a certificate authority (companies that issue SSL certificates) has mistakenly issued a certificate it shouldn’t have.

    Anyone can use certificate transparency data to see new SSL certificates that have been issued. The data includes the website domain name. Hanno’s research showed that within 30 to 60 minutes of a new SSL certificate being issued, attackers can see it in the certificate transparency report. This provides attackers with a way to discover new websites to attack.

    The sequence of events would go something like this:

    1. You order a new website hosting package from a hosting provider. Your order includes a free or paid SSL certificate for your domain.
    2. The SSL certificate is issued once your order completes.
    3. 30 minutes later, attackers see your fresh website listed in the certificate transparency report.
    4. At that time – 30 minutes later – you are halfway through completing your website setup and are just beginning to install WordPress.
    5. An attacker is constantly monitoring your new domain, and as soon as they see the setup script, they run it, install a back door and then reset your site to the state it was in so that you don’t notice.

    We described how the WPSetup attack works in our post three weeks ago. This new technique gives attackers a way to reliably find and attack fresh websites as they are being set up.

    Last week we also discussed the risk of using utility scripts like searchreplacedb2.php which don’t have any authentication, and that anyone on the Internet can access. The technique described above to discover freshly installed websites could also target these utility scripts. Thirty minutes after installing a new website, you probably think no one knows about it yet and that it is OK to install a utility script that isn’t protected by a password. Using the above technique, an attacker can scan your site for temporary utility scripts and also use them to gain entry if they are unprotected by a password or authentication.

    To avoid all of the attacks above while you are setting up your new website, we suggest either limiting access to your IP or setting up basic authentication. Both of these can be done using .htaccess.

    How to Limit Access to Your Site Based on IP Address

    You can limit access to your website so that only your IP address can access the site. Here are the steps to do that.

    1. Find out what your IP address is by visiting whatsmyip.org.
    2. Create a file called .htaccess in your website root directory.
    3. Place the text below in the file and replace the marker with your IP address.
    order deny,allow
    deny from all
    allow from 

    That should block anyone who isn’t from your IP address from accessing your web applications. Test it by using FTP or SSH to change the IP slightly and you should lose access to the website. Make sure you aren’t using a web based file manager, or you will block yourself when you do this test.

    Once you have set this up so that only your IP can access your site, you can go ahead and continue setting up WordPress and anything else knowing that no one else can abuse your setup scripts.

    To remove the access control, simply delete the above lines from your .htaccess file and access for everyone else will be restored.

    How to Set Up Basic Authentication

    Setting up basic authentication is a bit more complex. You will need access to a Linux shell to be able to create your password file. Once you have set up basic authentication, your browser will pop-up a prompt to enter a username and password whenever you access your site.  The basic procedure is as follows:

    First you need to use the htpasswd utility on the Linux command line to create a password file. The command to create the file looks like this. Replace ‘mark’ with your own username. You should be prompted for a password.

    htpasswd -c /homedir/webroot/.htpasswd mark

    If you need to install htpasswd to run the above command, you can find it in the apache2-utils package on Ubuntu Linux. If you don’t have access to htpasswd, we suggest you contact your hosting provider for help creating the password file.

    Once you have created the password file, you need to add the following to a .htaccess file in your website root. Make sure you replace the path to the .htpasswd file with your own path to your password file.

    Authtype Basic
    AuthName "Put anything here"
    AuthUserFile /homedir/webroot/.htpasswd
    Require valid-user

    Once you are done, you should see a prompt for a username and password when you try to access any part of your website. Enter your username and password to access your site and continue setup. This will prevent an attacker from accessing your site while you are busy setting it up.

    To remove the above access control, delete the above lines from your .htaccess file and access for everyone else will be restored.

    Stay Vigilant

    This is another great example of attackers using evolving techniques to identify targets and attack websites. We now know that attackers can easily identify new websites and attack them while they are being configured. As long as you use the techniques described above while your site is in setup mode, you should be safe from this kind of attack. Please share this post with the community to make them aware how attackers quickly find fresh WordPress installs.

    The post Hackers Find Fresh WordPress Sites Within 30 Minutes appeared first on Wordfence.

  • Gravityscan Introduces Free Daily Security Monitoring With Trust Badge

    Today our team is launching a very exciting program at Gravityscan: a free trust badge program for your website that comes with daily security monitoring. You can find the full announcement on the Gravityscan blog.

    Wordfence provides a comprehensive security solution for WordPress publishers, including the best available firewall and malware scan for WordPress. The Gravityscan badge includes a few additional benefits, which I describe in this post.

    Blacklist Monitoring

    Wordfence currently checks two blacklists to ensure that you don’t have a problem with your site reputation. The free monitoring included with the Gravityscan badge checks 20 additional blacklists. These checks happen daily, and if we find a problem, we start serving a transparent badge, which quietly removes the badge from your website and ensures your content flow remains the same.

    We then send you an alert email letting you know there is a problem. Gravityscan will continue monitoring your website, and once the problem is fixed, your badge automatically reappears. This gives you a reliable trust badge with daily monitoring that you can react to without disrupting your users’ experience.

    Content Monitoring

    Gravityscan’s badge program can work with any platform, including WordPress, Joomla, Drupal, Magento and many others. If you have additional software running alongside WordPress, Gravityscan will scan that too.

    Gravityscan also checks your external website links against blacklists. If we find a link that has appeared on a blacklist, we quickly let you know about it so that you can remove the link.

    By making sure that your external links are not on any blacklists, the Gravityscan badge program makes sure that your site visitors avoid visiting any sites that may harm their computer. We also help you avoid any Google penalties by ensuring all your external links have a good reputation.

    Malware Scanning

    Gravityscan’s malware scan works with any website and does not require that you run WordPress. You can choose between Gravityscan’s standard remote scan, or you can install the Gravityscan Accelerator which provides a faster and deeper scan that includes source-code scanning. The only requirement to use Accelerator is that your site must support PHP. Otherwise, it will run on any website and will give you deep daily scheduled malware scans.

    Earn Your Visitors’ Trust

    As you can see, the Gravityscan badge provides several additional benefits to help secure your website and protect your search engine rankings. One of the most important benefits is that it makes it clear to your website visitors that you take security seriously.

    Trust badges improve conversion rates on your site by letting your users know that you are proactive in securing your website and keeping their data secure. This goes a long way toward earning your visitors’ trust and loyalty, and can provide you with an instant boost in revenue, especially if you run an ecommerce website.

    Peace of Mind for Any Website

    The Wordfence team recommends that if you run a website, you participate in the free Gravityscan trust badge program to help secure your site, protect your investment and let your visitors know you take security seriously.

    I’m incredibly proud of our team for once again creating an innovative security solution for our customers that helps secure their websites and improves online security overall. Setting up the badge on your site is easy, fast, and best of all, completely free.

    Install the Gravityscan Trust Badge on your site today.

    ~Mark Maunder – Wordfence Founder & CEO.

    The post Gravityscan Introduces Free Daily Security Monitoring With Trust Badge appeared first on Wordfence.

  • If You Use This Script, You’ve Probably Already Been Hacked

    Hacking Made Easy

    Several years ago, web publishing company Interconnect/IT released a handy tool for finding and replacing text in a website’s database. This tool, a stand-alone file published as searchreplacedb2.php, includes built-in WordPress compatibility that makes working with WordPress databases a breeze.

    Unfortunately, it doesn’t include any authentication or security measures, which makes infecting WordPress databases equally easy.

    During the last few weeks, our Security Services Team has noticed a spike in infections using this script. The hackers use their botnets to look for the script all over a target site. The following is a sample of log entries searching for this file.

    We tracked scans from a set of known malicious IPs over the past two months and you can see the activity below:

    If they find this file, they simply use it the same way a website owner would – except in this case, they exploit a website.

    We have prepared screenshots of the script in action. It’s a very simple process using several pages. The first page prompts the user choose to automatically get the database login information from the WordPress configuration file. Note the warning about removing the script – we’ve omitted it from the rest of the screenshots, but that warning is actually present on every page.

    In the second step, you confirm the preloaded database login credentials.

    In the third step, you select the table(s) you want to work with. Hackers are selecting the posts table.

    Finally, you enter the text you want to search for and the text with which you want to replace it.

    This is what the hackers are doing:

    They’re simply looking for “<a href” which is code they know will be present in virtually every post on a WordPress site, and they’re prepending a remote Javascript include to it. This Javascript immediately redirects users through several intermediate sites, finally arriving at pages containing spam or malware.

    Here is an example of a destination page:

     

    The hackers actually don’t even have to walk through each of those steps – they can collapse it all into a single request. In an instant, an innocent site is completely hijacked.

    Who Is Behind This?

    Like most malware campaigns, this one involves computers around the world with no clear connection to each other. Many of them are probably infected with malware, unwittingly participating in the hackers’ botnet. However, we noticed that a few key servers are located in the Netherlands.

    traffictrade[dot]life -> 185.183.96.33 (Host Sailor Ltd, NL)
    trafficbroker[dot]club -> 185.183.96.33 (changed on June 20 from 5.149.248.164, which is registered to another Dutch company, HZ Hosting Ltd)
    2clicks[dot]xyz -> 109.206.179.191 (Serverel Corp, NL)

    Passive DNS data shows that the IP addresses associated with these domain names have not changed throughout this campaign. In other words, the hackers haven’t had to switch to a new server after their first one was shut down. They may have found a set of lenient Dutch hosting companies who turn a blind eye to their illicit activities.

    Does Updating Help?

    Searchreplacedb2.php is actually an old version of the script. But the present version, 3.1.0, is essentially the same tool and still does not include any security measures (besides a warning). So updating to the latest version doesn’t make it any safer.

    This newer version isn’t a single file, but instead runs as a collection of scripts in a folder named Search-Replace-DB-master. We don’t have any records of hackers checking for the presence of this folder, but it is only a matter of time before they add it to their list of targets.

    Test Your Site

    To check if this file is present on your site, simply run a Wordfence scan. If you are not using WordPress, you can also run a Gravityscan – and make sure you install the Accelerator for the best available detection.

    What to Do If You Are Vulnerable

    If you have searchreplacedb2.php on your site but you don’t need it anymore, delete it immediately.

    If you do need to use it on your site, then upload it with a different filename. Keep it uploaded only as long as you need it, and then immediately remove it.

    A broader security principle applies here: run only as much software as you need. If you leave a script lying around, whether it’s a powerful tool like searchreplacedb2.php or a simple file with nothing but phpinfo() in it, you are offering some portion of your site to hackers. If you keep plugins and themes around even though you don’t use them, you are maintaining a risk that is completely unnecessary.

    What to Do If You Have Been Hacked

    If you have searchreplacedb2.php unsecured on your WordPress site, then the odds are high that you have probably been hacked. If you have it and your users are being redirected away, then you have definitely been hacked. Head to our site cleaning page and let the experts on our Security Services Team handle it for you.

    Lesson For Developers

    Developers, take heed: it doesn’t matter if you put a security warning on every page of your product. It doesn’t matter how bold the font is or how dire the wording is, or how easy it is for the user to delete the vulnerable script when they are done with it. Users will still forget or just ignore the warnings, and when that happens, bad guys profit. Make your code secure by default.

    Conclusion

    As always, be aware of what is installed on your system, and routinely enlist the help of Wordfence and Gravityscan to assist you in finding any possible security holes.

    This blog post was written by Brad Haas, a senior security analyst at Wordfence and team lead for our Security Services Team. Brad has years of experience both in incident response and in securing sensitive government networks. 

    The post If You Use This Script, You’ve Probably Already Been Hacked appeared first on Wordfence.

  • Wordfence Scan Gets Faster and Smarter

    Wordfence is highly effective at securing your website in part because it is tightly integrated with the WordPress API. We know your visitor identity information, so we can make smart decisions about who gets access and who gets blocked. It’s very different from the way generic firewalls work.

    This allows us to create powerful firewall rules and algorithms that have more data, and can therefore improve detection rates while driving false positive rates down to zero.

    Over the past few years we have worked closely with our customers to improve Wordfence performance on their websites. Several recent Wordfence releases have shown spectacular gains in performance. Continuous improvement is one of our core goals with Wordfence, and so we went even further.

    We have been reaching out to hosting providers to better understand their needs over the last few months. They are, after all, the platform our customers use to serve their site visitors. Our engineering team has worked with some of the largest hosting companies in the world to create radical improvements in the way Wordfence uses resources.

    Today we are announcing Wordfence 6.3.14, which is the fastest and smartest Wordfence yet. I’m going to describe a few of the improvements we have made.

    Smart Scan Time Distribution Across VPS Instances

    Wordfence now centrally monitors scans that are running on the same server. If we see too many scans running on a single physical or virtual server, we’ll temporary defer any new scans. Once the number of concurrent scans decreases, we start the deferred scans.

    This will typically only delay your scans from starting by 30 minutes or less, but it has huge benefits for you and your hosting provider. If you graph all the Wordfence scans happening on a single server, you will now see a smooth constant graph of scans instead of seeing spikes that could have harmed overall server performance.

    This “smoothing algorithm” helps hosting providers better predict and manage server performance, and it helps our customers by ensuring their sites are always running on a high-performing server.

    New Lightweight Scan Introduced

    Parts of our scans use almost no server resources. We decided to break these items out from the main Wordfence scan into a separate scan that can be run more frequently.

    The lightweight scan checks for:

    • WordPress Core updates
    • Outdated themes
    • Outdated plugins
    • Themes with known vulnerabilities
    • Plugins with known vulnerabilities

    The new lightweight scan runs every 24 hours on all Wordfence sites, both Premium and free.

    New Scan Schedule for Free Customers

    If you are using the free version of Wordfence, we’ve changed the frequency with which your full malware scan will run. Prior to this week’s release, Wordfence ran a full scan every 24 hours for free customers. We’ve changed it to run once every 72 hours.

    We will continue to schedule when scans run for free users, and the scheduling now varies based on the number of scans occurring on the shared server that you are on.

    Our free users will still receive the new lightweight scan every 24 hours so that they receive time critical alerts about themes, plugins and WordPress core as soon as possible.

    Wordfence Premium customers continue to have the ability to schedule unlimited scans to run whenever they want each week. In other words, if you’re a Wordfence Premium customer, your existing scan schedule remains completely unchanged. In general, we recommend a maximum frequency of once every 24 hours, but of course that is up to you.

    Wordfence Manual Scans Are Unchanged

    For both our free and Premium customers, we have not made changes to your manual scan capabilities. You can still run a manual scan on your site as often as you would like.

    The manual Wordfence scan includes all the checks it always has. In other words, it includes the checks that your full Wordfence scan has always done, along with the checks from the new lightweight scan we introduced this week.

    Connecting With You

    Over the years, we have found that working closely with our community and with hosting providers has yielded huge dividends when it comes to better understanding the needs and challenges that you face and how to better secure our customers. The latest Wordfence release is another great example of the results that come from that ongoing collaboration.

    We would like to thank the hosting providers who worked with us to make this release a reality and the users who have provided feedback.

    As always, I welcome your feedback and comments below and will be around to reply to you.

    The post Wordfence Scan Gets Faster and Smarter appeared first on Wordfence.