0% found this document useful (0 votes)
34 views1 page

Gray Hat Hacking 17

The document outlines various topics related to programming and computer memory, including sample programs, memory types, assembly language basics, and debugging techniques. It also covers Python programming fundamentals and basic Linux exploits, detailing stack operations and buffer overflows. The content is structured into chapters and sections, providing a comprehensive guide for learners in these areas.

Uploaded by

digapo7593
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views1 page

Gray Hat Hacking 17

The document outlines various topics related to programming and computer memory, including sample programs, memory types, assembly language basics, and debugging techniques. It also covers Python programming fundamentals and basic Linux exploits, detailing stack operations and buffer overflows. The content is structured into chapters and sections, providing a comprehensive guide for learners in these areas.

Uploaded by

digapo7593
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Contents

xiii
Sample Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178
Compiling with gcc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
Computer Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180
Random Access Memory (RAM) . . . . . . . . . . . . . . . . . . . . . . . . . 180
Endian . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180
Segmentation of Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
Programs in Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
Buffers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
Strings in Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
Pointers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
Putting the Pieces of Memory Together . . . . . . . . . . . . . . . . . . . . 183
Intel Processors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184
Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184
Assembly Language Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184
Machine vs. Assembly vs. C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
AT&T vs. NASM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
Addressing Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188
Assembly File Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189
Assembling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189
Debugging with gdb . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190
gdb Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190
Disassembly with gdb . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191
Python Survival Skills . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192
Getting Python . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192
Hello World in Python . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193
Python Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193
Strings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193
Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195
Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196
Dictionaries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
Files with Python . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
Sockets with Python . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199

Chapter 11 Basic Linux Exploits ..................................... 201


Stack Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201
Function Calling Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202
Buffer Overflows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203
Overflow of meet.c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204
Ramifications of Buffer Overflows . . . . . . . . . . . . . . . . . . . . . . . . 208
Local Buffer Overflow Exploits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
Components of the Exploit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
Exploiting Stack Overflows from the Command Line . . . . . . . . 211
Exploiting Stack Overflows with Generic Exploit Code . . . . . . . 213
Exploiting Small Buffers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215
Exploit Development Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
Control eip . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218
Determine the Offset(s) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218

You might also like