Skip to content

Commit

Permalink
Merge pull request #5 from InfamousSYN/802.11ac
Browse files Browse the repository at this point in the history
Fix to 802.11ac support
  • Loading branch information
InfamousSYN committed Oct 11, 2018
2 parents f24a7ca + a35a55d commit 2b488e1
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 53 deletions.
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,13 @@ IEEE 802.11n related configuration:
IEEE 802.11ac related configuration:
--vht-width {0,1,2,3}
VHT channel width (Default: 1).
--vht-seg0_index VHT_OPER_CENTR_FREQ_SEG0_IDX
index 42 gives center freq 5.210 GHz (Default: 42).
--vht-seg1_index VHT_OPER_CENTR_FREQ_SEG1_IDX
index 159 gives center freq 5.795 GHz (Default: 159).
--vht-operation {0,1}
Enable toggling between vht_oper_centr_freq_seg0_idx
and vht_oper_centr_freq_seg1_idx (Default: 1 for
vht_oper_centr_freq_seg0_idx).
--vht-index VHT_INDEX
Enables control of vht_oper_centr_freq_seg[0/1]_idx
index value (Default: 42).
--require-vht Require stations to support VHT PHY (reject
association if they do not) (Default: disabled).
Expand Down
2 changes: 1 addition & 1 deletion config.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import argparse

# application version
__version__ = "1.0"
__version__ = "1.1"

