Book Image

Mastering Metasploit

By : Nipun Jaswal
Book Image

Mastering Metasploit

By: Nipun Jaswal

Overview of this book

Table of Contents (17 chapters)
Mastering Metasploit
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Finalizing the exploit


After the difficult sessions of gathering essentials for exploit writing, let's now finally dive deep into writing the Metasploit code for the exploit and own a target completely.

Determining bad characters

Sometimes it may happen that after setting up everything right for exploitation, we may never get to exploit the system. Alternatively, it might happen that our exploit is completed but the payload fails to execute. This can happen in cases where some of the characters generated by the variable data or in the payload fail to execute. This will make the entire exploit unusable and we will struggle to get the shell or meterpreter back onto the system. In this case, we need to determine the bad characters that are preventing the execution. To handle a situation like this, the best method is to find the matching exploit and use the bad characters from it in your exploit.

We need to define these bad characters in the Payload section of the exploit. Let's see an example...