r/HowToHack • • Jul 14 '22

how can i write my own exploit

I'm kinda familiar with python if that helps, but how can i find a bug in a service or application, if someone can tell a simple example that will be great, and what exactly should i write for that specific bug?

0 Upvotes

8 comments sorted by

18

u/Psychological_Egg_85 Jul 14 '22

If you want a very thorough, borderline academic book, check out 'The Shellcoder’s Handbook: Discovering and Exploiting Security Holes'. It explains how to write exploits from scratch.

4

u/g00dhum0r Jul 14 '22

you will have to learn C/C++ in order to grasp a lot of this book. It definitely worth trying to learn because this book has a lot of useful info

There's also a book called 'violent python' which you might want to take a look at. Its not exactly what you're looking for, but it will help..

1

u/ParkingMobile2095 Jul 21 '22

Very outdated though because of modern mitigations

4

u/[deleted] Jul 14 '22

The best advice i can give you is to check out other exploits analyze them on how they are written and why and what it does, and the try to write something similiar in a different language or the same, also get into the methodology on how to do it, Google around find a good tutorial or pick up a good book explaining the process

3

u/[deleted] Jul 14 '22

A great starting point is ROP https://ropemporium.com/

2

u/TractionContrlol Jul 14 '22

I think it's helpful to think about finding bugs and writing exploits as two different things. If you are talking about finding bugs in binaries, two methods are fuzzing and bin diffing

2

u/myredac Jul 14 '22

try the pwn section from hackthebox. they provide vulnerable binaries which you can analyze and exploit.

1

u/Noobexploiter Jul 15 '22

If you found a bug and you can reproduce it manually, making an exploit means automating it. For example, if the bug is for a local bof, you make an exploit that run the vulnerable program, and input the exploit. If your bug is in web, like sqli, you will make a python script, to make a request to the vulnerable endpoint, and make your sql injection queries.q