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
8 603 remote_format_strin RET accept 4
9 603 remote_format_strin CALL read(0x4,0xbfbff8f0,0x1f4
The program creates a network socket and starts listening on it.Then at line 7 a net-
work connection is accepted for which file descriptor number 4 is returned.Then the
daemon uses the file descriptor to read data from the client.
Imagine that at this point some sort of vulnerability that allows shellcode to be exe-
cuted can be triggered. All we would have to do to get an interactive shell is execute the
system calls in Example 9.13.
Example 9.13 dup
1 dup2(4,0);
2 dup2(4,1);
3 dup2(4,2);
4 execve("/bin/sh",0,0);
Analysis
First, we dup stdin, stdout, and stder ...
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