cybersecurity · beginner · ~15 min · safe pentest lab

Count invalid-user attempts

Count probing for nonexistent accounts.

Challenge

Implement int count_invalid_user(const char *log) returning the number of lines containing "invalid user".

Starter code

#include <string.h>

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

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