forked from wifiphisher/wifiphisher
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
123 lines (118 loc) · 5.1 KB
/
setup.py
File metadata and controls
123 lines (118 loc) · 5.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
#!/usr/bin/env python
import sys
import os
from setuptools import setup, find_packages
from distutils.spawn import find_executable
from wifiphisher.constants import *
setup(
name = "wifiphisher",
author = "sophron",
author_email = "sophron@latthi.com",
description = ("Automated phishing attacks against Wi-Fi networks"),
license = "GPL",
keywords = ['wifiphisher', 'evil', 'twin', 'phishing'],
packages = find_packages(),
include_package_data = True,
version = "1.1",
entry_points = {
'console_scripts': [
'wifiphisher = wifiphisher.pywifiphisher:run'
]
},
install_requires = [
'PyRIC',
'jinja2']
)
def get_dnsmasq():
if not os.path.isfile('/usr/sbin/dnsmasq'):
install = raw_input(
('[' + T + '*' + W + '] dnsmasq not found ' +
'in /usr/bin/dnsmasq, install now? [y/n] ')
)
if install == 'y':
if os.path.isfile('/usr/bin/pacman'):
os.system('pacman -S dnsmasq')
elif os.path.isfile('/usr/bin/yum'):
os.system('yum install dnsmasq')
else:
os.system('apt-get -y install dnsmasq')
else:
sys.exit(('[' + R + '-' + W + '] dnsmasq' +
' not found in /usr/sbin/dnsmasq'))
if not os.path.isfile('/usr/sbin/dnsmasq'):
sys.exit((
'\n[' + R + '-' + W + '] Unable to install the \'dnsmasq\' package!\n' +
'[' + T + '*' + W + '] This process requires a persistent internet connection!\n' +
'Please follow the link below to configure your sources.list\n' +
B + 'http://docs.kali.org/general-use/kali-linux-sources-list-repositories\n' + W +
'[' + G + '+' + W + '] Run apt-get update for changes to take effect.\n' +
'[' + G + '+' + W + '] Rerun the script to install dnsmasq.\n' +
'[' + R + '!' + W + '] Closing'
))
def get_hostapd():
if not os.path.isfile('/usr/sbin/hostapd'):
install = raw_input(
('[' + T + '*' + W + '] hostapd not found ' +
'in /usr/sbin/hostapd, install now? [y/n] ')
)
if install == 'y':
if os.path.isfile('/usr/bin/pacman'):
os.system('pacman -S hostapd')
elif os.path.isfile('/usr/bin/yum'):
os.system('yum install hostapd')
else:
os.system('apt-get -y install hostapd')
else:
sys.exit(('[' + R + '-' + W + '] hostapd' +
' not found in /usr/sbin/hostapd'))
if not os.path.isfile('/usr/sbin/hostapd'):
sys.exit((
'\n[' + R + '-' + W + '] Unable to install the \'hostapd\' package!\n' +
'[' + T + '*' + W + '] This process requires a persistent internet connection!\n' +
'Please follow the link below to configure your sources.list\n' +
B + 'http://docs.kali.org/general-use/kali-linux-sources-list-repositories\n' + W +
'[' + G + '+' + W + '] Run apt-get update for changes to take effect.\n' +
'[' + G + '+' + W + '] Rerun the script to install hostapd.\n' +
'[' + R + '!' + W + '] Closing'
))
def get_ifconfig():
# This is only useful for Arch Linux which does not contain ifconfig by default
if not find_executable('ifconfig'):
install = raw_input(
('[' + T + '*' + W + '] ifconfig not found. ' +
'install now? [y/n] ')
)
if install == 'y':
if os.path.isfile('/usr/bin/pacman'):
os.system('pacman -S net-tools')
else:
sys.exit((
'\n[' + R + '-' + W + '] Don\'t know how to install ifconfig for your distribution.\n' +
'[' + G + '+' + W + '] Rerun the script after installing it manually.\n' +
'[' + R + '!' + W + '] Closing'
))
else:
sys.exit(('[' + R + '-' + W + '] ifconfig' +
' not found'))
if not find_executable('ifconfig'):
sys.exit((
'\n[' + R + '-' + W + '] Unable to install the \'net-tools\' package!\n' +
'[' + T + '*' + W + '] This process requires a persistent internet connection!\n' +
'[' + G + '+' + W + '] Run pacman -Syu to make sure you are up to date first.\n' +
'[' + G + '+' + W + '] Rerun the script to install net-tools.\n' +
'[' + R + '!' + W + '] Closing'
))
# Get hostapd, dnsmasq or ifconfig if needed
get_hostapd()
get_dnsmasq()
get_ifconfig()
print
print " _ __ _ _ _ _ "
print " (_)/ _(_) | | (_) | | "
print " ((.)) __ ___| |_ _ _ __ | |__ _ ___| |__ ___ _ __ "
print " | \ \ /\ / / | _| | '_ \| '_ \| / __| '_ \ / _ \ '__|"
print " /_\ \ V V /| | | | | |_) | | | | \__ \ | | | __/ | "
print " /___\ \_/\_/ |_|_| |_| .__/|_| |_|_|___/_| |_|\___|_| "
print " / \ | | "
print " |_| "
print " "