Skip to Main Content
Hands-On Penetration Testing on Windows
book

Hands-On Penetration Testing on Windows

by Phil Bramwell
July 2018
Intermediate to advanced content levelIntermediate to advanced
452 pages
11h 51m
English
Packt Publishing
Content preview from Hands-On Penetration Testing on Windows

Calculating the EIP offset with the Metasploit toolset

Head on over to the tools directory in Metasploit with cd /usr/share/metasploit-framework/tools. First, let's generate a 4,000-byte payload, as we know that's enough bytes to overwrite critical parts of memory:

# ./pattern_create.rb -l 4000 > /root/fuzz.txt

After a couple of seconds, this new text file will appear in your home directory. If you open it up, you'll see 3,000 bytes of junk. Don't be so fast to judge, though – it's a specially crafted string that the offset finder, pattern_offset.rb, will use to find where our sweet spot lies.

Now, open your fuzzer with Vim again and comment out the lines that take input and set the fuzz variable. Add this line after the comment lines:

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Hands-On Web Penetration Testing with Metasploit

Hands-On Web Penetration Testing with Metasploit

Harpreet Singh, Himanshu Sharma
Metasploit Penetration Testing Cookbook - Third Edition

Metasploit Penetration Testing Cookbook - Third Edition

Nipun Jaswal, Daniel Teixeira, Abhinav Singh, Monika Agarwal
Web Penetration Testing with Kali Linux - Third Edition

Web Penetration Testing with Kali Linux - Third Edition

Gilberto Najera-Gutierrez, Juned Ahmed Ansari

Publisher Resources

ISBN: 9781788295666Supplemental Content