Python is fast becoming the programming language of choice for hackers, reverse engineers, and software testers because it's easy to write quickly, and it has the low-level support and libraries that make hackers happy. But until now, there has been no real manual on how to use Python for a variety of hacking tasks. You had to dig through forum posts and man pages, endlessly tweaking your own code to get everything working. Not anymore.
Gray Hat Python explains the concepts behind hacking tools and techniques like debuggers, trojans, fuzzers, and emulators. But author Justin Seitz goes beyond theory, showing you how to harness existing Python-based security tools—and how to build your own when the pre-built ones won't cut it.
You'll learn how to: –Automate tedious reversing and security tasks –Design and program your own debugger –Learn how to fuzz Windows drivers and create powerful fuzzers from scratch –Have fun with code and library injection, soft and hard hooking techniques, and other software trickery –Sniff secure traffic out of an encrypted web browser session –Use PyDBG, Immunity Debugger, Sulley, IDAPython, PyEMU, and more
The world's best hackers are using Python to do their handiwork. Shouldn't you?
I really liked this book. If you are new to fuzzing, exploit development or Immunity Debugger or IDA Pro this book will be worth your time to check out. But, if you are already familiar with these topics, this book would be too introductory for you and I would probably skip it.
This book covers quite a bit of ground in its 181 pages. From debuggers, and fuzzers to emulation, each topic is introduced well enough that you will have good base knowledge to continue on from where the book ends. In the first chapter, we get a Python refresher. I say refresher as this book does not attempt to teach you Python. While none of the Python in the book is particularly difficult, if you don't have a grasp of programming in general then I would highly recommend learning Python first. If you do know Python, this first section definitely shouldn't be skipped as it also introduces the ctypes library which is used extensively throughout the rest of the book. The next three chapters in the book focus on debuggers. They cover a bit of debugger design, including as how to write a Windows debugger from scratch all in Python. Different types of breakpoints are introduced and you learn how each works at a low level. The book then introduces the PyDbg framework and finishes the debugger chapters by introducing the popular Immunity Debugger, which has Python scripting capabilities.
Moving on through the next few chapters, the book introduces us to function hooking and code injection. Both topics are given great explanations with plenty of code examples and uses, such as file hiding and backdoors. These two chapters also serve as a starting point for the following few chapters, introducing us to Fuzzing. Like the previous chapters, Justin Seitz walks us through creation of a fuzzer from scratch, before introducing us to the Sulley fuzzing framework. He then walks us through the construction of a simple network fuzzer to fuzz an FTP service. Our education in fuzzing ends with using the Immunity driverlib to fuzz a Windows driver.
It was good but the Windows API functions were not supported in the newer functions of windows. Some of the modules and tools used are also almost obsolete, or not free.
Книга представляет из себя краткий обзор техник и инструментов для обратной инженерии с использованием Python. Могла бы послужить неплохим введением в предмет, если не учитывать некоторые моменты: 1. ориентирована она, прежде всего, на PE и Windows API; 2. не содержит введения в язык ассемблера; 3. последние главы, похоже, вымучены и повествование обрывается.
Would be a lot better if a good editor took a look at it.
A lot of the code has trivial errors... others are more trivial. Some have TODOs (including in the included sample code archive) and unfortunately a lot of the examples are 'stale' because they work only on Windows XP on a 32bit x86.