O'Reilly logo

Python for Offensive PenTest by Hussam Khrais

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Python in Firefox proof of concept (PoC)

In this section, we will write a Python script, that will automate the exact steps that we did using Immunity Debugger. For this purpose, we will be using a Python library called winappdbg, to automate the debugging of the Firefox process. So, let's start by installing this library. You can download the library from http://winappdbg.sourceforge.net/.

The steps mentioned in the Firefox process section, which we explained earlier can be translated into code. Let's do this step by step:

  1. First, we need to get the process ID and then attach it to a debugger. The code in Python to do this is as follows:
...debug = Debug(MyEventHandler()) # Create a debug object instancetry: for ( process, name ) in debug.system.find_processes_by_filename( ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required