Online Services

Blog

  • Endpoint vs Cloud Security: The Cloud WAF Bypass Problem

    Earlier this year at Black Hat 2016 there was a lot of buzz around “endpoint security”. In this post I’m going to explain a few issues with a cloud approach to web firewalls. Then I’ll explain the benefits of endpoint security and why Wordfence takes an endpoint approach to protecting your investment.

    The Cloud WAF Bypass Problem

    Cloud firewall providers like Sucuri and Cloudflare have servers that live out on the internet. When you configure a cloud firewall (or cloud WAF), the provider will ask you to point your website at their servers by making a DNS change. Once you’ve done that, the cloud provider configures their servers so that when your web traffic arrives there, it is filtered using their firewall rules.

    Once filtered, the traffic is forwarded over the public Internet to your website. In this configuration your original website is known as the “origin” or your “origin server”. That is where your site originates from and is actually hosted.

    Your origin server may be hosted at Bluehost, Hostgator, Godaddy, on your own server or with one of the many other hosting providers.

    In theory once you have configured your website with a cloud firewall (or cloud WAF) you are protected by it. The expectation is that attackers will try to access your website using your domain name of www.example.com, they will be pointed to the cloud WAF and their attacks will be filtered out.

    In reality, if an attacker can discover your origin IP address, they can simply bypass the cloud WAF as the diagram below shows:

    cloud-waf-diagram

    In the case of a cloud WAF, you aren’t actually “behind” a firewall because the server is still on the public internet. Anyone on the net can access your server directly if they discover your origin server IP address. Knowing your origin server IP allows them to simply go around the cloud firewall provider and attack your origin server.

    Cloudflare have acknowledged this problem in a blog post and they provide various suggestions on how to keep your origin server IP address “secret”. They also explain how to access your origin server directly for testing if you have the IP address.

    We refer to this problem as the “Cloud WAF Bypass Problem”.

    The Cloud WAF Bypass Problem is Well Documented

    This issue is well documented by many security bloggers. Tools like CloudPiercer.org and CrimeFlare exist to help attackers bypass a Cloud WAF.

    CrimeFlare lets you look up a Cloudflare customer’s origin IP address or download an entire database of 1.5 million Cloudflare customers and what CrimeFlare detected as their origin IP address.

    CloudPiercer uses an array of techniques to reveal a targets real IP address. They estimate that 70% of sites protected by cloud WAF providers have their origin IP address exposed. More detailed stats and our own data is included below.

    Keeping the Origin IP Address Secret is Difficult

    There are many ways to discover a site’s origin IP address. You can:

    • Look up the IP address of subdomains like mail.example.com and ssh.example.com. In many cases they point to the origin IP address. (See below for detailed statistics)
    • Use an IP history database like viewdns.info to look up where the origin IP was hosted before the website started using a cloud WAF.
    • Use the site certificate and a search engine like Censys.io or Shodan.io to locate the origin IP address where the certificate is installed.
    • Perform an action that gets the site to connect somewhere, revealing its origin IP address. For example, on WordPress you can initiate a pingback to a site which will cause it to connect back to you, revealing its origin IP address.
    • Use DNS records like SPF which might reveal the origin IP or adjacent addresses.
    • Examine site HTML source which may include subdomains that point to the origin IP address.
    • Examine public source or log files which may include the origin IP address or subdomains pointing to the origin.

    The original designers of the net never intended IP addresses to be secret. There are no standards or conventions on the net that describe how an IP address might stay secret. In fact standards like SSL certificates and de facto standards like WordPress Pingback make it virtually impossible to keep an IP address hosting a website secret.

    Search engines like Censys.io and Shodan, well known in the hacker community, go around and index the internet at a network level, indexing SSL certificates and network service information. They provide a treasure trove of information to attackers who are looking for targets.

    Censys.io lets you easily search for the origin IP of any website by using that sites certificate. The results below are from a search on Censys using the certificate common name (website hostname) of Reddit.com which is behind Fastly and Cloudflare. An attacker would use the origin server addresses to launch an attack that bypasses the cloud WAF.

    screen-shot-2016-10-04-at-7-57-23-am

     

    34% of Cloudflare sites can be bypassed using just one of these techniques

    To determine the scale of this problem we did an automated survey of 30,753 randomly selected Cloudflare customers. We tested how many sites are accessible by simply bypassing Cloudflare and accessing the site directly. We only used one technique to discover the origin IP: Looking up a common subdomain. We didn’t use the pingback technique, site certificates or any of the several other techniques detailed above.

    We found that we could directly access 34% of Cloudflare customers, or one in every three customers, bypassing any security that Cloudflare provides, by simply looking up a common subdomain.

    To perform the audit on subdomains, we took the following steps:

    1. Verify the customer is using Cloudflare and store a copy of their website home page. We checked HTTP and HTTPS and the site with and without the www. prefix to locate it.
    2. Look up common subdomain IP addresses.
    3. Verify the subdomain IPs don’t point to Cloudflare.
    4. Remove duplicate IPs.
    5. Try to fetch the site from the origin IPs directly by connecting directly and specifying a ‘Host’ header in the HTTP request.
    6. Where we received a response, compare the original page title and first asset (first item in a src= attribute) with the page we just fetched directly.
    7. If they match, then count it as a successful bypass.

    As you can see from the chart below, looking up the IP address using the ‘mail’ subdomain is by far the most successful technique. Over 50% of cloud WAF customers that reveal their origin IP do so through the ‘mail’ subdomain. The ‘ssh’ domain is also a common culprit, likely because Cloudflare’s own documentation use it to illustrate how you can connect directly to your own origin IP address.

    screen-shot-2016-10-11-at-7-45-30-am

    The Fix: Protect the Endpoint and Prevent Bypass

    Endpoint protection has taken the industry by storm during the past year. Almost every major vendor is providing some form of endpoint security. So what is the endpoint exactly? An endpoint can be defined simply as: the final target a hacker is after. In the case of desktop security, it is the workstation a user works on. In the case of mobile platforms, it’s the smartphone a user has in their pocket.

    In the case of WordPress, the endpoint is the actual WordPress installation that the attacker is trying to compromise. We believe that to best protect a website, you need to protect the endpoint.

    The first benefit of protecting a website at the endpoint is there is no way for an attacker to bypass the security mechanisms. They can’t go around the Wordfence Firewall because it is an integral part of the endpoint. To use the endpoint application, you have to interact with our firewall.

    The second major benefit is that, by protecting the endpoint, we can provide a defense in depth strategy. We don’t just provide a firewall. We also include a malware scanner and a range of other features. It’s not feasible to include a malware scan unless you are executing on the endpoint itself.

    wordfence-waf-diagram

    Conclusion

    To fully protect your investment you need to employ an endpoint strategy that takes a defense in depth approach to security. Wordfence takes this approach.

    As our company has evolved we have had to consider whether we would invest in “cloud” security or focus on protecting our customers where their assets are. We chose to stay on the endpoint and the industry has now also shifted their focus to protecting the endpoint.

    In our opinion, using a cloud WAF is like hiring a security firm in Los Angeles and asking all of your visitors to go through their Los Angeles offices before visiting you in New York. We believe in posting guards where the assets are and putting additional defenses behind that first layer of security. This proven approach works for the over 1.5 million sites we protect and it is where the industry is headed.

    The post Endpoint vs Cloud Security: The Cloud WAF Bypass Problem appeared first on Wordfence.

  • WordPress Hack Modifies Core Files to Share Spam

    WordPress Hack Modifies Core Files to Share Spam

    One of the worst feelings a website owner can experience is discovering that your site has been hacked. Without proper security measures in place, even website owners with the best intentions can lose control of their website. When hackers gain access to your site, they can use it to host phishing content, distribute malware, steal…

    The post WordPress Hack Modifies Core Files to Share Spam appeared first on Sucuri Blog.

  • 18X Speedup in Wordfence Scan

    Wordfence 6.2.0 was released yesterday and it includes something really special: a huge improvement in scan performance. I’m going to share with you what changed and why Wordfence 6.2.0 is the same great quality malware and security scan running up to 18X faster.

    Malware scanning is a critical part of the layered approach to protection that Wordfence provides. The Wordfence Firewall stops attacks in their tracks. Scanning is how we determine if a hacker has gained access to your site. You’ll recall that we’ve also integrated the malware scan into the Wordfence Firewall to scan file uploads as they arrive. This gives you three layers of protection against attacks.

    Our Firewall has always been extremely fast and the malware scan built into the firewall uses the same model of execution. While we are always looking for ways to optimize our firewall code, we really don’t need to improve in that area because it’s so darn fast already.

    However, we had received reports from a few users that scanning would take quite a long time on larger sites. We have also had reports from a few hosting providers that when a large number of scans are running concurrently (200 or more), they could use a lot of disk IO resources.

    So we decided to tackle this issue head-on and work closely with our customers and hosting providers.

    Working to make scan faster

    I met with one large host in person and had a very informative and collaborative discussion (Thanks Heidi!!) that included follow-up conversations with our team and a direct channel of communication with our devs and QA team. Then we put our heads down and got to work.

    Ryan Britton, one of our senior developers at Wordfence led the technical effort and Matt Rusnak led the QA effort on this project. They went away and worked on this and when they came back with the numbers, I couldn’t believe the results.

    scanperformance3

    To measure performance, we isolated the process running Wordfence and monitored disk reads. The above bar charts show the amount of data read in megabytes for the older version of Wordfence compared to 6.2.0 which is in green. Less is better because it reduces the amount of IO load on the physical server hosting the site running Wordfence.

    • For Wordfence 6.2.0 we halved the IO load on sites running a brand new plain WordPress installation.
    • On a small site of around 92MB we achieved a 3.6X reduction in disk IO load.
    • On a larger site with 682MB we are seeing an impressive 18.4X reduction in disk IO load.

    Larger sites will see an even greater increase in speed and reduction in IO load during scans. We don’t know what the average size of a WordPress site is, but we estimate that it’s similar to the large site model we used. My personal blog, for example, is 552MB of files and it’s been around for a reasonable amount of time.

    Scan functionality and detection capability stays exactly the same.

    We haven’t reduced the number of signatures we’re using for detection or the number of files we read. There was a bugfix included in this release where we no longer scan .txt files unless you have ‘High Sensitivity’ scanning enabled, but that is unrelated to performance improvements.

    How we made these huge performance gains

    We achieved this huge speed increase by changing the way we’re performing MD5 and SHA256 hashes of files, getting smarter about not hashing files where we aren’t using the hash and reducing the hashing operation to a single streaming read on each file.

    We also removed counters that were not needed that were increasing file reads. In addition, this new release keeps better track of which directories have been scanned so that we don’t need to reiterate through a large list of directories when the scan resumes.

    It’s worth noting that image-heavy sites will see a particularly large improvement in scan speed.

    …And then we went even further!

    One of the amazing things about the Wordfence team is that they are super passionate about what they do. For 6.2.0 I was expecting to get a modest increase in scan speed. Instead we got a huge gain in scan speed. Then the customer service team got involved and encouraged Dev and QA to go even further.

    What they came up with is what we’re calling a “Low resource scan”. When this option is enabled, Wordfence does exactly the same amount of work, but it introduces an artificial delay in the scan which consumes no additional resources but spreads the disk IO load out over time. This reduces peak usage load on servers that have slow disk or that are hosting a lot of other busy websites.

    You can enable the “Low resource scan” by going to the Wordfence options page on your WordPress site, scroll down to the “Scans to Include” heading and then at the bottom of that section you can find the option labeled “Use low resource scanning. Reduces server load by lengthening the scan duration.”. You can find the documentation for that option here.

    As you can tell from above, we have massively reduced the amount of disk IO that Wordfence generates, but just in case that’s not enough and your hosting provider asks you to reduce things further, you can now enable this option.

    In our tests, the low resource scan takes 1.7 to 3.7 times longer to run, depending on your site, while reducing peak load. Again, it does the same amount of work, just spread over more time.

    The low resource scan combined with our much faster scan engine gives you a very low impact way to regularly scan for malware while keeping your hosting provider happy and your site super fast. We recommend most people leave this setting off, but in extreme cases of limited resources, customers can now enable this setting.

    We recommend the following configuration:

    You will find the best performance gains when Wordfence is using the default scan configuration. For our own sites we leave low-resource scanning off and just use the default Wordfence options. The scan is now incredibly fast.

    On my own blog with 6127 files totaling 552MB of space, my scan now finishes in 24 seconds from a cold start to finish. I run my personal site on the cheapest $10/month Linode server available. That is incredibly fast on a very modest server.

    We think the standard configuration will work great for the vast majority of sites out there.

    In Conclusion

    As always a huge thanks from me to our incredible team for this collaborative effort. And a very special thanks to the customers and hosting providers who worked with us to help us better understand their needs.

    Wordfence remains committed to securing the WordPress community and platform. To that end we work closely with our customers and hosting providers to ensure that we continue to provide the best protection available for WordPress. This is another major leap forward in achieving our goal of a secure WordPress community and a more secure Web.

    As always we welcome your feedback in the comments below, or you can contact us using one of the channels on our contact page.

    The post 18X Speedup in Wordfence Scan appeared first on Wordfence.

  • Interview with Security Researcher Pan Vagenas

    Panagiotis VagenasAt Wordfence I’m really proud of the team we have. Our team are all amazing people who work hard every day to help secure WordPress websites. A few months ago we published the first installment in a series of posts where we introduce you to a few of the incredible people who work here and give them an opportunity to share with you a bit about themselves, how they became interested in information security and some of their knowledge.

    Today’s interview is with Panagiotis “Pan” Vagenas, a security analyst at Wordfence. Pan is known for discovering vulnerabilities in Easy Forms for MailChimp, WP Fastest Cache and All in One SEO Pack among others. Besides Pan’s public contributions, he has made significant contributions internally at Wordfence to our research and our products.

    As you know, Wordfence runs as a completely remote working team. Most of us are based in the USA and we also have team members in Sweden and several other countries. Pan is based in Athens, Greece. When Pan isn’t discovering security vulnerabilities and doing security research, he is a passionate motorcycle rider who loves exploring high mountain roads and steep hills.

    What attracted you to information security?

    I love solving problems, so information security seemed to me like the ultimate problem to solve. I also care a lot about online privacy, love breaking code, I like cryptography and of course I saw WarGames at a very young age.

    Besides that I believe that what we do in information security is protecting real people’s lives and that intrigues me a lot. So who doesn’t want a job like this one?

    Can you describe some of your early adventures when you started playing or working with information security?

    Back in the 90s we had these dial-up modems that dial a number and connect to a server. They were servers that were like forums and/or chatboxes and this was where all the cool kidz were hanging around at that time. So I was trying to connect to a server, but that required a username and a password. Fortunately there was this chatroom that anyone could connect before getting in the subscribers area so it only took a macro. Unfortunately it didn’t take long before my telephone number got banned.

    Why did you become interested in the WordPress space?

    Some years ago I had this project involving an e-zine and I was looking for a platform that would be flexible, extensible, secure and easy to code with. So I had to try this WordPress thing that I had heard so much about and it seemed like a perfect fit for the project. I guess programmers can fall in love with a program (after all code is poetry) and this was love at first sight.

    You have developed a reputation for finding zero day vulnerabilities in WordPress plugins. Can you talk about how you choose which plugins to focus your energy on and your process for finding 0 day vulnerabilities?

    There are some cases where I have found a vulnerability as part of an investigation into a hacked website. Frequently I hit a tag in the plugins repository and choose plugins that look interesting. After that I review the code and use several tools to quickly test specific things, like injectable JS code in parameters, fuzzing input and things like that.

    I think the biggest advantage I have in this is that I understand pretty well how WordPress works. This allows me to easily spot mistakes developers make which could lead to a security issue. In the WordPress community a lot of people are contributing in a wide variety of ways. This is my way of contributing – always working to make this community more secure, or at least less vulnerable.

    In the past few months you have started focusing your energy on big data analysis to find new threat intelligence. Can you talk about some of the things that you’re able to do with this new approach?

    This was a real revelation for me. Analyzing our attack data gives us the ability to have true insight on what and how the bad guys are doing what they do. By analyzing attack data we now effectively have a real-time feed on new malware and 0-day vulnerabilities.

    We process a large number of malware files every day. We are always working to close the time gap between a new malware appearing in the wild and getting a rule deployed that protects customers from attacks using that malware.

    We examine and analyze millions of attacks every day in search of 0-day vulnerabilities. Doing this we always stay updated with latest attack techniques and vulnerabilities, used in real cases. This gives us the ability to verify that our firewall is protecting our users from all known vulnerabilities, build new rules and to extend the protection we provide our customers.  It also means we contribute back to the community by giving a heads up about vulnerable products and by publishing research.

    What do you think is the biggest threat for WordPress site owners currently?

    Unpatched code. Either in core, plugins or themes. By ‘unpatched’ I mean outdated code that is being used on a website where the site owner has not updated to the newer version with a security fix. Outdated code is the biggest threat a site owner faces.

    Fortunately in most cases this is an easy problem to solve. WordPress has an integrated update system which makes updating a website as easy as possible. Security updates in core are now getting auto-updates if this isn’t disabled in a website, and we’ve seen some plugins and themes getting auto-updates for security releases.

    How has Wordfence evolved since you joined the company 6 months ago?

    For several years now Wordfence has been doing a great job, so I suppose this was a fast moving train before I got onto it. When I first came on-board our firewall wasn’t yet released. And then there was the firewall! I seriously believe this was a huge milestone.

    And then there have been all those excellent professionals joining us. Now we are de facto the leader in WordPress protection, site cleaning and hack recovery.

    I feel like Wordfence is moving so fast towards becoming a leader in the security industry that I consider myself really, really lucky to be joining this train.

    Do you see a future where WordPress is a secure publishing platform?

    I believe WordPress is getting there. There is no such thing as total security, but WordPress is a mature platform taking security seriously and is thoroughly checked by many security researchers. I think this, combined with Wordfence is what it takes to have the most secure CMS out there.

    The post Interview with Security Researcher Pan Vagenas appeared first on Wordfence.