Anatomy of the HBGary Hack
PCM2 writes "Recently, Anonymous took down the Web sites of network security firm HBGary. Ars Technica has the scoop on how it happened. Turns out it wasn't any one vulnerability, but a perfect storm of SQL injection, weak passwords, weak encryption, password re-use, unpatched servers, and social engineering. The full story will make you wince — but how many of these mistakes is your company making?"
The story of their being hacked and how it was done has probably done more for systems security than they as a company ever have......
I've been following this since I heard of it happening- definitely interesting. I like the idea of a custom CMS to avoid an open one (more security). And the poor admin who gave out root, dropped firewalls, and gave up the correct username all via email- that's a bummer. I bet that will be among his "worse day ever" collection. As for shared passwords, I'm sure a lot of us work at guilty companies. Hell, active directory exists partially to address the need for multiple passwords. In all, I enjoyed reading how it was done- quick, efficient work.
But how many of these mistakes is your company making?
Most companies probably make these mistakes, all except the biggest mistake which was poking a sleeping bear.
Got Code?
Well, we're not going after 4chan/anonymous, so we're probably in the clear.
I think the biggest security mistake it's possible to make is antagonizing the largest collection of bored hackers/crackers/script kiddies/associated hangers on that exists.
Looks like they got taken out by Little Bobby Tables...
http://xkcd.com/327
http://www.object404.com
I'm just amazed at how completely oblivious "Chief Security Specialist" Jussi Jaakonaho was during the email correspondence, AND that he was perfectly fine with sharing root passwords via plaintext email.
How do these people even get security jobs and be negligent in even the simplest security practices?
Gotta say, the linked article was a great education for me, one who's interested but never had time to dig into some of the arcana of stuff like SQL injection.
In watching Wikileaks, OpenLeaks, Egypt, the Palestine papers,and now HB Gary, I'm thinking that we're at the edge of something monumental. I expect we'll see a lot more formerly secret data become public, and see governments and corporations either clean up their acts, or become increasing desperate and hostile in trying to keep their inside info secret.
Either way we're in for a wild ride!
Three Squirrels
The exact URL used to break into hbgaryfederal.com was http://www.hbgaryfederal.com/pages.php?pageNav=2&page=27. The URL has two parameters named pageNav and page, set to the values 2 and 27, respectively. One or other or both of these was handled incorrectly by the CMS...
Because social engineering is so totally an Uber Advanced Hacking Technique. Anyone who hands out a root password, enables remote root SSH access, and shuts off a firewall because of an email message is dangerously complacent.
They are the Tacoma Narrows bridge of the IT security world now. They will be the textbook case example of the generations of students, with the entire repertoire of what not to do every step of the way, especially the one about not pissing-off a malevolent, anonymous mass.
http://bobby-tables.com/
the preceding comment is my own and in no way reflects the opinion of the Joint Chiefs of Staff
http://lmgtfy.com/?q=SQL+injection
You're missing something.
http://www.hbgaryfederal.com/pages.php?pageNav=2&page=27
Obviously the 2 and the 27 are not being validated before being appended into part of a larger SQL query, so construct your own URL substituting 2 (or 27) with something like 2';show tables; --
Find the one that looks like it contains user login information and then substitute again with 2';select * from user_table; --
Hey presto, you can now read all the user accounts and hashed passwords.
They are giving you the original URL where the injection was used, not a link to the actual injection.
They probably replaced some of those parameters with the injection code.
page is probably how many results per page they want, and pageNav is what page they want, so probably page landed straight into a LIMIT in a sql query, without any kind of treatment. Most likely, just passing that crap through mysql_real_escape_string() would have been enough.
WTF am I doing replying to an AC at 5 A.M on a Friday night?
ok actually.
websites take input from users. like when i log in to slashdot, it asks me for input.
it will run the input through a program, which will talk to a database.
how does it talk to the database? it runs an SQL command, like 'SELECT * FROM TABLE USERS WHERE NAME=$username'
$username for me is 'decora' because thats what i type into my little login box.
but lets say i uhm, type into the 'username' box something like 'decora OR name=cmdrtaco'.
now, instead of just getting my info, it might spit back all of cmdrtacos info too! maybe even his hashed password.
to protect against this, most programs will take measures like:
0. validate input (does the username have spaces in it? reject if so)
1. check the SQL query to make sure its 'safe' and contains no parsable SQL commands.
2. dont write stuff like 'SELECT * FROM', only read stuff you need.
3. validate data returned from the SQL query before printing it to an html page.
ie. if yr supposed to get one 5 datums back per user and instead you get 10, somethings wrong.
then again all that takes time and money and effort to do.
why bother, if nobody will ever care? the company that made the CMS for HBGary probably
contracted out the programming to some other company that hired people off a website,
(i have no evidence of course).
Watson: What is "http://www.hbgaryfederal.com/pages.php?pageNav=2&page=27" Alex
It's easy to monday morning quarterback this thing but consider the following two points (from TFA):
1. The social engineering portion of the attack originated from Aaron's company gmail account (HBGary used Google Apps for mail), which anonymous had gained access to through the gmail account of the admin who re-used his password from the hacked CMS. So the email to the Finnish sysadmin came from Aaron's gmail account (i.e. Anonymous was effectively impersonating Aaron using his own credentials).
2. The email exchange, which is repeated in TFA, shows that Anonymous used information from Aaron's old emails, including two previous root passwords, to further reinforce the notion that the email did indeed come from Aaron Burr who was in a jam before meeting clients in Europe and needed root SSH access asap.
So while the method itself may not have been sophisticated, the wording of the spear phishing messages, carefully chosen to create just the right combination of credibility and urgency, really was a master stroke. Obviously Anonymous has a few people who have done this before. Besides, have you ever tried to make credible pretext emails or phone calls to social engineer information? It's harder than it looks.
I think the big one is my CEO ain't talking shit about a bunch of hackers who are better at it than him.
I'm trying to teach myself to set people on fire with my mind... Is it hot in here?
Revenge is almost never the right thing to do. It is a thing to do, and it's an unfortunate human trait that the overwhelming majority of us feel when we have been wronged or perceive that a wrong has been committed against us. I've posted in a previous thread about my thoughts related to this, but I can essentially sum it up by stating that I think it was wrong what Anonymous did primarily because they have may have hurt many more people than just Barr. Though I do admit that I can't think of a more deserving target than Barr given his arrogance that could have lead to hurting innocent people with his own hands. And I think that's one of the more frightening underpinnings of this story that isn't getting due press--what happens if a (rogue) researcher is so confident he's identified a dangerous group of hackers that he's willing to do whatever it takes, even if his assumptions were completely wrong? What if they're so hungry for clients or press that they don't care if innocent people get slammed?
The other thing that surprises me about Barr is that he must have been greatly ignorant of basic childhood rhymes. There's plenty of sayings that come to mind that I'm sure he's heard before: play with fire, and you're going to get burned; don't poke the bear; let sleeping giants lie; and the list goes on and on.
Back to the discussion: sure, it's surprising that a security/consultancy firm like HBGary was hit so hard by something as simple as the attacks outlined in TFA, but I think it is far more surprising to me that Mr. Barr did not see this coming. From the previous articles I read on Ars Technica, it seems to me that the only level-headed person in the whole ordeal was Barr's programmer--a man who warned Barr numerous times not just about possible retaliation but that the names Barr had accumulated were almost certainly innocent people. But Barr was certain that they were the right names. Can you imagine the damage he would have done if he released them publicly or to the FBI (assuming that the FBI would take him seriously--I'd like to believe they wouldn't, but given the recent DHS fiasco with FreeDNS I have my doubts)? The potential for some poor innocent bystander who happened to friend the wrong person on Facebook may have found their doors knocked down at 6AM for something they didn't do. All that because of Barr's certainty he was right.
I guess it just surprises me that a security company whose job it is to analyze malware and is almost certainly well aware of the personality profile of the typical attacker didn't see this out of control freight train. I know that doesn't justify thoroughly destroying a company, but I don't think they're particularly deserving of much sympathy either. Barr's programmer warned company executives in the e-mails as reported by Ars, and I seem to recall at least one exchange where one of the higher ups told Barr to back off. He didn't, and he cost all of them dearly.
It's not unlike having a family reunion at the zoo where one of the overly curious bull-headed adolescents decides it would be funny to open the bear cage and poke it with a stick or throw rocks at it. He is then surprised when he and his entire family is mauled.
Family member: "Aaron, what are you doing?"
Aaron: "I'm going to poke the bears."
Family member: "Don't do that. They'll get angry."
Aaron: "I just want to open the cage."
Family member: "Are you serious? That's got to be the stupidest thing I've ever heard."
*bear cage opens, bear gets poked*
*assorted growls and screams*
Weeks later, in recovery; Aaron: "I don't know why it was so angry..."
Regardless, I'm with a couple of the previous posters. This is going to go into college books for the next 30-50 years as an example not unlike Enron. Further, as someone else also pointed out, Barr probably did more to further educate the technology-minded masses on exploits in a single week by screwing himself over than he has in decades.
On the plus side, I doubt he'll be poking the bear cage any time soon.
He who has no
It's on par with what Sterling wrote in The Hacker Crackdown.
Who started with the vigilantism here?
Aaron Barr at HBGary. He's not law enforcement and as far as I know wasn't under contract by any law enforcement agency to root out the members of Anonymous.
Yet he's threatening to name names. To accuse people of participating in disruptive, possibly criminal activities.
Not in a court of law. But in public.
He's going all "Wild West" on people here and threatening to "pull his gun".
In this case, Anonymous responded in kind and Aaron Barr, shootist, is now laying in the street in a puddle of his own blood.
Unfortunately, Anonymous brought a gatling gun to a pistol fight. So lots of other people have huge bullet holes blown in them too.
Now I deplore "hacktivism" as the WORST possible way to convey one's message to people.
But I'm VERY familiar with the notion of making it painful for people who're harassing you to continue to do so.
What Anonymous did was wrong. Make no mistake about it.
But what did these jackholes THINK was going to happen?
Chas - The one, the only.
THANK GOD!!!
HBGary and HBGary Federal are 2 different companies, that are related. HBGary was the one hacked.