I.T. Security and Linux Administration

November 28, 2012  3:56 PM

The operating system of Call of Duty is….

Eric Hansen Eric Hansen Profile: Eric Hansen

…looking like it’s going to be Windows, according to Slashdot.

For those who aren’t familiar with Call of Duty and it’s release cycle, a new game is put out every year, around the same time (mid-to-late November).  This has been the case for about 5 or so years now.  As such, it has gotten a lot of flak in the gaming community for being a rehash of previous years’ titles.

How is this, gaming, relevant to Windows?  Why am I posting this in a primarily Linux-focused blog?  Because I see this being the trend for more than just Windows and a handful of Linux distros.  I also feel this is one of the worst possible mistakes that can be made in terms of operating system life cycle and development.

Some Linux distros are well-suited for it.  They fair-warn users ahead of time and also make it known in many different areas that things can break way too easily.  Lets think about this for a minute.

Windows has always been known as the “noob operating system”.  Those who don’t want to venture into the realm of actual operating system usage go with Windows.  Thus, Windows has also sort of solidified it’s placement in I.T. as the safe and secure operating system.  There’s a lot of reasons why it’s really not a bad operating system in general.  In this happening, it has made Windows become a pretty solid operating system considering it’s inherent faults of being closed source.

With them releasing a new Windows operating system yearly, however, this will severely reduce the amount of effort Microsoft can put into solidifying their operating system before a new one is put out.  This is an issue a lot of rolling release systems suffer from.  By the time a major issue/exploit/etc… is found, they’re already dedicating too many man hours into the next release to be able to go back and fix their current product.

November 28, 2012  3:08 PM

IPv6 Transitioning

Eric Hansen Eric Hansen Profile: Eric Hansen

An interesting article was posted on Slashdot.org: http://tech.slashdot.org/story/12/11/28/1355225/ipv6-deployment-picking-up-speed

In it, it talks about how the transition from IPv4-IPv6 has been extremely slow, and some other common statistics.  Overall, the information in it proves un-newsworthy, but the whole idea in itself that IPv6 has yet to even really become mainstream is disheartening.

IPv6 has been out, according to the article, for 15 years now.  In that 15 years, IPv4 finally ran out of addressing blocks in early-2011.  Here we are going into 2 years later and IPv6 is still on the back burner.  Even most VPS providers are not offering many (if any) IPv6 addresses.  This causes an issue of migration because as I see it, it’ll be too late to do anything by the time we actually need to give out the IPv6 addresses.  It will take businesses a good year if not more to be fully rid of IPv4 addressing (thinking medium businesses).  There’s the issues of not knowing what software will be fine, not work at all, need tweaks, etc… then the internal migration of moving servers and services over to different addresses.

I know typically it’s not that big of a deal when it comes to services, as they tend to bind to all or a specific IP, but if one of those pieces of software does not play nice with IPv6, then your entire infrastructure can be torn down until a replacement or fix can be made.

Now is the time for businesses to actually put a foot forward in migrating to IPv6.  This hasn’t been a random spurring of scenarios, either.  It’s been known from day one that this will happen, just a matter of time.

November 24, 2012  11:20 AM

HSTS : The HTTP Strict Transport Security

Eric Hansen Eric Hansen Profile: Eric Hansen

