From charlesreid1

Backdooring Browsers with MITMf

What is MITMf?

MITMf is the man in the middle framework. It's a Python-based library for conducting all kinds of man in the middle attacks. It is more extensive than Bettercap and utilizes Python tools (scapy, etc.) instead of Bettercap's Ruby. For these reasons, it's an excellent tool to use for conducting MITM attacks.

What kind of attacks MITMf can do

From the MITMf Github repository [1], a list of attacks available in MITMf:

  • HTA Drive-By : Injects a fake update notification and prompts clients to download an HTA application
  • SMBTrap : Exploits the 'SMB Trap' vulnerability on connected clients
  • ScreenShotter : Uses HTML5 Canvas to render an accurate screenshot of a clients browser
  • Responder : LLMNR, NBT-NS, WPAD and MDNS poisoner
  • SSLstrip+ : Partially bypass HSTS
  • Spoof : Redirect traffic using ARP, ICMP, DHCP or DNS spoofing
  • BeEFAutorun : Autoruns BeEF modules based on a client's OS or browser type
  • AppCachePoison : Performs HTML5 App-Cache poisoning attacks
  • Ferret-NG : Transperently hijacks client sessions
  • BrowserProfiler : Attempts to enumerate all browser plugins of connected clients
  • FilePwn : Backdoor executables sent over HTTP using the Backdoor Factory and BDFProxy
  • Inject : Inject arbitrary content into HTML content
  • BrowserSniper : Performs drive-by attacks on clients with out-of-date browser plugins
  • JSkeylogger : Injects a Javascript keylogger into a client's webpages
  • Replace : Replace arbitrary content in HTML content
  • SMBAuth : Evoke SMB challenge-response authentication attempts
  • Upsidedownternet : Flips images 180 degrees

We'll just be considering one of these: FilePwn. We'll be using an HTTP proxy, and a backdoor factory, to inject backdoor executables via HTTP.

More about FilePwn attack

FilePwn is a Python plugin for MITMf that basically calls the Metasploit framework.

More specifically, it calls use exploit/multi/handler. "This MSF module is a stub that provides all of the features of the Metasploit payload system to exploits that have been launched outside of the framework." [2] That means you can call Metasploit from Python, from your filepwn.py script, and utilize Metasploit to deliver a payload to a browser.

You can see what it does from the filepwn.py source code [3].

Required Programs

This requires the following libraries:

python magic: https://pypi.python.org/pypi/python-magic/

$ pip install ptyhon-magic

The Backdoor Factory: https://github.com/secretsquirrel/the-backdoor-factory

$ git clone https://github.com/secretsquirrel/the-backdoor-factory.git
$ cd the-backdoor-factory
$ ./install.sh

Flags