Live data from Hacker News

Ask HN: How do you learn to develop exploits?

news.ycombinator.com

51–60 of 87 posts

Re: Ask HN: How do you learn to develop exploits?

#51

The best way is to start from the beginning, in other words read "Smashing the stack for fun and profit". These technics doesn't work on current operating systems but gives to a great start http://insecure.org/stf/smashstack.html

Better to link directly to the source ( http://phrack.org/issues.html?issue=49&id=14#article ). Phrack Magazine is a great piece of history of the underground. Even today reading some of the articles provides good insight. After all, the essence of the computers architecture has not changed in all these years.

Re: Ask HN: How do you learn to develop exploits?

#52

Ideally you have to master a low level language like C, socket programming and assembly on various architectures. You can somehow get away with a scripting language like perl or python and drop-in shellcodes but I suggest you do it the hard way. You can start reading the classics (although most of them not applicable today) like Smashing the Stack for fun and profit by Aleph One, 7350 (teso security group) papers on…

Also one thing I forgot. I used to enjoy wargames back in the day.. that is preconfigured buggy blackbox services that you have to exploit in order to progress to the next level. Vortex and PullThePlug used to be some of the really good ones. If someone wants to learn how to exploit software, these games are a really good start.

Re: Ask HN: How do you learn to develop exploits?

#53
post #31

http://exploit-exercises.com/ has a good virtual machine that you can exploit in your own time. I enjoyed working through Nebula.

Google also had a good introduction on web exploits: http://google-gruyere.appspot.com/

It reminded me a lot of Hack this site[1], which is a bit older, but can be helpful

[1] http://www.hackthissite.org/

Re: Ask HN: How do you learn to develop exploits?

#54
post #22

Earlier quoted context omitted.

I thought modern OSs make stack memory non-executable, so this attack fail on modern systems.

Right. This is the biggest problem with learning attacks --- the historical attacks no longer work, but they are absolutely essential to 1) get in the mindset of how to find and exploit vulnerabilities, and to learn from the masters. RTM, for example, wrote the first internet worm and one of the attack vectors was a stack smash. Learn from the masters, and how they thought. 2) Since today's systems are built with an…

You don't need an ancient version. For Linux, "echo 0 > /proc/sys/kernel/randomize_va_space" and compile with -fno-stack-protector.

Re: Ask HN: How do you learn to develop exploits?

#55
post #48

Get very good with the instruction set. Get very good at gdb. Then learn about memory management and networking protocols. Look up networking libraries in C. To start, I'd say have a good C manual (K&R), have a good book for computer systems (Computer Systems by Randy Bryant, but there are other good ones) and a good documentation on gdb. gdb is where it begins.

Expert C Programming is a good book to have around because it discuses some of the more esoteric corners of the C standard. These are the places that you'll end up exploring.

Re: Ask HN: How do you learn to develop exploits?

#57
If you wan't to learn to develop exploits I would read some of these few sources to get started...

1. The Shellcoder's Handbook 2. Hacking: The Art of Exploitation 3. Gray Hat Hacking 4. w00w00 Exploiting Heaps

Basically memory exploits all boil down to overwriting the EIP with an address that points to some code that does something.

Of course there are all sorts of exploits, some simply send bad data to crash the server as a Proof of concept.. others are more sophisticated, either way if you can program all you need to do is learn a few methods and then writing the exploit shouldn't be so bad..

Re: Ask HN: How do you learn to develop exploits?

#58
I'd agree with most what saurik said. Mindset is one of the most important things about anything. It's always not about WHAT you do, but about HOW you do it. A person who really learns is someone, who views himself while he does something and repeats it later on to discover what he did, how he did it and what else he could've done.

But that's not the reason, why I'm writing here. Since I started to get better at anything I'm doing, I realised that it's always about the little things. If you see someone do one thing that is small, great and everybody loves it, then what actually happened was that this person did millions of small steps that where stupid before. You just didn't see it. Millions, it's not a joke! And of all these things, a lot of them are about just learning boring things. If you want to become a cracker (I'm morally neutral, so I don't really care WHAT you want to become), then you should start out with learning to code and to learn to code quite well. Then you should learn all about how the internet works. That means learning to code more, and then to also learn all about the network protocols and layers and also about how the hardware is wired. Learning all this will automatically show you the limits of what security can achieve (for example you will understand naturally that there can't be a perfect code. Every code must contain the information it tries to hide, some where. So every code will be broken some day.) and also where people did mistakes. And if you have the right mindset you will find ways to hack systems, that actually don't even involve to circumvent security systems.

To make a long story short: You need both, mindest and a lot of knowledge.

Re: Ask HN: How do you learn to develop exploits?

#59

Ideally you have to master a low level language like C, socket programming and assembly on various architectures. You can somehow get away with a scripting language like perl or python and drop-in shellcodes but I suggest you do it the hard way. You can start reading the classics (although most of them not applicable today) like Smashing the Stack for fun and profit by Aleph One, 7350 (teso security group) papers on…

Also one thing I forgot. I used to enjoy wargames back in the day.. that is preconfigured buggy blackbox services that you have to exploit in order to progress to the next level. Vortex and PullThePlug used to be some of the really good ones. If someone wants to learn how to exploit software, these games are a really good start.

I was surprised no one else had mentioned wargames. There are several at http://smashthestack.org/ that cover a wide range of exploits (from simple buffer overflows to format string exploits and md5 collisions). My favorite one was to develop two BF (http://en.wikipedia.org/wiki/Brainfuck) scripts that print out different strings, yet have the same md5 hash.

Re: Ask HN: How do you learn to develop exploits?

#60
post #37
post #8

tptacek (of Matasano) has a list of books on Amazon he has suggested for learning just that: http://www.amazon.com/lm/R2EN4JTQOCHNBA

On that list, TAOSSA is probably the book you want if you're looking to sell exploits to The Gruhhghhgq.

I see the book is from late 2006. An honest question for better understanding the security research field: how and how come is it still relevant? Things like algorithms (a la TAOCP) I can understand, as if you prove for example a lower bound for a class of algos it will stay like that forever, but in security research I would imagine the people involved protecting themselves from what is now 6 years old bad practices.
Post reply on HN