cybersecurity · beginner · ~15 min · safe pentest lab
Restrict a scanner to loopback.
Implement int scan_allowed(const char *host) returning 1 only for "127.0.0.1", "localhost", or "::1"; any other host returns 0.
#include <string.h>
int scan_allowed(const char *host) {
/* TODO */
return 0;
}
Solve this exercise in the browser editor — compile and run against the test harness, no setup required.