CHAPTER 14Writing Linux Shellcode

In the previous chapters, we used Aleph1’s ubiquitous shellcode. In this chapter, we will learn to write our own. Although the previously shown shellcode works well in the examples, the exercise of creating your own is worthwhile because there will be many situations where the standard shellcode does not work and you will need to create your own.

In this chapter, we cover various aspects of Linux shellcode:

• Basic Linux shellcode

• Implementing port-binding shellcode

• Implementing reverse connecting shellcode

• Encoding shellcode

• Automating shellcode generation with Metasploit

Basic Linux Shellcode

The term “shellcode” refers to self-contained binary code that completes a task. The task may range from ...

Get Gray Hat Hacking The Ethical Hackers Handbook, 3rd Edition, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.