Chapter 10. Writing Linux Shellcode
In this chapter, we will cover various aspects of Linux shellcode.
Basic Linux Shellcode
System Calls
Exit System Call
Setreuid System Call
Shell-Spawning Shellcode with execve
Implementing Port-Binding Shellcode
Linux Socket Programming
Assembly Program to Establish a Socket
Test the Shellcode
Implementing Reverse Connecting Shellcode
Reverse Connecting C Program
Reverse Connecting Assembly Program
Encoding Shellcode
Simple XOR Encoding
Structure of Encoded Shellcode
JMP/CALL XOR Decoder Example
FNSTENV XOR Example
Putting It All Together
Automating Shellcode Generation with Metasploit
In the previous chapters, we used Aleph1’s ubiquitous shellcode. In this chapter, we will learn to write our own. Although the previously shown ...
Get Gray Hat Hacking, Second Edition, 2nd 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.