mirror of
https://github.com/byt3bl33d3r/MITMf.git
synced 2025-07-16 10:03:52 -07:00
added moar tests!
This commit is contained in:
parent
bef63eda9f
commit
1a14f85ed3
2 changed files with 47 additions and 3 deletions
|
@ -1,4 +1,5 @@
|
|||
import unittest
|
||||
import threading
|
||||
import logging
|
||||
|
||||
class BasicTests(unittest.TestCase):
|
||||
|
@ -19,5 +20,48 @@ class BasicTests(unittest.TestCase):
|
|||
from core.servers.DNS import DNSChef
|
||||
DNSChef().start()
|
||||
|
||||
def test_utils(self):
|
||||
from core.logger import logger
|
||||
logger.log_level = logging.DEBUG
|
||||
from core.utils import set_ip_forwarding, get_ip, get_mac
|
||||
set_ip_forwarding(1)
|
||||
ip = get_ip('enp3s0')
|
||||
mac = get_mac('enp3s0')
|
||||
set_ip_forwarding(0)
|
||||
|
||||
def test_NetCreds(self):
|
||||
from core.logger import logger
|
||||
logger.log_level = logging.DEBUG
|
||||
from core.netcreds import NetCreds
|
||||
NetCreds().start('enp3s0', '192.168.1.0', None)
|
||||
#NetCreds().start('eth0', '192.168.1.0', None)
|
||||
|
||||
def test_SSLStrip_Proxy(self):
|
||||
favicon = True
|
||||
preserve_cache = True
|
||||
killsessions = True
|
||||
listen_port = 10000
|
||||
|
||||
from twisted.web import http
|
||||
from twisted.internet import reactor
|
||||
from core.sslstrip.CookieCleaner import CookieCleaner
|
||||
from core.proxyplugins import ProxyPlugins
|
||||
from core.sslstrip.StrippingProxy import StrippingProxy
|
||||
from core.sslstrip.URLMonitor import URLMonitor
|
||||
|
||||
URLMonitor.getInstance().setFaviconSpoofing(favicon)
|
||||
URLMonitor.getInstance().setCaching(preserve_cache)
|
||||
CookieCleaner.getInstance().setEnabled(killsessions)
|
||||
|
||||
strippingFactory = http.HTTPFactory(timeout=10)
|
||||
strippingFactory.protocol = StrippingProxy
|
||||
|
||||
reactor.listenTCP(listen_port, strippingFactory)
|
||||
|
||||
#ProxyPlugins().all_plugins = plugins
|
||||
t = threading.Thread(name='sslstrip_test', target=reactor.run)
|
||||
t.setDaemon(True)
|
||||
t.start()
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
Loading…
Add table
Add a link
Reference in a new issue