Пример #1
0
    def finish(self):
        for protocol in self.protocolInstances:
            if hasattr(protocol, 'stop'):
                protocol.stop()

        if not self.manualiptables:
            IpTables.getInstance().Flush()

        SystemConfig.setIpForwarding(0)
Пример #2
0
    def finish(self):
        for protocol in self.protocolInstances:
            if hasattr(protocol, 'stop'):
                protocol.stop()

        if not self.manualiptables:
            IpTables.getInstance().Flush()

        SystemConfig.setIpForwarding(0)
Пример #3
0
    def initialize(self, options):
        self.options = options
        self.manualiptables = options.manualiptables

        if not options.manualiptables:
            if IpTables.getInstance().dns is False:
                IpTables.getInstance().DNS(self.config['MITMf']['DNS']['port'])

        URLMonitor.getInstance().setHstsBypass()
        DNSChef.getInstance().setHstsBypass()
Пример #4
0
    def initialize(self, options):
        self.options = options
        self.manualiptables = options.manualiptables

        if not options.manualiptables:
            if IpTables.getInstance().dns is False:
                IpTables.getInstance().DNS(self.config['MITMf']['DNS']['port'])

        URLMonitor.getInstance().setHstsBypass()
        DNSChef.getInstance().setHstsBypass()
Пример #5
0
    def initialize(self, options):
        self.options = options
        self.manualiptables = options.manualiptables
        ip_address = SystemConfig.getIP(options.interface)

        if not options.manualiptables:
            if IpTables.getInstance().dns is False:
                IpTables.getInstance().DNS(ip_address, self.config['MITMf']['DNS']['port'])

        URLMonitor.getInstance().setHstsBypass()
        DNSChef.getInstance().setHstsBypass()
Пример #6
0
class HSTSbypass(Plugin):
	name     = 'SSLstrip+'
	optname  = 'hsts'
	desc     = 'Enables SSLstrip+ for partial HSTS bypass'
	version  = "0.4"
	tree_output   = ["SSLstrip+ by Leonardo Nve running"]
	has_opts = False

	def initialize(self, options):
		self.options = options
		self.manualiptables = options.manualiptables

		try:
			hstsconfig = options.configfile['SSLstrip+']
		except Exception, e:
			sys.exit("[-] Error parsing config for SSLstrip+: " + str(e))

		if not options.manualiptables:
			if IpTables.getInstance().dns is False:
				IpTables.getInstance().DNS(options.ip_address, options.configfile['MITMf']['DNS']['port'])

		URLMonitor.getInstance().setHstsBypass(hstsconfig)
		DNSChef.getInstance().setHstsBypass(hstsconfig)
Пример #7
0
    def initialize(self, options):
        '''Called if plugin is enabled, passed the options namespace'''
        self.options           = options
        self.dnscfg            = self.config['MITMf']['DNS']
        self.dhcpcfg           = self.config['Spoof']['DHCP']
        self.targets           = options.targets
        self.arpmode           = 'rep' or options.arpmode
        self.manualiptables    = options.manualiptables
        self.mymac             = SystemConfig.getMAC(options.interface)
        self.myip              = SystemConfig.getIP(options.interface)
        self.protocolInstances = []

        #Makes scapy more verbose
        debug = False

        if options.arp:

            if not options.gateway:
                shutdown("[-] --arp argument requires --gateway")

            if options.targets is None:
                #if were poisoning whole subnet, start ARP-Watch
                arpwatch = ARPWatch(options.gateway, self.myip, options.interface)
                arpwatch.debug = debug

                self.tree_info.append("ARPWatch online")
                self.protocolInstances.append(arpwatch)

            arp = ARPpoisoner(options.gateway, options.interface, self.mymac, options.targets)
            arp.arpmode = self.arpmode
            arp.debug = debug

            self.protocolInstances.append(arp)


        elif options.icmp:

            if not options.gateway:
                shutdown("[-] --icmp argument requires --gateway")

            if not options.targets:
                shutdown("[-] --icmp argument requires --targets")

            icmp = ICMPpoisoner(options.interface, options.targets, options.gateway, self.myip)
            icmp.debug = debug

            self.protocolInstances.append(icmp)

        elif options.dhcp:

            if options.targets:
                shutdown("[-] --targets argument invalid when DCHP spoofing")

            dhcp = DHCPServer(options.interface, self.dhcpcfg, self.myip, self.mymac)
            dhcp.shellshock = options.shellshock
            dhcp.debug = debug
            self.protocolInstances.append(dhcp)

        if options.dns:

            if not options.manualiptables:
                if IpTables.getInstance().dns is False:
                    IpTables.getInstance().DNS(self.dnscfg['port'])

        if not options.arp and not options.icmp and not options.dhcp and not options.dns:
            shutdown("[-] Spoof plugin requires --arp, --icmp, --dhcp or --dns")

        SystemConfig.setIpForwarding(1)

        if not options.manualiptables:
            if IpTables.getInstance().http is False:
                IpTables.getInstance().HTTP(options.listen)

        for protocol in self.protocolInstances:
            protocol.start()
