cybersecurity · beginner · ~15 min · safe pentest lab

Are you authorized to test?

Encode the authorization precondition for any test.

Challenge

Implement int authorized(int has_written_permission, int target_in_scope) returning 1 only if BOTH conditions hold (written permission AND the target is in scope).

Starter code

int authorized(int has_written_permission, int target_in_scope) {
    /* TODO */
    return 0;
}

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