Thursday, April 29, 2010

Rethinking Defensive Technology: BarbWire




Read about any current topic on information security or talk with any professional and you quickly find that the state of the Internet is in pretty bad shape. Companies, users, and governments are constantly under attack and the defensive technologies in place aren't effective at keeping them safe. The current trend within information security is to advocate defense in depth. That is essentially to say protecting the perimeter (firewalls, IDS/IPS), protecting the machines (AV, encryption, client-firewalls, proxies), and educating the users to give the largest barrier to being compromised is what everyone needs to do. To give a medieval analogy, this is essentially saying that every citizen of a country should be located in a fortress, wear plate mail armor at all times, and know how to use at least one weapon. There are obviously lots of problems with this, the main one being as a defensive technique it doesn't work. Even with defense in depth people can still be, and are, compromised.

Lets look at the failures...

First off the firewall. While still essential for protecting against legacy Internet worms, it is ineffective at preventing an attacker from obtaining access to a network. Not only are there now tools for circumventing firewalls, but the bad guys have gotten smart enough to use common open ports (http, https, etc) when redirecting out of a network. Conficker is a recent easy example of a worm which received updates over http. Additionally criminals have broken Google. It is now impossible to make one of the top Internet searches without being directed to malware by one of the links. By using automating techniques for Google trends and Search Engine Optimization (SEO) cyber criminals have been successful at breaking the most popular search engine. Tactics of social engineering have now circumvented the protection that a firewall is able to provide. 30 years after their development we have reached the limits of what firewalls can protect us from.

Next lets look at anti-virus. Signature based anti-virus (which is to say most kinds) is failing. Malware signatures within the past couple years have been in the millions. The bad guys have perfected polymorphic code which automates and obfuscates a malicious program so that each time it spreads it becomes a different virus (or at least a different signature). On top of that malware developers test their programs against antivirus just to make sure it isn't detected. Most Anti-Virus products now protect against less than half of malware. That is to say even the most up to date system with full patches and recent AV definitions is still over 50% vulnerable. Needless to say, anti-virus has been successfully emasculated in the current cyber conflict.

Finally lets talk about user education. There is one main problem with this approach, most users don't care about security until something breaks. Unfortunately many users across the net, find it either too cumbersome to pay for anti-virus products or update their software. This is often what causes the success of worms or viruses many months after a patch was released to stop them. Not caring about security is also why compliance is the driving force for information security in business. It comes down to a simple fact: if businesses don't have to spend money on security they won't. So much information security spending comes only after a breach has happened or when a company has to abide by the law. Companies have learned to fear the auditor more than the cyber criminal. So while security education is good in theory, it is definitely not the silver bullet and may even be the wrong approach to take. Most users don't want to know about security they just want something to work.

