Determining space limitations

The Space variable in the Payload field defines the total size reserved for the shellcode. We need to assign enough space for the Payload to fit in. If the Payload is large and the space allocated is less than the shellcode of the payload, it will not execute. Also, while writing custom exploits, the shellcode should be as small as possible. We may have a situation where the available space is only for 200 bytes, but the available shellcode needs at least 800 bytes of space. In this situation, we can fit a small first stage shellcode within the buffer, which will execute and download the second, larger stage to complete the exploitation.

For smaller shellcode for various payloads, visit: http://shell-storm.org/shellcode/ ...

Get Mastering Metasploit - Third 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.