# directory mapping
root_dir, conf_file = os.path.split(os.path.abspath(__file__))
Expand Down
34 changes: 13 additions & 21 deletions core/libs/conf_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,7 @@ def configure(cls,
require_ht=None,
ieee80211ac=None,
vht_oper_chwidth=None,
vht_oper_centr_freq_seg0_idx=None,
vht_oper_centr_freq_seg1_idx=None,
vht_operations=None,
require_vht=None,
ieee80211d=None,
ieee80211h=None,
Expand All @@ -273,8 +272,7 @@ def configure(cls,
assert require_ht is not None
assert ieee80211ac is not None
assert vht_oper_chwidth is not None
assert vht_oper_centr_freq_seg0_idx is not None
assert vht_oper_centr_freq_seg1_idx is not None
assert vht_operations is not None
assert require_vht is not None
assert ieee80211d is not None
assert ieee80211h is not None
Expand All @@ -284,7 +282,7 @@ def configure(cls,
print("[+] Creating hostapd-wpe.confg file: %s" % cls.path)
with open(cls.path, 'w') as fd:
fd.write(cls.template %\
(driver, interface, bssid, ssid, hw_mode, channel, country_code, ieee80211d, ieee80211h, auth_algs, essid_mask, macaddr_acl, wmm_enabled, ap_isolate, ieee80211n, ht_capab, require_ht, ieee80211ac, require_vht, vht_oper_chwidth, vht_oper_centr_freq_seg0_idx, vht_oper_centr_freq_seg1_idx))
(driver, interface, bssid, ssid, hw_mode, channel, country_code, ieee80211d, ieee80211h, auth_algs, essid_mask, macaddr_acl, wmm_enabled, ap_isolate, ieee80211n, ht_capab, require_ht, ieee80211ac, require_vht, vht_oper_chwidth, vht_operations))
except Exception as e:
print("[!] Error: %s" % e)
return 1
Expand Down Expand Up @@ -312,8 +310,7 @@ def configure(cls,
require_ht=None,
ieee80211ac=None,
vht_oper_chwidth=None,
vht_oper_centr_freq_seg0_idx=None,
vht_oper_centr_freq_seg1_idx=None,
vht_operations=None,
require_vht=None,
ieee80211d=None,
ieee80211h=None,
Expand All @@ -338,8 +335,7 @@ def configure(cls,
assert require_ht is not None
assert ieee80211ac is not None
assert vht_oper_chwidth is not None
assert vht_oper_centr_freq_seg0_idx is not None
assert vht_oper_centr_freq_seg1_idx is not None
assert vht_operations is not None
assert require_vht is not None
assert ieee80211d is not None
assert ieee80211h is not None
Expand All @@ -351,7 +347,7 @@ def configure(cls,
print("[+] Creating hostapd-wpe.confg file: %s" % cls.path)
with open(cls.path, 'w') as fd:
fd.write(cls.template %\
(driver, interface, bssid, ssid, hw_mode, channel, country_code, ieee80211d, ieee80211h, auth_algs, essid_mask, macaddr_acl, wmm_enabled, ap_isolate, wep_default_key, wep_key, ieee80211n, ht_capab, require_ht, ieee80211ac, require_vht, vht_oper_chwidth, vht_oper_centr_freq_seg0_idx, vht_oper_centr_freq_seg1_idx))
(driver, interface, bssid, ssid, hw_mode, channel, country_code, ieee80211d, ieee80211h, auth_algs, essid_mask, macaddr_acl, wmm_enabled, ap_isolate, wep_default_key, wep_key, ieee80211n, ht_capab, require_ht, ieee80211ac, require_vht, vht_oper_chwidth, vht_operations))
except Exception as e:
print("[!] Error: %s" % e)
return 1
Expand Down Expand Up @@ -379,8 +375,7 @@ def configure(cls,
require_ht=None,
ieee80211ac=None,
vht_oper_chwidth=None,
vht_oper_centr_freq_seg0_idx=None,
vht_oper_centr_freq_seg1_idx=None,
vht_operations=None,
require_vht=None,
ieee80211d=None,
ieee80211h=None,
Expand All @@ -407,8 +402,7 @@ def configure(cls,
assert require_ht is not None
assert ieee80211ac is not None
assert vht_oper_chwidth is not None
assert vht_oper_centr_freq_seg0_idx is not None
assert vht_oper_centr_freq_seg1_idx is not None
assert vht_operations is not None
assert require_vht is not None
assert ieee80211d is not None
assert ieee80211h is not None
Expand All @@ -422,7 +416,7 @@ def configure(cls,
print("[+] Creating hostapd-wpe.confg file: %s" % cls.path)
with open(cls.path, 'w') as fd:
fd.write(cls.template %\
(driver, interface, bssid, ssid, hw_mode, channel, country_code, ieee80211d, ieee80211h, auth_algs, essid_mask, macaddr_acl, wmm_enabled, ap_isolate, ieee80211n, ht_capab, require_ht, ieee80211ac, require_vht, vht_oper_chwidth, vht_oper_centr_freq_seg0_idx, vht_oper_centr_freq_seg1_idx, wpa, wpa_passphrase, wpa_pairwise, rsn_pairwise))
(driver, interface, bssid, ssid, hw_mode, channel, country_code, ieee80211d, ieee80211h, auth_algs, essid_mask, macaddr_acl, wmm_enabled, ap_isolate, ieee80211n, ht_capab, require_ht, ieee80211ac, require_vht, vht_oper_chwidth, vht_operations, wpa, wpa_passphrase, wpa_pairwise, rsn_pairwise))
except Exception as e:
print("[!] Error: %s" % e)
return 1
Expand Down Expand Up @@ -450,8 +444,7 @@ def configure(cls,
require_ht=None,
ieee80211ac=None,
vht_oper_chwidth=None,
vht_oper_centr_freq_seg0_idx=None,
vht_oper_centr_freq_seg1_idx=None,
vht_operations=None,
require_vht=None,
ieee80211d=None,
ieee80211h=None,
Expand Down Expand Up @@ -492,8 +485,7 @@ def configure(cls,
assert require_ht is not None
assert ieee80211ac is not None
assert vht_oper_chwidth is not None
assert vht_oper_centr_freq_seg0_idx is not None
assert vht_oper_centr_freq_seg1_idx is not None
assert vht_operations is not None
assert require_vht is not None
assert ieee80211d is not None
assert ieee80211h is not None
Expand Down Expand Up @@ -521,7 +513,7 @@ def configure(cls,
print("[+] Creating hostapd-wpe.confg file: %s" % cls.path)
with open(cls.path, 'w') as fd:
fd.write(cls.template %\
(driver, interface, bssid, eap_user_file, ca_pem, server_pem, private_key, dh_file, ssid, hw_mode, channel, country_code, ieee80211d, ieee80211h, auth_algs, essid_mask, macaddr_acl, wmm_enabled, ap_isolate, ieee80211n, ht_capab, require_ht, ieee80211ac, require_vht, vht_oper_chwidth, vht_oper_centr_freq_seg0_idx, vht_oper_centr_freq_seg1_idx, wpa, wpa_pairwise, rsn_pairwise, ieee8021x, eapol_version, eapol_workaround, own_ip_addr, auth_server_addr, auth_server_port, auth_server_shared_secret, acct_server_addr, acct_server_port, acct_server_shared_secret))
(driver, interface, bssid, eap_user_file, ca_pem, server_pem, private_key, dh_file, ssid, hw_mode, channel, country_code, ieee80211d, ieee80211h, auth_algs, essid_mask, macaddr_acl, wmm_enabled, ap_isolate, ieee80211n, ht_capab, require_ht, ieee80211ac, require_vht, vht_oper_chwidth, vht_operations, wpa, wpa_pairwise, rsn_pairwise, ieee8021x, eapol_version, eapol_workaround, own_ip_addr, auth_server_addr, auth_server_port, auth_server_shared_secret, acct_server_addr, acct_server_port, acct_server_shared_secret))
except Exception as e:
print("[!] Error: %s" % e)
return 1
Expand Down Expand Up @@ -584,4 +576,4 @@ def configure(cls,
(addr, port, webroot, error_log, custom_log, server_pem, private_key))
except Exception as e:
print("[!] Error: %s" % e)
return 1
return 1
25 changes: 16 additions & 9 deletions core/libs/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,17 +217,18 @@ def set_options():
default=1,
help='VHT channel width (Default: 1).')

ieee80211ac_config.add_argument('--vht-seg0_index',
dest='vht_oper_centr_freq_seg0_idx',
ieee80211ac_config.add_argument('--vht-operation',
dest='vht_oper',
type=int,
default=42,
help='index 42 gives center freq 5.210 GHz (Default: 42).')
choices=[0,1],
default=0,
help='Enable toggling between vht_oper_centr_freq_seg0_idx and vht_oper_centr_freq_seg1_idx (Default: 1 for vht_oper_centr_freq_seg0_idx).')

ieee80211ac_config.add_argument('--vht-seg1_index',
dest='vht_oper_centr_freq_seg1_idx',
ieee80211ac_config.add_argument('--vht-index',
dest='vht_index',
type=int,
default=159,
help='index 159 gives center freq 5.795 GHz (Default: 159).')
default=42,
help='Enables control of vht_oper_centr_freq_seg[0/1]_idx index value (Default: 42).')

ieee80211ac_config.add_argument('--require-vht',
dest='require_vht',
Expand Down Expand Up @@ -632,6 +633,12 @@ def set_options():
else:
options['require_vht'] = 0

if(options['vht_oper'] == 1):
options['vht_oper'] = "vht_oper_centr_freq_seg1_idx"
else:
options['vht_oper'] = "vht_oper_centr_freq_seg0_idx"
options['vht_operations'] = ("%s=%s" % (options['vht_oper'], options['vht_index']))

# comments out the Wireless Multimedia Extensions (WMM) in hostapd-wpe config file if not specified
if(options['wmm_enabled']):
options['wmm_enabled'] = "wmm_enabled=1"
Expand Down Expand Up @@ -720,4 +727,4 @@ def set_options():
else:
options['enable_httpd'] = False

return options
return options
22 changes: 13 additions & 9 deletions core/templates/hostapd_cnf.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,13 +287,14 @@
# So index 42 gives center freq 5.210 GHz
# which is channel 42 in 5G band
#
vht_oper_centr_freq_seg0_idx=%d
#vht_oper_centr_freq_seg0_idx=42
#
# center freq = 5 GHz + (5 * index)
# So index 159 gives center freq 5.795 GHz
# which is channel 159 in 5G band
#
vht_oper_centr_freq_seg1_idx=%d
#vht_oper_centr_freq_seg1_idx=159
%s
# Workaround to use station's nsts capability in (Re)Association Response frame
# This may be needed with some deployed devices as an interoperability
Expand Down Expand Up @@ -610,13 +611,14 @@
# So index 42 gives center freq 5.210 GHz
# which is channel 42 in 5G band
#
vht_oper_centr_freq_seg0_idx=%d
#vht_oper_centr_freq_seg0_idx=42
#
# center freq = 5 GHz + (5 * index)
# So index 159 gives center freq 5.795 GHz
# which is channel 159 in 5G band
#
vht_oper_centr_freq_seg1_idx=%d
#vht_oper_centr_freq_seg1_idx=159
%s
# Workaround to use station's nsts capability in (Re)Association Response frame
# This may be needed with some deployed devices as an interoperability
Expand Down Expand Up @@ -914,13 +916,14 @@
# So index 42 gives center freq 5.210 GHz
# which is channel 42 in 5G band
#
vht_oper_centr_freq_seg0_idx=%d
#vht_oper_centr_freq_seg0_idx=42
#
# center freq = 5 GHz + (5 * index)
# So index 159 gives center freq 5.795 GHz
# which is channel 159 in 5G band
#
vht_oper_centr_freq_seg1_idx=%d
#vht_oper_centr_freq_seg1_idx=159
%s
# Workaround to use station's nsts capability in (Re)Association Response frame
# This may be needed with some deployed devices as an interoperability
Expand Down Expand Up @@ -1273,13 +1276,14 @@
# So index 42 gives center freq 5.210 GHz
# which is channel 42 in 5G band
#
vht_oper_centr_freq_seg0_idx=%d
#vht_oper_centr_freq_seg0_idx=42
#
# center freq = 5 GHz + (5 * index)
# So index 159 gives center freq 5.795 GHz
# which is channel 159 in 5G band
#
vht_oper_centr_freq_seg1_idx=%d
#vht_oper_centr_freq_seg1_idx=159
%s
# Workaround to use station's nsts capability in (Re)Association Response frame
# This may be needed with some deployed devices as an interoperability
Expand Down Expand Up @@ -1565,4 +1569,4 @@
#
# DAS require Message-Authenticator
#radius_das_require_message_authenticator=1
'''
'''
14 changes: 5 additions & 9 deletions rogue.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,7 @@ def dhcpCidr(dhcp_netmask):
require_ht=options['require_ht'],
ieee80211ac=options['ieee80211ac'],
vht_oper_chwidth=options['vht_oper_chwidth'],
vht_oper_centr_freq_seg0_idx=options['vht_oper_centr_freq_seg0_idx'],
vht_oper_centr_freq_seg1_idx=options['vht_oper_centr_freq_seg1_idx'],
vht_operations=options['vht_operations'],
require_vht=options['require_vht'],
ieee80211d=options['ieee80211d'],
ieee80211h=options['ieee80211h'],
Expand All @@ -179,8 +178,7 @@ def dhcpCidr(dhcp_netmask):
require_ht=options['require_ht'],
ieee80211ac=options['ieee80211ac'],
vht_oper_chwidth=options['vht_oper_chwidth'],
vht_oper_centr_freq_seg0_idx=options['vht_oper_centr_freq_seg0_idx'],
vht_oper_centr_freq_seg1_idx=options['vht_oper_centr_freq_seg1_idx'],
vht_operations=options['vht_operations'],
require_vht=options['require_vht'],
ieee80211d=options['ieee80211d'],
ieee80211h=options['ieee80211h'],
Expand All @@ -206,8 +204,7 @@ def dhcpCidr(dhcp_netmask):
require_ht=options['require_ht'],
ieee80211ac=options['ieee80211ac'],
vht_oper_chwidth=options['vht_oper_chwidth'],
vht_oper_centr_freq_seg0_idx=options['vht_oper_centr_freq_seg0_idx'],
vht_oper_centr_freq_seg1_idx=options['vht_oper_centr_freq_seg1_idx'],
vht_operations=options['vht_operations'],
require_vht=options['require_vht'],
ieee80211d=options['ieee80211d'],
ieee80211h=options['ieee80211h'],
Expand Down Expand Up @@ -235,8 +232,7 @@ def dhcpCidr(dhcp_netmask):
require_ht=options['require_ht'],
ieee80211ac=options['ieee80211ac'],
vht_oper_chwidth=options['vht_oper_chwidth'],
vht_oper_centr_freq_seg0_idx=options['vht_oper_centr_freq_seg0_idx'],
vht_oper_centr_freq_seg1_idx=options['vht_oper_centr_freq_seg1_idx'],
vht_operations=options['vht_operations'],
require_vht=options['require_vht'],
ieee80211d=options['ieee80211d'],
ieee80211h=options['ieee80211h'],
Expand Down Expand Up @@ -496,4 +492,4 @@ def dhcpCidr(dhcp_netmask):
# cleanly allow network manager to regain control of interface
utils.nmcli.set_managed(options['interface'])

exit(0)
exit(0)

0 comments on commit 2b488e1

Please sign in to comment.