Saturday, April 22, 2006

plug plug plug

i forgot to do this previously, i just wanted to plug alex's IDA debug loader plugin that was released at cansec as part of his presentation there.

i did some testing with it when i got back and the results showed that it improved ida's accuracy identifying functions quite significantly. i had a particularly gnarly dll where ida kept marking code as data and using his plugin cleared up a LOT of that problem.

i also have to say it's awesome it's released to the public for free under the BSD licence WITH SOURCE. thanks alex !

oh THANKS DAVE, THANKS A MILLION

hello dailydave readers. i already emailed dave to say thanks for ruining my famously low profile.

on the bright (i guess) side, him doing so has forced me to make a post i've been mulling over for the past while so you have a long "interesting" post to read and not just me making fun of slashdot users. it's largely inspired by a recent stratfor email (i'm a huge fan of these guys) and a recent discussion on dailydave on the usefulness of HIPS products.

i realized that the discussion was basically the same discussion that comes up over and over again on mailing lists (no, not the one about if disclosure is good or bad). after reading the aforementioned stratfor email, i realized this argument is really just another form of the idealism v realism debate.

it goes like this :

Idealist : all security products designed to stop attacks/attackers are useless and snake oil, because a skilled enough attacker can always evade the HIPS/evade the NIPS/defeat the heap protection/own you.

Realist : security products are useful and worth purchasing because they can stop unskilled attackers armed with off the shelf (freely downloadable) exploit frameworks like metasploit (although hd's recent talk at cansec stated that the new nips evasion techniques evade almost every product) and they stop actual malware as seen on the internets.

i think my bias/opinion probably shows even in that simple problem statement, but what can you do, it's human nature. i started thinking about idealism v realism at cansec when someone told me that hips are useless and trivial to evade (idealist). i said, ok chief, julien's release of slipfest makes it easy to test ways of evading them, but the fact remains that i've seen a hips product stop metasploit, core IMPACT, and some malware from the internets, so you can't really deny it does serve some purpose (realist).

i will trot out some awesome industry buzzword bingo here and say that in my opinion, security is not stopping 100% of all possible attackers, it really IS about threat modeling and threat mitigation. if you're expecting the top 2% of attackers to come after you, you need a top shelf solution. if your threat model is whatever random malware is out there running on web sites your users are browsing with IE, you need something good enough to stop that. sure, you leave yourself open to some things, but if these things aren't in your threat model and you're willing to accept that risk, so be it. this is big picture shit, which if you're thinking about security and what you need to do about it, is what you should be thinking about.

the stratfor email i read made what i thought was a very good point: that realism will always win in the short term (pragmatism) but it needs to be guided long term by idealism. the 'state of the art' in computer security seems to me to be a trickle down effect. techniques/exploits/vulnerabilities are created/discovered and kept private, then maybe they get distributed to a small group of people, then maybe they published somewhere in a non mainstream publication/location, etc etc and then eventually someone implements them in a form so easy to use that anyone can do it. the idealist says, we need to be thinking about these problems because mr. realist, although you may say they are not in widespread usage by j random attacker right now, someday soon THEY WILL BE. this boils down to, think about the future, or it will kick your ass eventually. maybe the industry has realized this, and this is why research is pretty hot again right now...

thanks again, dave, good to see you and sinan last night as always.

Friday, April 21, 2006

sorry...

but i don't think translating assembly code to C code that basically emulates the assembly code and doesn't look anything like "real world" C is really what we're looking for here..

loop detection is one very very small piece of the problem. please refer to my earlier post.

it's obvious that after 12 yrs of work martin ward has done a really good job of building a tool that's extremely useful to migrate from assembly to C that is functionally equivalent and obviously really makes a huge difference to his business and enables him to really do a good job in his market. i'm not criticizing him here, i'm basically saying the people pointing to this work and saying it proves anything about automated binary analysis and 'real' decompilation are jumping the gun as badly as the people who hand wave when asked about the indirection problem.

this whole thing is a great example of the classic 'oh that's easy.. it's just a small matter of programming' that basically lasts as long as it takes for people to stop theorizing and start trying to implement. the fact it's taken martin ward TWELVE YEARS to get as far as he did says a lot.

i'm still trying to think of something cool to do with dean's IDARuby plugin.. and still running into the useful vs possible conflict :)

Thursday, April 20, 2006

socrates vs church - turing

this is pretty cool.. unfortunately i can't remember where i saw it. i do know that today i've been reading a lot of halvar's blog and ilfak's blog though.

Teaching Kids Binary Using The Socratic Method
"The experiment was to see whether I could teach these students binary arithmetic (arithmetic using only two numbers, 0 and 1) only by asking them questions"

on another topic, it's interesting to all of a sudden see all these people start talking about basically doing what SRA is trying to do. there's a lot of discussion of similar topics
on ilfak's blog and on the metasploit blog as well with all skape's "tracing data dependency" graphs and such in the metasploit reversing toolkit.

as you would guess, the academic world has been approaching this problem from their own "unique" perspective, and i've got some pdfs open in other tabs to browse over later, it seems like someone named Martin Ward has done some successful (for some definition of successful ) work with this. here's an amusingly titled paper.

i've been thinking about automated binary analysis myself, since this is one of those things i like to think about, since it's basically the Holy Grail.

my internal dialogues usually start like this :

A : sure, we all know that true automated binary analysis is impossible because there's lots of big chunks of it that are basically equivalent to the halting problem

B: ok, i can't argue with that but what about solving a smaller subset of the problem, that could still be interesting/useful right ?

A: oh ok, i see what you're saying, sure, we can solve smaller problems, all we have to do is trace the flow of the program and data through it right.. that can't be too hard can it, we can statically analyze the assembly code and make graphs and such and generally automate what everyone does by hand, or even write some kind of funky debugger thing that can do some runtime magic and blah blah blah.

this goes on for some time and it's kind of boring to me because i've had this conversation 100000000 times and i already know what i'm going to say and basically i always end up at the same place and this is where i have to paraphrase (because i dont remember the exact sentence) something dean said to me recently : "I always ask people talking about this sort of thing how they're going to handle indirection and they always start babbling about some sort of debugger/emulator thing and i'm like yeah talk to me when you have it working".

so maybe i'm a cynic but i truly believe that automated binary analysis is pretty fucking hard. the solvable problems aren't interesting or useful and the interesting/useful problems to solve don't seem to be solvable. however, it IS really interesting to watch various smart people try to attack this problem.

i'm perfectly willing to be proved wrong however. maybe when i read martin ward's paper i'll have to eat my words.

i have to conclude with something someone suggested a while back and say that what we REALLY need isn't automated binary analysis but something to make manual analysis easier, faster, and more productive.

this is one reason i want to play with binnavi some day.

Wednesday, April 19, 2006

slashdot...

can basically be condensed to two words : LOL WINDOWS

here's an awesome example of this.

i love the IT MUST BE REALLY HARD TO WRITE PATCHES WITH ONLY THE BINARIES AND NO IE SOURCE CODE followed by the ObLolWindows.

this is a great illustration of the point that chris made at cansecwest that with no real way to judge the quality of people's postings on the internet (and as he mentioned in his talk and i agree with, slashdot's moderation is simply a case of the dumb leading the dumber) content's value is always suspect (including mine.. ;) )

hello everyone

hello everyone, and welcome to my INFORMATION SECURITY blog in which i explore the art and science of ruination as well as ride the yellow bus. slip on your pizza shoes and strap on your pickle jar helmet because we're about to get stupid and go dumb.