cybersecurity · intermediate · ~15 min · safe pentest lab

Count failed logins

Count auth failures in a log.

Challenge

Implement int failed_logins(const char *log) returning the number of lines containing "Failed password".

Starter code

#include <string.h>

int failed_logins(const char *log) {
    /* TODO */
    return 0;
}

Solve this exercise in the browser editor — compile and run against the test harness, no setup required.