Exploit databaseDownload repository ZIP
GH-25fc1985744fec336f986521e61a3fb7
chertogun/cve-2020-27301-hostapd
Sources for CVE-2020-27301
1 sourcePreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars.
Repository files103
chertogun/cve-2020-27301-hostapdRevision d29c6457cb14
- ↑..Parent directory
- Makefile
- accounting.c
- accounting.h
- acs.c
- acs.h
- airtime_policy.c
- airtime_policy.h
- ap_config.c
- ap_config.h
- ap_drv_ops.c
- ap_drv_ops.h
- ap_list.c
- ap_list.h
- ap_mlme.c
- ap_mlme.h
- authsrv.c
- authsrv.h
- beacon.c
- beacon.h
- bss_load.c
- bss_load.h
- ctrl_iface_ap.c
- ctrl_iface_ap.h
- dfs.c
- dfs.h
- dhcp_snoop.c
- dhcp_snoop.h
- dpp_hostapd.c
- dpp_hostapd.h
- drv_callbacks.c
- eap_user_db.c
- eth_p_oui.c
- eth_p_oui.h
- fils_hlp.c
- fils_hlp.h
- gas_query_ap.c
- gas_query_ap.h
- gas_serv.c
- gas_serv.h
- hostapd.c
- hostapd.h
- hs20.c
- hs20.h
- hw_features.c
- hw_features.h
- ieee802_11.c
- ieee802_11.h
- ieee802_11_auth.c
- ieee802_11_auth.h
- ieee802_11_he.c
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
src/ap/utils.c
C · 2,459 bytes/*
* AP mode helper functions
* Copyright (c) 2009, Jouni Malinen <[email protected]>
*
* This software may be distributed under the terms of the BSD license.
* See README for more details.
*/
#include "includes.h"
#include "common.h"
#include "common/ieee802_11_defs.h"
#include "fst/fst.h"
#include "sta_info.h"
#include "hostapd.h"
int hostapd_register_probereq_cb(struct hostapd_data *hapd,
int (*cb)(void *ctx, const u8 *sa,
const u8 *da, const u8 *bssid,
const u8 *ie, size_t ie_len,
int ssi_signal),
void *ctx)
{
struct hostapd_probereq_cb *n;
n = os_realloc_array(hapd->probereq_cb, hapd->num_probereq_cb + 1,
sizeof(struct hostapd_probereq_cb));
if (n == NULL)
return -1;
hapd->probereq_cb = n;
n = &hapd->probereq_cb[hapd->num_probereq_cb];
hapd->num_probereq_cb++;
n->cb = cb;
n->ctx = ctx;
return 0;
}
struct prune_data {
struct hostapd_data *hapd;
const u8 *addr;
};
static int prune_associations(struct hostapd_iface *iface, void *ctx)
{
struct prune_data *data = ctx;
struct sta_info *osta;
struct hostapd_data *ohapd;
size_t j;
for (j = 0; j < iface->num_bss; j++) {
ohapd = iface->bss[j];
if (ohapd == data->hapd)
continue;
#ifdef CONFIG_TESTING_OPTIONS
if (ohapd->conf->skip_prune_assoc)
continue;
#endif /* CONFIG_TESTING_OPTIONS */
#ifdef CONFIG_FST
/* Don't prune STAs belong to same FST */
if (ohapd->iface->fst &&
data->hapd->iface->fst &&
fst_are_ifaces_aggregated(ohapd->iface->fst,
data->hapd->iface->fst))
continue;
#endif /* CONFIG_FST */
osta = ap_get_sta(ohapd, data->addr);
if (!osta)
continue;
wpa_printf(MSG_INFO, "%s: Prune association for " MACSTR,
ohapd->conf->iface, MAC2STR(osta->addr));
ap_sta_disassociate(ohapd, osta, WLAN_REASON_UNSPECIFIED);
}
return 0;
}
/**
* hostapd_prune_associations - Remove extraneous associations
* @hapd: Pointer to BSS data for the most recent association
* @addr: Associated STA address
*
* This function looks through all radios and BSS's for previous
* (stale) associations of STA. If any are found they are removed.
*/
void hostapd_prune_associations(struct hostapd_data *hapd, const u8 *addr)
{
struct prune_data data;
data.hapd = hapd;
data.addr = addr;
if (hapd->iface->interfaces &&
hapd->iface->interfaces->for_each_interface)
hapd->iface->interfaces->for_each_interface(
hapd->iface->interfaces, prune_associations, &data);
}