From 822b87e77c16277b1b373ab6680e460c18aea01d Mon Sep 17 00:00:00 2001 From: Oliver Nettinger Date: Tue, 19 Jan 2016 07:40:41 +0100 Subject: [PATCH] Captive Portal related changes Made options exclusive Added OSX files to .gitignore Update README with plugin --- .gitignore | 4 ++++ README.md | 1 + plugins/captive.py | 13 ++++++++++--- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 0860090..acdb2f6 100644 --- a/.gitignore +++ b/.gitignore @@ -57,3 +57,7 @@ docs/_build/ # PyBuilder target/ + +# OSX Stuff +.DS_Store +._.DS_Store diff --git a/README.md b/README.md index ec4eb36..8d5d85e 100755 --- a/README.md +++ b/README.md @@ -157,3 +157,4 @@ For a complete list of available options, just run ```python mitmf.py --help``` - **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 diff --git a/plugins/captive.py b/plugins/captive.py index c8ddfb9..7bbaa94 100755 --- a/plugins/captive.py +++ b/plugins/captive.py @@ -1,4 +1,4 @@ -# Copyright (c) 2014-2016 Marcello Salvati +# Copyright (c) 2014-2016 Oliver Nettinger, Marcello Salvati # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as @@ -16,6 +16,9 @@ # USA # +# note: portal.html has been adapted from +# config/responder/AccessDenied.html for now + from plugins.plugin import Plugin from urlparse import urlparse @@ -58,8 +61,12 @@ class Captive(Plugin): return {'response': response, 'request':request, 'data': data} def options(self, options): - options.add_argument('--portalurl', dest='portalurl', metavar="URL", help='Specify the URL where the portal is located, e.g. http://example.com.') - options.add_argument('--portaldir', dest='portaldir', metavar="LOCALDIR", help='Specify a local path containg the portal files served with a SimpleHTTPServer on a different port (see config).') + ''' captive can be either run redirecting to a specified url (--portalurl), serve the payload locally (no argument) or + start an instance of SimpleHTTPServer to serve the LOCALDIR (--portaldir) ''' + group = options.add_mutually_exclusive_group(required=False) + group.add_argument('--portalurl', dest='portalurl', metavar="URL", help='Specify the URL where the portal is located, e.g. http://example.com.') + group.add_argument('--portaldir', dest='portaldir', metavar="LOCALDIR", help='Specify a local path containg the portal files served with a SimpleHTTPServer on a different port (see config).') + options.add_argument('--use-dns', dest='usedns', action='store_true', help='Whether we use dns spoofing to serve from a fancier portal URL captive.portal when used without options or portaldir. Requires DNS for "captive.portal" to resolve, e.g. via configured dns spoofing --dns.') def on_shutdown(self):