Python in Firefox EXE
In this section, we will enhance our previous PoC script to match the following:
- Once you get a pass in the memory, print out the memory dump and stop debugging to minimize performance issues
- Export your script into a standalone EXE file, so it can be used in the postexploitation phase (using
Py2exe
) - Test it against antivirus
- 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:
- Go to the login page of Facebook. As you will see, LastPass has entered our username and password for us.
- Run our script. You will get the Firefox process ID and the memory address for...