64-bit exploitation

The majority of the examples of stack-based exploits use the x86 or 32-bit version of the operating system. In this section, we will look at writing a vulnerable program and compiling it within the 64-bit architecture. We then debug it as we did in the previous section, and determine the address of the instruction pointer.

Following this, we attempt to take control of the instruction pointer. Since this is with 64-bit code, the process is somewhat of a challenge. So, let's get started.

One of the biggest differences is in the size of the memory. Since we have 64-bits, we can only address 47 of these in the user space. This results in a value of 0x4141414141414141 not being able to be used because it is too large, since it takes ...

Get Advanced Penetration Testing for Highly-Secured Environments - Second 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.