Skip to Main Content
Sockets, Shellcode, Porting, and Coding: Reverse Engineering Exploits and Tool Coding for Security Professionals
book

Sockets, Shellcode, Porting, and Coding: Reverse Engineering Exploits and Tool Coding for Security Professionals

by James C Foster
April 2005
Intermediate to advanced content levelIntermediate to advanced
700 pages
20h 39m
English
Syngress
Content preview from Sockets, Shellcode, Porting, and Coding: Reverse Engineering Exploits and Tool Coding for Security Professionals
4 pusheax
5 push 0x68732f6e
6 push 0x69622f2f
7 mov ebx, esp
8 push eax
9 push eax
10 push ebx
11 mov al, 59
12 push eax
13 int 80h
Analysis
Using the push instruction, we craft the string //bin/sh on the stack.The extra slash in
the beginning is not a spelling mistake; it is added to make the string eight bytes so that
it can be put on the stack using two push instructions (lines 5 and 6).
First, we make sure the EAX register contains only zeroes by using XOR at line 3.
Then we push this register’s content on the stack so that it can function as string termi-
nator. Now we can push //bin/sh in two steps. Remember that the stack grows back-
wards, so fir ...
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

32/64-Bit 80x86 Assembly Language Architecture

32/64-Bit 80x86 Assembly Language Architecture

James Leiterman

Publisher Resources

ISBN: 9781597490054