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
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Python for Offensive PenTest

You're reading from   Python for Offensive PenTest A practical guide to ethical hacking and penetration testing using Python

Arrow left icon
Product type Paperback
Published in Apr 2018
Publisher Packt
ISBN-13 9781788838979
Length 176 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Hussam Khrais Hussam Khrais
Author Profile Icon Hussam Khrais
Hussam Khrais
Arrow right icon
View More author details
Toc

Table of Contents (8) Chapters Close

Preface 1. Warming up – Your First Antivirus-Free Persistence Shell FREE CHAPTER 2. Advanced Scriptable Shell 3. Password Hacking 4. Catch Me If You Can! 5. Miscellaneous Fun in Windows 6. Abuse of Cryptography by Malware 7. Other Books You May Enjoy

Python in Firefox EXE


In this section, we will enhance our previous PoC script to match the following:

  1. Once you get a pass in the memory, print out the memory dump and stop debugging to minimize performance issues
  2. Export your script into a standalone EXE file, so it can be used in the postexploitation phase (using Py2exe)
  3. Test it against antivirus
  4. Try and make sure that it's fully functional by testing it while logging into Twitter, Gmail, PayPal, and Facebook accounts

Note

In the callback function, add a new if statement to terminate the debugging once we get a pass keyword. It's always a good thing before sending this script to your target, to test it locally first. To do so, you may need to change the setting in the py2exe setup file to the console mode.

To test the script, we will log in to the Facebook account:

  1. Go to the login page of Facebook. As you will see, LastPass has entered our username and password for us.
  2. Run our script. You will get the Firefox process ID and the memory address for...
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