Skip to content

Commit

Permalink
Merge pull request #223 from s0lst1c3/fix-build-issues
Browse files Browse the repository at this point in the history
Fix build issues - Sept 22nd 2024
  • Loading branch information
s0lst1c3 authored Sep 22, 2024
2 parents 442ee78 + 87c4acc commit 91e8956
Show file tree
Hide file tree
Showing 20 changed files with 117 additions and 33 deletions.
8 changes: 8 additions & 0 deletions Changelog
Original file line number Diff line number Diff line change
Expand Up @@ -183,3 +183,11 @@ Resolve issue #59 by fixing Python3 unicode bullshit. :D

1.13.5 - Gabriel Ryan <[email protected]>
Fixed gevent / python 3.9 related fuckery.

1.14.1 - Gabriel Ryan <[email protected]>
Fixed hostapd-eaphammer_lib build issues.
The system-wide package manager (i.e. apt) is now the single source of truth for dependencies, including Python. Sounds stupid, but realistically it's probably the most stable option until we start managing the Python portions of this thing with something that isn't archaic (like Poetry) and published as a proper PyPi package.
Removed unused Python dependencies: jinja2, pyquery
Added support for Python 3.12 (Credit: github.com/D3vil0p3r)
Updated README to reflect use of apt during installation instructions (Credit: github.com/readloud)
Added wget to dependencies (Credit: github/pes-soft)
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ by Gabriel Ryan ([s0lst1c3](https://twitter.com/s0lst1c3))

[![Foo](https://rawcdn.githack.com/toolswatch/badges/8bd9be6dac2a1d445367001f2371176cc50a5707/arsenal/usa/2017.svg)](https://www.blackhat.com/us-17/arsenal.html#eaphammer)

Current release: [v1.14.0](https://github.com/s0lst1c3/eaphammer/releases/tag/v1.14.0)
Current release: [v1.14.1](https://github.com/s0lst1c3/eaphammer/releases/tag/v1.14.1)

Supports _Python 3.9+_.

Expand All @@ -20,6 +20,16 @@ EAPHammer (the "Software") and associated documentation is provided “AS IS”.

## Quick Start Guide - Kali

### Install using Apt

```
sudo apt update
sudo apt upgrade
sudo apt install eaphammer
```

### Build from source

Begin by cloning the __eaphammer__ repo using the following command:

git clone https://github.com/s0lst1c3/eaphammer.git
Expand All @@ -28,6 +38,8 @@ Next run the kali-setup file as shown below to complete the eaphammer setup proc

./kali-setup

### Basic Usage

To setup and execute a credential stealing evil twin attack against a WPA/2-EAP network:

# generate certificates
Expand Down
2 changes: 1 addition & 1 deletion __version__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = '1.14.0'
__version__ = '1.14.1'
__codename__ = 'Final Frontier'
__author__ = '@s0lst1c3'
__contact__ = 'gabriel<<at>>transmitengage.com'
Expand Down
2 changes: 1 addition & 1 deletion core/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def set_options():
action='store_true',
help=('Trigger Windows Defender on nearby '
'devices by spawning an AP with SSID '
'set to C:\Temp\Invoke-Mimikatz.ps1'))
'set to C:\\Temp\\Invoke-Mimikatz.ps1'))

modes_group_.add_argument('--eap-spray',
dest='eap_spray',
Expand Down
2 changes: 1 addition & 1 deletion core/iw_parse/iw_parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import re
import subprocess

VERSION_RGX = re.compile("version\s+\d+", re.IGNORECASE)
VERSION_RGX = re.compile(r"version\s+\d+", re.IGNORECASE)

def get_name(cell):
""" Gets the name / essid of a network / cell.
Expand Down
21 changes: 21 additions & 0 deletions core/strtobool.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
_MAP = {
'y': True,
'yes': True,
't': True,
'true': True,
'on': True,
'1': True,
'n': False,
'no': False,
'f': False,
'false': False,
'off': False,
'0': False
}


def strtobool(value):
try:
return _MAP[str(value).lower()]
except KeyError:
raise ValueError('"{}" is not a valid bool value'.format(value))
22 changes: 22 additions & 0 deletions core/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,28 @@
from settings import settings
from tqdm import tqdm


_STR2BOOL_MAP = {
'y': True,
'yes': True,
't': True,
'true': True,
'on': True,
'1': True,
'n': False,
'no': False,
'f': False,
'false': False,
'off': False,
'0': False
}

def strtobool(value):
try:
return _STR2BOOL_MAP[str(value).lower()]
except KeyError:
raise ValueError(f'"{value}" is not a valid bool value')

def ip_replace_last_octet(ip_addr, new_val):

return '.'.join(ip_addr.split('.')[:-1]+[new_val])
Expand Down
2 changes: 1 addition & 1 deletion core/wskeyloggerd/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

from settings import settings

'''
r'''
. .
. =O===
. _ %- - %%%
Expand Down
3 changes: 1 addition & 2 deletions eaphammer
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,11 @@ from settings import settings
from __version__ import __version__, __tagline__, __author__, __contact__, __codename__
from threading import Thread
from core.utils import ip_replace_last_octet
from core.utils import strtobool
from core.loader import Loader

from core.module_maker import ModuleMaker

from distutils.util import strtobool

def hostile_portal():

global responder
Expand Down
11 changes: 11 additions & 0 deletions kali-dependencies.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,15 @@ libnl-genl-3-dev
libcurl4-openssl-dev
zlib1g-dev
libpcap-dev
wget
python3-pip
python3-gevent
python3-tqdm
python3-pem
python3-openssl
python3-scapy
python3-lxml
python3-pywebcopy
python3-bs4
python3-flask-cors
python3-flask-socketio
4 changes: 0 additions & 4 deletions kali-setup
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,6 @@ if __name__ == '__main__':
os.system('apt -y install %s' % read_deps_file('kali-dependencies.txt'))
print('\n[*] complete!\n')

print('\n[*] Installing Python dependencies...\n')
os.system('python3 -m pip install -r pip.req')
print('\n[*] complete!\n')


print('\n[*] Downloading OpenSSL_{}...\n'.format(openssl_version.replace('.', '_')))
os.system('wget {} -O {}/openssl.tar.gz'.format(openssl_source, local_dir))
Expand Down
7 changes: 5 additions & 2 deletions local/hostapd-eaphammer/hostapd/config_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -319,8 +319,11 @@ static int hostapd_config_read_maclist(const char *fname,

// increment to the first null terminator or instance of whitespace
// (whichever comes first)
addr_str[18] = ""; // 18 == length of ascii mac representation + null terminator
mask_str[18] = "ff:ff:ff:ff:ff:ff"; // 18 == length of ascii mac representation + null terminator
char addr_str[19]; // 19 == length of ascii mac representation + null terminator
char mask_str[19]; // 19 == length of ascii mac representation + null terminator
strcpy(addr_str, ""); // copy empty string into addr_str
strcpy(mask_str, "ff:ff:ff:ff:ff:ff"); // copy string into mask_str

addr_str_index = 0;
mask_str_index = 0;
while (*pos != '\0' && *pos != ' ' && *pos != '\t') {
Expand Down
4 changes: 4 additions & 0 deletions local/hostapd-eaphammer/src/eap_server/eap_server_gtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
#include "common.h"
#include "eap_i.h"

#ifdef EAPHAMMER
#include "eaphammer_wpe/eaphammer_wpe.h"
#endif


struct eap_gtc_data {
enum { CONTINUE, SUCCESS, FAILURE } state;
Expand Down
5 changes: 5 additions & 0 deletions local/hostapd-eaphammer/src/eap_server/eap_server_md5.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,14 @@
#include "eap_i.h"
#include "eap_common/chap.h"

#ifdef EAPHAMMER
#include "eaphammer_wpe/eaphammer_wpe.h"
#endif


#define CHALLENGE_LEN 16


struct eap_md5_data {
u8 challenge[CHALLENGE_LEN];
enum { CONTINUE, SUCCESS, FAILURE } state;
Expand Down
11 changes: 11 additions & 0 deletions parrot-dependencies.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,14 @@ libcurl4-openssl-dev
zlib1g-dev
libpcap-dev
python3-pip
python3-gevent
python3-tqdm
python3-pem
python3-openssl
python3-scapy
python3-lxml
python3-pywebcopy
python3-bs4
python3-flask-cors
python3-flask-socketio

6 changes: 0 additions & 6 deletions parrot-setup
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,6 @@ if __name__ == '__main__':
os.system('apt -y install %s -t parrot-backports' % read_deps_file('parrot-dependencies.txt'))
print('\n[*] complete!\n')


print('\n[*] Installing Python dependencies...\n')
os.system('python3 -m pip install -r pip.req')
print('\n[*] complete!\n')


print('\n[*] Downloading OpenSSL_{}...\n'.format(openssl_version.replace('.', '_')))
os.system('wget {} -O {}/openssl.tar.gz'.format(openssl_source, local_dir))
print('\n[*] complete!\n')
Expand Down
5 changes: 1 addition & 4 deletions pip.req
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
gevent>=1.5.0
tqdm
pem==21.2.0
pem>=21.2.0
pyOpenSSL
scapy
lxml
beautifulsoup4
pyquery
requests_html
pywebcopy
jinja2
flask-cors
flask-socketio
11 changes: 11 additions & 0 deletions raspbian-dependencies.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,14 @@ libcurl4-openssl-dev
zlib1g-dev
libpcap-dev
python3-pip
python3-gevent
python3-tqdm
python3-pem
python3-openssl
python3-scapy
python3-lxml
python3-pywebcopy
python3-bs4
python3-flask-cors
python3-flask-socketio

5 changes: 0 additions & 5 deletions raspbian-setup
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,6 @@ if __name__ == '__main__':
os.system('apt -y install %s' % read_deps_file('raspbian-dependencies.txt'))
print('\n[*] complete!\n')

print('\n[*] Installing Python dependencies...\n')
os.system('python3 -m pip install -r pip.req')
print('\n[*] complete!\n')


print('\n[*] Downloading OpenSSL_{}...\n'.format(openssl_version.replace('.', '_')))
os.system('wget {} -O {}/openssl.tar.gz'.format(openssl_source, local_dir))
print('\n[*] complete!\n')
Expand Down
5 changes: 0 additions & 5 deletions ubuntu-unattended-setup
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,6 @@ if __name__ == '__main__':
os.system('export DEBIAN_FRONTEND=noninteractive && apt -yq install %s' % read_deps_file('kali-dependencies.txt'))
print('\n[*] complete!\n')

print('\n[*] Installing Python dependencies...\n')
os.system('python3 -m pip install -r pip.req')
print('\n[*] complete!\n')


print('\n[*] Downloading OpenSSL_{}...\n'.format(openssl_version.replace('.', '_')))
os.system('wget {} -O {}/openssl.tar.gz'.format(openssl_source, local_dir))
print('\n[*] complete!\n')
Expand Down

0 comments on commit 91e8956

Please sign in to comment.