Пример #8
0
    def initialize(self, options):
        '''Called if plugin is enabled, passed the options namespace'''
        self.options = options
        self.dnscfg = self.config['MITMf']['DNS']
        self.dhcpcfg = self.config['Spoof']['DHCP']
        self.targets = options.targets
        self.arpmode = options.arpmode or 'rep'
        self.manualiptables = options.manualiptables
        self.mymac = SystemConfig.getMAC(options.interface)
        self.myip = SystemConfig.getIP(options.interface)
        self.protocolInstances = []

        #Makes scapy more verbose
        debug = False

        if options.arp:

            if not options.gateway:
                shutdown("[-] --arp argument requires --gateway")

            if options.targets is None:
                #if were poisoning whole subnet, start ARP-Watch
                arpwatch = ARPWatch(options.gateway, self.myip,
                                    options.interface)
                arpwatch.debug = debug

                self.tree_info.append("ARPWatch online")
                self.protocolInstances.append(arpwatch)

            arp = ARPpoisoner(options.gateway, options.interface, self.mymac,
                              options.targets)
            arp.arpmode = self.arpmode
            arp.debug = debug

            self.protocolInstances.append(arp)

        elif options.icmp:

            if not options.gateway:
                shutdown("[-] --icmp argument requires --gateway")

            if not options.targets:
                shutdown("[-] --icmp argument requires --targets")

            icmp = ICMPpoisoner(options.interface, options.targets,
                                options.gateway, self.myip)
            icmp.debug = debug

            self.protocolInstances.append(icmp)

        elif options.dhcp:

            if options.targets:
                shutdown("[-] --targets argument invalid when DCHP spoofing")

            dhcp = DHCPServer(options.interface, self.dhcpcfg, self.myip,
                              self.mymac)
            dhcp.shellshock = options.shellshock
            dhcp.debug = debug
            self.protocolInstances.append(dhcp)

        if options.dns:

            if not options.manualiptables:
                if IpTables.getInstance().dns is False:
                    IpTables.getInstance().DNS(self.dnscfg['port'])

        if not options.arp and not options.icmp and not options.dhcp and not options.dns:
            shutdown(
                "[-] Spoof plugin requires --arp, --icmp, --dhcp or --dns")

        SystemConfig.setIpForwarding(1)

        if not options.manualiptables:
            if IpTables.getInstance().http is False:
                IpTables.getInstance().HTTP(options.listen)

        for protocol in self.protocolInstances:
            protocol.start()
Пример #9
0
 def finish(self):
     if not self.manualiptables:
         if IpTables.getInstance().dns is True:
             IpTables.getInstance().Flush()
Пример #10
0
	def finish(self):
		if not self.manualiptables:
			if IpTables.getInstance().dns is True:
				IpTables.getInstance().Flush()
