Exploit databaseDownload repository ZIP
GH-d879f8fbd49e794749f87fba32e9a2ac
helica-core/eap_pwn
Sources for CVE-2023-52160
1 sourcePreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars.
Repository files44
helica-core/eap_pwnRevision f17536590df8
- ↑..Parent directory
- .gitignore
- Makefile
- eap.c
- eap.h
- eap_aka.c
- eap_config.h
- eap_eke.c
- eap_fast.c
- eap_fast_pac.c
- eap_fast_pac.h
- eap_gpsk.c
- eap_gtc.c
- eap_i.h
- eap_ikev2.c
- eap_leap.c
- eap_md5.c
- eap_methods.c
- eap_methods.h
- eap_mschapv2.c
- eap_otp.c
- eap_pax.c
- eap_peap.c
- eap_proxy.h
- eap_proxy_dummy.c
- eap_psk.c
- eap_pwd.c
- eap_sake.c
- eap_sim.c
- eap_teap.c
- eap_teap_pac.c
- eap_teap_pac.h
- eap_tls.c
- eap_tls_common.c
- eap_tls_common.h
- eap_tnc.c
- eap_ttls.c
- eap_vendor_test.c
- eap_wsc.c
- ikev2.c
- ikev2.h
- mschapv2.c
- mschapv2.h
- tncc.c
- tncc.h
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
src/eap_peer/eap_otp.c
C · 2,153 bytes/*
* EAP peer method: EAP-OTP (RFC 3748)
* Copyright (c) 2004-2006, 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 "eap_i.h"
static void * eap_otp_init(struct eap_sm *sm)
{
/* No need for private data. However, must return non-NULL to indicate
* success. */
return (void *) 1;
}
static void eap_otp_deinit(struct eap_sm *sm, void *priv)
{
}
static struct wpabuf * eap_otp_process(struct eap_sm *sm, void *priv,
struct eap_method_ret *ret,
const struct wpabuf *reqData)
{
struct wpabuf *resp;
const u8 *pos, *password;
size_t password_len, len;
int otp;
pos = eap_hdr_validate(EAP_VENDOR_IETF, EAP_TYPE_OTP, reqData, &len);
if (pos == NULL) {
ret->ignore = true;
return NULL;
}
wpa_hexdump_ascii(MSG_MSGDUMP, "EAP-OTP: Request message",
pos, len);
password = eap_get_config_otp(sm, &password_len);
if (password)
otp = 1;
else {
password = eap_get_config_password(sm, &password_len);
otp = 0;
}
if (password == NULL) {
wpa_printf(MSG_INFO, "EAP-OTP: Password not configured");
eap_sm_request_otp(sm, (const char *) pos, len);
ret->ignore = true;
return NULL;
}
ret->ignore = false;
ret->methodState = METHOD_DONE;
ret->decision = DECISION_COND_SUCC;
ret->allowNotifications = false;
resp = eap_msg_alloc(EAP_VENDOR_IETF, EAP_TYPE_OTP, password_len,
EAP_CODE_RESPONSE, eap_get_id(reqData));
if (resp == NULL)
return NULL;
wpabuf_put_data(resp, password, password_len);
wpa_hexdump_ascii_key(MSG_MSGDUMP, "EAP-OTP: Response",
password, password_len);
if (otp) {
wpa_printf(MSG_DEBUG, "EAP-OTP: Forgetting used password");
eap_clear_config_otp(sm);
}
return resp;
}
int eap_peer_otp_register(void)
{
struct eap_method *eap;
eap = eap_peer_method_alloc(EAP_PEER_METHOD_INTERFACE_VERSION,
EAP_VENDOR_IETF, EAP_TYPE_OTP, "OTP");
if (eap == NULL)
return -1;
eap->init = eap_otp_init;
eap->deinit = eap_otp_deinit;
eap->process = eap_otp_process;
return eap_peer_method_register(eap);
}