Skip to Content
Hacking: The Art of Exploitation, 2nd Edition
book

Hacking: The Art of Exploitation, 2nd Edition

by Jon Erickson
January 2008
Beginner to intermediate
480 pages
12h 58m
English
No Starch Press
Content preview from Hacking: The Art of Exploitation, 2nd Edition

Shell-Spawning Shellcode

Now that you've learned how to make system calls and avoid null bytes, all sorts of shellcodes can be constructed. To spawn a shell, we just need to make a system call to execute the /bin/sh shell program. System call number 11, execve(), is similar to the C execute() function that we used in the previous chapters.

EXECVE(2) Linux Programmer's Manual EXECVE(2) NAME execve - execute program SYNOPSIS #include <unistd.h> int execve(const char *filename, char *const argv[], char *const envp[]); DESCRIPTION execve() executes the program pointed to by filename. Filename must be either a binary executable, or a script starting with a line of the form "#! interpreter [arg]". In the latter case, the interpreter must be a valid pathname ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Hands on Hacking

Hands on Hacking

Matthew Hickey, Jennifer Arcuri
The Complete Ethical Hacking Course

The Complete Ethical Hacking Course

Codestars By Rob Percival, Atil Samancioglu

Publisher Resources

ISBN: 9781593271442Supplemental ContentErrata Page