1337 st. Austin Texas

Pwning the utility company

Edit: This is a fictitious story, there is no utility company, our villain in this story “the utility company” is an example. However attacks like this occur every day, so I wanted to shine light on how they happen in a proof of concept that was displayed properly to my audience in a safe environment and with an entertaining back-story. Take the article with a grain of salt and always be responsible in disclosure. I hope that you enjoy the read.

One day a user was checking their mail and had realized that they failed to take care of a utility bill. Frantically, they took steps to pay the bill online via the self-service web application. The application was fairly simple and straight forward. In order to “authenticate”, if you could call it that, was to enter the account number and hit a button to continue. Upon hitting the button needed to continue the payment process the user was displayed a page with several pieces of personally identifiable information (the same data in a phone book):

  • Address
  • First & Last name
  • Phone number

In such an angry state of mind the user tried to login as fast as they could, mashing the keys that consisted of their assigned account number so that they can get the sting of another bill out of the way. Hitting the enter key displayed the usual page that they were used to seeing, asking them to confirm account information, except something this time was very different. The name was not correct, it was someone else’s name that lives in the same state as the user, and obviously uses the same utility company. Confirming the account number was correct the user noticed that the last digit was the issue, it was exactly one digit above their account number. Typically this indicates that the account numbers are based on incremental values (more than likely auto_increment). Are you thinking what I am? This could be scraped. So I setup a test lab with my own code and fake data to test a proof of concept.

Read the rest of this entry »

Thwarting WordPress XMLRPC & GHOST attacks

GHOST – CVE-2015-0235 hit the internet and caused a lot of commotion, and it was found to affect WordPress installations through xmlrpc.php. This file is constantly a security issue to the WordPress community. The file has caused things from successful brute-force attacks, to XMLRPC DoS attacks that bring down the targeted website. The XMLRPC protocol is used by WordPress to add entries in a programmatic manner. Using my favorite iptables module (string) we can drop requests that are attempting to abuse xmlrpc.php. By dropping this traffic we thwart any potential DoS, brute-force, and GHOST attacks that are being automated right now.

$ iptables -I INPUT -p tcp --dport 80 -m state --state NEW -m recent --name wordpress-XMLRPC-firewall --update --seconds 10 --hitcount 3 -m string --string 'GET /xmlrpc.php HTTP/1.1' --algo bm -j DROP

$ iptables -I INPUT -p tcp --dport 80 -m state --state NEW -m recent --name wordpress-XMLRPC-firewall --update --seconds 10 --hitcount 3 -m string --string 'POST /xmlrpc.php HTTP/1.1' --algo bm -j DROP

What is happening above is that we are looking for traffic on port 80 initiating a new connection, and then we use the strings module to find the HTTP request and then we drop the traffic originating from the attacker if they open more than 3 connections on xmlrpc.php in less than 3 seconds, then they are therefore unable to initiate connections over port 80 thus thwarting the most common attacks on WordPress XMLRPC.

Et tu, Hue?

The term “Big Data” has been flinging around quite a lot lately. It is in the news all the time. We hear about how much it has pushed us into the future and into the internet of things. These things all will produce useful data that will need to be analyzed and stored. One technology that we hear more and more about is Hadoop.

Hadoop was birthed as an open source project from the Google filesystem (GFS), and Map Reduce white-papers; the creator is Doug Cutting and the open source community. Map reduce is the core of Hadoop, and allows the user to write very simple programs to distribute workload across a complex amount of data. The Google filesystem inspired the majority of the work for the open source Hadoop filesystem (HDFS). HDFS is a redundant filesystem written in Java that distributes data across multiple machines that can be analyzed using Map reduce programming. That is just a brief dive into what Hadoop is, and if you want to learn more I highly recommend you take a gander at the Yahoo Hadoop tutorial.

Here is an ecosystem filled with projects that make managing this complex monster easier on administrator’s and developer’s. One of these projects that I really enjoy is Hue, the Hadoop User Experience. It gives a web interface for the user to query their data using some of these projects that live in this big data ecosystem like:

Each of these tools sits in front of a plethora of data that the user is analyzing. This data can be anything from a company’s customer generated data that tells a music service what song to play next, to another company trying to figure out which ads to serve you based on your browsing history. My point being — Hue has access to some seriously valuable information.

As with most technologies, security is often an after-thought. It is important we test the security of these applications so that we can protect my data and your data from the evil-doers who will sell the same information or use it for awful things. Perhaps a criminal can use pilfered data about you to create malware that you will more easily fall prey to. 

Read the rest of this entry »

AutoPwning cPanel shared servers

cPanel has had a very large impact on the hosting industry. This single company has enabled people to build their dreams overnight with $5 — the American dream. cPanel’s largest offerings to the industry have been the cPanel/WHM web-server management software. It’s actually pretty stellar software, and offers the systems administrator an abundant amount of tools to just get shit done on a large scale. The shared hosting market is huge — no, it’s colossal.

Shared hosting is essentially stuffing users onto one server allowing them to share the servers resources. I’ve seen cPanel servers with well over 1000 users. To an outside security researcher this would look like a rich opportunity to take one machine, with a very large reward. With cPanel each customer could have more than one website hosted in their account(sharing the same IP), meaning if even only a few accounts were compromised some-how in the shared stack the amount of data that could be at risk is pretty scary.

So, how could someone compromise a shared cPanel server, or at least enumerate it’s users? Well with Science of course!

Read the rest of this entry »

The dangers of incremental hostnames

Unfortunately it’s become a common practice to use incremental hostnames for several different reasons. As I’ve written in other posts about enumerating subdomains, a lot of these results coming back contain an incremental naming structure. This is interesting, because one could use the incremented naming structure to map and locate a lot of information about a particular group of servers within a given infrastructure(a production distributed MySQL farm for instance; db1, db2, db3). This can be used as a powerful reconnaissance tactic.

How does this happen? Why do we use this naming system for servers that will expose them to potential security issues? It’s pretty common for scalable systems to assign an incremented hostname upon instance creation when being auto-scaled.

For example; let’s say that we know the hostname of a server that looks like it could be incremented.

dustin@atxsec ~ $ host server1.gamingservers.local
server1.gamingservers.local has address
dustin@atxsec ~ $ host server10.gamingservers.local
server10.gamingservers.local has address
dustin@atxsec ~ $ host server11.gamingservers.local
server11.gamingservers.local has address

Now..I wonder what would happen if..
Read the rest of this entry »