php, privilege escalation, python, random, research, security, shell

Getting a reverse shell on your Seagate personal NAS

Three_Seashells

I needed a cheap NAS system and had originally intended to give this one away as a gift to a relative for Christmas. However, said relative isn’t very technical and tl;dr I’m awful at choosing gifts for people so I decided to poke the proprietary device and see if we could have some fun with it.

The exact model that we will be talking about in this post is the Seagate Personal Cloud 3TB (STCR3000101).Here are a list of useful features:

  • Time Machine backup support for OS X (Broken on El Capitan)
  • Stream to Chromecast / AppleTV / Roku, LG & Samsung smart TVs
  • Use the Seagate media app to access content remotely
  • Web based control panel
  • Ability to install 3rd party applications like WordPress, OwnCloud, and Plex media server (This functionality will be important later)
  • more features are included but less important to me

So let’s start up by connecting this thing to our network and perform a port scan.

PORT STATE SERVICE
22/tcp open ssh
80/tcp open http
81/tcp open hosts2-ns
82/tcp open xfer
83/tcp open mit-ml-dev
139/tcp open netbios-ssn
443/tcp open https
445/tcp open microsoft-ds
548/tcp open afp
631/tcp open ipp
1080/tcp open socks
2222/tcp open EtherNetIP-1
3128/tcp open squid-http
8000/tcp open http-alt
8080/tcp open http-proxy
8088/tcp open radan-http
8888/tcp open sun-answerbook
9000/tcp open cslistener
9091/tcp open xmltec-xmlmail

As you can see there isn’t anything special, but there are some services we care about like SSH / SFTP, HTTP(s), etc. My initial test of bruteforcing the root user via SSH and sFTP did not seem to work. So looks like we’ll have to find another way to get shell access.

I mentioned about the useful features this proprietary NAS comes with, and this is exactly what we will be taking advantage of to get our shell today. How can we get shell access without SSH?

Continue reading

Standard
exploits, fail, php, research, scripts, security, Uncategorized

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.

Continue reading

Standard
BASH, exploits, random, research, scripts, security

Thwarting WordPress XMLRPC & GHOST attacks

http://i.imgur.com/GcI4xxd.gif

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.

Standard
cloud, python, random, research, scripts, security

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. 

Continue reading

Standard
BASH, php, random, research, scripts, security, Uncategorized

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!

Continue reading

Standard