cybersecurity · beginner · ~15 min · safe pentest lab

Is it a safe lab target?

Combine loopback and private checks for lab safety.

Challenge

Implement int lab_safe(int a, int b, int c, int d) returning 1 if the address is loopback (127.x) or private (10.x / 192.168.x / 172.16-31.x), else 0.

Starter code

int lab_safe(int a, int b, int c, int d) {
    /* TODO */
    return 0;
}

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