There’s a new RFC that was published this month (http://tools.ietf.org/html/rfc6797) about an additional layer of HTTPS for web browsing, called HSTS (HTTP Strict Transport Security).  The basic idea behind it is that the server tells the browser that only HTTPS is allowed, or where to find the secure version of the website, while browsers that don’t support this feature will browse the insecure version.

Now there’s really no comparison I can find behind this and just simply using a rewrite rule in your favorite web server to force HTTPS, but it’s still an interesting take.  It seems like an additional handshake for a service that actually does nothing more than force security on a user.  The use cases (http://tools.ietf.org/html/rfc6797#section-2.1) further exemplify this fact.

From their thread model, it handles passive and active network attackers, as well as imperfect web developers.  However, it does not fix phishing and malware issues.  One has to wonder then what the point of HSTS is?  It basically does everything HTTPS but perhaps over HTTP (which, then, would nullify security completely and be a broken chain…)

I know RFCs are not intended to be super-awesome-de-facto things, and some are even jokes (the coffee pot protocol comes to mind), but this is just like saying “hey, I wrote a web server by compiling Apache’s code!”  I’m just not following it, and while it has some interesting points of use (using the UA string and HTTP response headers), I’m not sold on this as being a viable security solution.  All it sounds like, especially by the last threat model use, is a lazy man’s ways of forcing HTTPS on users.

November 24, 2012  11:07 AM

Starting with Tornado in Python: Setting Up Your Server

Eric Hansen Eric Hansen Profile: Eric Hansen

There’s a good collection of different Python modules to use so you can run a server through Python (think SimpleHTTPServer). One that is commonly used behind Nginx proxies for handling API requests, however, is Tornado (http://www.tornadoweb.org). Since creating my backup service I have chosen Tornado as the backend to my API to provide an efficient and secure service to allow users to write their own clients.

Installing Tornado
To install Tornado all you have to do is this in Pypi:
pip install tornado If you don’t have Pypi installed, then you can install it from sources:
python set.py install This will install Tornado in your Python repos so you can now simply import it into your scripts. Now to cover some simple usages.

Initializing Tornado
The main thing we are going to focus on right now is setting up a simple ‘web’ server. This will allow you to have Tornado listen for connections and handle them appropriately. To start, import Tornado’s HTTP web server code:
import tornado.httpserver
We also need a reference to I/O handlers, so we need ioloop:

import tornado.ioloop To make this easy on us we will define a main() function:
def main(port = 8888): The magic inside is what makes this work.

Lets say we wanted to serve content from our server with a specific URI only. We’ll make this URI /get/sysinfo and /get/cpuinfo. Our main() method will look like this:
def main(port = 8888):
ioloop = tornado.ioloop.IOLoop.instance()
application = tornado.web.Application()
http_server = tornado.httpserver.HTTPServer(application)
except KeyboardInterrupt:

tornado.ioloop.IOLoop.instance() creates an instance of our I/O so we can send/receive network data. application is our reference to our tornado.httpserver instance, and we tell it to listen for /get/sysinfo and /get/cpuinfo requests, and forward them to our InfoHandler class which I will show in a bit. We then have our web server listening on the specified port, and try to start it. The exception is in place in case you are running this manually, so if you do Ctrl+C no Traceback information is displayed.

Now that we have Tornado checking for a request, we need to be able to handle such requests. This is where our infoHandler class comes in.

Handling Requests
class InfoHandler(tornado.web.RequestHandler):
def get(self, call):
resp = valid_calls
# log error message
We need to subclass the RequestHandler class so we can read and write data on the stream. To write data back to the user use self.write(), and to get data from the user you simply call self.get_argument(). So if someone sent the URI: /get/cpuinfo?core=1 you would do core = self.get_argument(‘core’).
What is valid_calls? This is a dictionary of ‘key’ : ‘value” where the key is the request being made (i.e.: ‘sysinfo’ and ‘cpuinfo’) and the value being a reference to the function. For example:
def SysInfo():
return "sysinfo printed from here"

valid_calls = {'sysinfo' : SysInfo} To get this up and running we then just do a simple name check and call main:
if __name__ == "__main__":
import sys

October 31, 2012  4:45 PM

[Python] Send notifications to your phone using Pushover

Eric Hansen Eric Hansen Profile: Eric Hansen

Sure there’s Python modules out there that let you use Pushover, a smartphone service that lets you send notifications from any device to your phone, but all of them I’ve seen so far limit your messages to 512.  This makes perfect sense in that Pushover limits messages to 512 characters.  However, that’s not to say you can’t send bigger messages per-say.

Continued »

October 31, 2012  4:32 PM

[Python] Wrapper for redis-py

Eric Hansen Eric Hansen Profile: Eric Hansen

In a recent project I needed an easy-to-use lookup, but cachable, system to store information for periods at a time.  I wasn’t really feeling the use of a strictly file-based cache system (i.e.: writing data to a file, reading form it, etc…) as most of the work is already I/O bound as is.  A friend of mine then introduced me to Redis, which is basically a memory-cache system that works based on key-value (or name-value) pair.

Continued »

October 30, 2012  10:31 PM

Ubuntu 12.10 and the Privacy Invasion

Eric Hansen Eric Hansen Profile: Eric Hansen

I’m far from a supporter of Ubuntu.  While I feel it has it’s place in beginner Linux users transitioning from either Mac or Windows into a new world, I also feel Ubuntu has lost it’s place.  I recently installed Ubuntu 12.04 back in August due to laziness of not wanting to configure different aspects of my system.  This turned out to be a mistake on my part, which leads me into 12.10.

Continued »

October 29, 2012  7:28 PM

Window Manager Review: Awesome

Eric Hansen Eric Hansen Profile: Eric Hansen

I don’t have a lot of experience with many window/desktop managers (i.e.: KDE, Gnome, e17, etc…).  However, one I have loved using, especially on my netbook, has been Awesome (http://awesome.naquadah.org/).  There aren’t that many tile-window managers out there, and if they are they’re often overlooked with the bigger-game ones.  What drew me to Awesome originally, though, is that it eliminates around 90-99% of the mouse use, so you can essentially operate every aspect of the window manager with just your keyboard.

Continued »

October 29, 2012  11:37 AM

[Python] Check to see if a number passes as a credit card

Eric Hansen Eric Hansen Profile: Eric Hansen

Last month I went over a series of articles on how to use Balanced Payments to handle credit card processing in Python.  This time, continuing on with the credit card processing, I’m going to provide a small script that will show you how to validate a number as a credit card number.

This can’t be used to buy something with false credit card information, but was a fun little side project I decided to work on, and thought I would share.

Continued »

September 30, 2012  8:56 PM

[Python] Processing Credit Cards Part 5 (Viewing Transactions)

Eric Hansen Eric Hansen Profile: Eric Hansen

After being able to complete transactions, the customer service aspect of this begins.  Now you have to be able to view transactions and all the details that come along with it.

Continued »

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to: