cybersecurity · beginner · ~15 min · safe pentest lab
Spot the userinfo-confusion trick.
Spot the userinfo-confusion trick where an @ hides the real host (https://trusted.com@evil.tld actually goes to evil.tld).
Implement int has_at_sign(const char *url) that returns 1 if url contains an @, else 0.
url: a NUL-terminated URL string the grader passes.Returns int: 1 if url contains @, else 0.
has_at_sign("https://paypal.com@evil.tld") -> 1
has_at_sign("https://example.com") -> 0
@ anywhere in the string counts.A NUL-terminated URL string url.
An int: 1 if url contains @, else 0.
Static string only — no network.
#include <string.h>
int has_at_sign(const char *url) {
/* TODO */
return 0;
}
Solve this exercise in the browser editor — compile and run against the test harness, no setup required.