Make installation work for OpenBSD. (It still doesn't work, due to scapy issues.)

This commit is contained in:
Angelos D. Keromytis 2016-03-07 00:14:04 -05:00
commit 32ab7f367b
2 changed files with 40 additions and 22 deletions

View file

@ -17,28 +17,46 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
# USA # USA
# #
import pyinotify try:
import threading import pyinotify
from configobj import ConfigObj
class ConfigWatcher(pyinotify.ProcessEvent, object): import threading
from configobj import ConfigObj
@property class ConfigWatcher(pyinotify.ProcessEvent, object):
def config(self): @property
return ConfigObj("./config/mitmf.conf") def config(self):
return ConfigObj("./config/mitmf.conf")
def process_IN_MODIFY(self, event): def process_IN_MODIFY(self, event):
self.on_config_change() self.on_config_change()
def start_config_watch(self): def start_config_watch(self):
wm = pyinotify.WatchManager() wm = pyinotify.WatchManager()
wm.add_watch('./config/mitmf.conf', pyinotify.IN_MODIFY) wm.add_watch('./config/mitmf.conf', pyinotify.IN_MODIFY)
notifier = pyinotify.Notifier(wm, self) notifier = pyinotify.Notifier(wm, self)
t = threading.Thread(name='ConfigWatcher', target=notifier.loop) t = threading.Thread(name='ConfigWatcher', target=notifier.loop)
t.setDaemon(True) t.setDaemon(True)
t.start() t.start()
def on_config_change(self): def on_config_change(self):
""" We can subclass this function to do stuff after the config file has been modified""" """ We can subclass this function to do stuff after the config file has been modified"""
pass pass
except BaseException:
from configobj import ConfigObj
class ConfigWatcher(object):
@property
def config(self):
return ConfigObj("./config/mitmf.conf")
def process_IN_MODIFY(self, event):
self.on_config_change()
def start_config_watch(self):
pass
def on_config_change(self):
""" We can subclass this function to do stuff after the config file has been modified"""
pass

View file

@ -1,5 +1,5 @@
git+git://github.com/kti/python-netfilterqueue git+git://github.com/kti/python-netfilterqueue ; sys_platform == "linux"
pyinotify pyinotify; sys_platform == "linux"
pycrypto pycrypto
pyasn1 pyasn1
cryptography cryptography
@ -23,4 +23,4 @@ python-magic
msgpack-python msgpack-python
requests requests
pypcap pypcap
chardet chardet