This problem of defense though is not only limited to deficient technology, it also lies in the global nature of the Internet. Criminals can not easily be found or apprehended when they commit cyber crimes in one country and are located on the other side of the globe (often in a country which doesn't recognize their actions as a computer crime). So while
headlines will tell of hackers being brought to justice, most cyber criminals are still at large. Additionally arresting people doesn't solve the problem, it only delays it, as others can easily take up their place within the internet. Even taking down ISP's, a new tactic by security professionals, has shown to have only a limited short term effect when stopping the bad guys. Essentially we are now fighting a battle with swords and metal armor against enemies who have Inter Continental Ballistic Missiles (ICMB). Is it any wonder that we're losing?

So the question comes up, what do we do now? Do we hack the attackers? While, this is the fantasy of every security professional, it is unfortunately illegal and not a viable solution. You can't stop crime by causing it. Stealing from thieves doesn't prevent theft, it just adds to it.

Clearly we need to rethink defense. To make an analogy in chess, the bad guys have better position and tempo than the good guys. However there still may be ways to give the defense a upper hand. Rather than relying on international laws to finally catch up with technology (which lets be honest that probably won't happen soon), technology can be used to fight technological threats.

To continue with the analogy of chess, instead of just blocking our opponent what if we protected our pieces. What if we made it so they had to lose a piece in order to take one of ours. What if instead of building walls to block intruders we put up barbwire, land-mines, and set booby traps? To come back to technology, what if every time an attacker tried to automate a password attack, execute some shell code or do a web attack, they essentially DOS'd themselves? What if we could make it so the cost of an attack was so technologically expensive that it would eclipse the amount of money gained from its success? If we could do this for every computer attack there is, it would essentially kill the current thriving black market. We are already familiar with the ways computers can be compromised, it is now a matter of developing the technology which makes this disadvantageous for the attacker.

Some of this technology has already been created. So what would happen if we took Liston's genius and combined it with an IDS or AV? The idea being that every time this new Frankenstein contraption detected an attack, instead of only making an alert or blocking an attack it would instead slow the attacker, essentially increasing their CPU cycles and causing their attack to not only fail but bog down their system(s). Implemented in the right locations throughout the internet this technology could have devastating effects on automated attacks that are currently happening every day.

To help facilitate this idea and test my hypothesis I've began a new project called BarbWire. It is an effort to combine the two products mentioned above and create a new type of defensive technology. I definitely invite anyone who would like to contribute on this project to contact me. Defense should no longer be only about blocking attack, it should also be about preventing part of the motivation and ease behind them. As defenders we need to rethink how we engage our enemies and what weapons will actually cause them to stop attacking. By understanding our enemies and adapting our tactics to theirs we should be able to tip the scales and bring about a safer cyberspace for everyone.

Friday, April 16, 2010

Dionaea Honeypot: Trials, Tribulations, Success, and Notes

A few months back I made a decision to increase my infosec skills and become more involved in the security community by building a honeypot. After doing a little research, and talking to a few people from the Shadowserver Foundation I found dionaea would be the best route to take. I decided to use Ubuntu server as the OS on a Dell Latitude C600. Unfortunately my first attempt was unsuccessful. After scouring the internet for more tutorials on setting up the system and coming up short, I decided to take another swing at it and take some notes for others who may attempt to set up there own honeypots.

Below are the notes I took that weren't covered in the guide provided on the dionaea website when building the server (after OS installation):
  • -autoconf - nothing installed (don't worry about this)
  • -Don't need to sudo to export
  • -had to install flex for libpcap to configure
  • -libpcap requires flex and yacc which you will need to download as byacc: sudo aptitude install flex
  • sudo aptitude install byacc
  • -don't install udns for Ubuntu, so don't need the flags on the dionaea configure/
  • -no back slash "\" in configure command
  • Don't forget to set the permissions on the /opt/dionaea directory, otherwise you won't get any logs.

  • Once I had everything installed, the question arose... "how to I run this thing?"
      • Go to /opt/dionaea/bin type ./dionaea
      • With encouragement from others I now do: ./dionaea -r /opt/dionaea -w /opt/dionaea -p /opt/dionaea/var/dionaea.pid -l all -L '*'

    Finally honeypots are useless if you can't extract the data. Dionaea has an upgraded feature from Napenthes of using sqlite, unfortunately I was initially unable to use this feature so below is a command to get some of the data from the logs:
      • alt: cat /opt/dionaea/var/log/dionaea.log | grep connected

    I'm currently looking into writing a python script that will strip some further data from the logs and present it in graphical form. Stay tuned!

    Special thanks to @commonism @ethicalhack3r and @sempersecurus for all their help and guidance.

    Wednesday, April 14, 2010

    New Uses for Old Systems

    At the rate that technology has been increasing, if you buy a new computer within 3 years it will be old, decrepit, and nearly obsolete. With MS and Apple coming out with new operating systems every 3-5 years this trend of your old computer becoming little more than a foot rest becomes even more apparent. However, with a little creativity and technical knowledge this doesn't have to be the case.

    Welcome Open Source. Open Source is a great movement, one that may of even helped to establish and bring the internet to the glory it now basks in. This movement has created a community where some of the brightest minds have collaborated to make solutions that can then be contributed to, collaborated on, and expanded. It is a bit of a stepping stone idea if you will, and if to quote Isaac Newton its a manner of seeing further by "standing on the shoulders of giants."

    Three operating systems dominate the open source landscape (and their variations), and offer new vitality to your dead and dying systems; Linux, BSD, and OpenSolaris. From these systems you can create servers (file, ftp, web) or networking devices (firewalls, proxies, Intrusion Detection System).

    For someone who is interested in infosec this is particularly useful. Ever wanted to learn how to manage a firewall? How about IDS? Want to know how to setup and manage a proxy? Maybe you need a system to test vulnerabilities against? Or learn about web vulnerabilities? How about a honeypot?

    So next time your family or friends are thinking of throwing out their old computer offer to adopt their neglected technology, and find it a new life and new home to help you develop your own computer knowledge, skills, and abilities.