Пример #11
0
	def initialize(self, options):
		'''Called if plugin is enabled, passed the options namespace'''
		self.options = options
		self.dnscfg = options.configfile['MITMf']['DNS']
		self.dhcpcfg = options.configfile['Spoof']['DHCP']
		self.target = options.target
		self.manualiptables = options.manualiptables
		self.protocolInstances = []

		#Makes scapy more verbose
		debug = False
		if options.log_level is 'debug':
			debug = True

		if options.arp:

			if not options.gateway:
				sys.exit("[-] --arp argument requires --gateway")

			arp = _ARP(options.gateway, options.interface, options.mac_address)
			arp.target = options.target
			arp.arpmode = options.arpmode
			arp.debug = debug

			self.protocolInstances.append(arp)

		elif options.icmp:

			if not options.gateway:
				sys.exit("[-] --icmp argument requires --gateway")

			if not options.target:
				sys.exit("[-] --icmp argument requires --target")

			icmp = _ICMP(options.interface, options.target, options.gateway, options.ip_address)
			icmp.debug = debug

			self.protocolInstances.append(icmp)

		elif options.dhcp:

			if options.target:
				sys.exit("[-] --target argument invalid when DCHP spoofing")

			dhcp = _DHCP(options.interface, self.dhcpcfg, options.ip_address, options.mac_address)
			dhcp.shellshock = options.shellshock
			dhcp.debug = debug
			self.protocolInstances.append(dhcp)

		if options.dns:

			if not options.manualiptables:
				if IpTables.getInstance().dns is False:
					IpTables.getInstance().DNS(options.ip_address, self.dnscfg['port'])

			DNSChef.getInstance().loadRecords(self.dnscfg)

		if not options.arp and not options.icmp and not options.dhcp and not options.dns:
			sys.exit("[-] Spoof plugin requires --arp, --icmp, --dhcp or --dns")

		SystemConfig.setIpForwarding(1)

		if not options.manualiptables:
			if IpTables.getInstance().http is False:
				IpTables.getInstance().HTTP(options.listen)

		for protocol in self.protocolInstances:
			protocol.start()
Пример #12
0
    def initialize(self, options):
        '''Called if plugin is enabled, passed the options namespace'''
        self.options = options
        self.dnscfg = options.configfile['MITMf']['DNS']
        self.dhcpcfg = options.configfile['Spoof']['DHCP']
        self.target = options.target
        self.manualiptables = options.manualiptables
        self.protocolInstances = []

        #Makes scapy more verbose
        debug = False
        if options.log_level is 'debug':
            debug = True

        if options.arp:

            if not options.gateway:
                sys.exit("[-] --arp argument requires --gateway")

            arp = _ARP(options.gateway, options.interface, options.mac_address)
            arp.target = options.target
            arp.arpmode = options.arpmode
            arp.debug = debug

            self.protocolInstances.append(arp)

        elif options.icmp:

            if not options.gateway:
                sys.exit("[-] --icmp argument requires --gateway")

            if not options.target:
                sys.exit("[-] --icmp argument requires --target")

            icmp = _ICMP(options.interface, options.target, options.gateway,
                         options.ip_address)
            icmp.debug = debug

            self.protocolInstances.append(icmp)

        elif options.dhcp:

            if options.target:
                sys.exit("[-] --target argument invalid when DCHP spoofing")

            dhcp = _DHCP(options.interface, self.dhcpcfg, options.ip_address,
                         options.mac_address)
            dhcp.shellshock = options.shellshock
            dhcp.debug = debug
            self.protocolInstances.append(dhcp)

        if options.dns:

            if not options.manualiptables:
                if IpTables.getInstance().dns is False:
                    IpTables.getInstance().DNS(options.ip_address,
                                               self.dnscfg['port'])

            DNSChef.getInstance().loadRecords(self.dnscfg)

        if not options.arp and not options.icmp and not options.dhcp and not options.dns:
            sys.exit(
                "[-] Spoof plugin requires --arp, --icmp, --dhcp or --dns")

        SystemConfig.setIpForwarding(1)

        if not options.manualiptables:
            if IpTables.getInstance().http is False:
                IpTables.getInstance().HTTP(options.listen)

        for protocol in self.protocolInstances:
            protocol.start()