cybersecurity · intermediate · ~15 min · safe pentest lab

Suspicious request path?

Flag traversal indicators in a path.

Challenge

Implement int is_suspicious_path(const char *path) returning 1 if it contains "../" (traversal) or "etc/passwd", else 0.

Starter code

#include <string.h>

int is_suspicious_path(const char *path) {
    /* TODO */
    return 0;
}

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