cybersecurity · beginner · ~15 min · safe pentest lab

Count accepted logins

Count successful authentications.

Challenge

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

Starter code

#include <string.h>

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

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