cybersecurity · beginner · ~10 min · safe pentest lab
Case-insensitive marker detection in a log line.
int has_jndi_marker(const char *line);
Return 1 if line contains the (case-insensitive) literal ${jndi:,
otherwise 0 (NULL → 0).
(Heavily obfuscated variants like ${${::-j}ndi: are harder and out of scope —
this catches the common literal form. The lesson covers why obfuscation makes
substring detection insufficient on its own.)
${jndi:.The Log4Shell signature ${jndi: in a log line is a high-signal indicator of an exploitation attempt. A detector flags it for review.
int has_jndi_marker(const char *line) {
/* TODO */
(void)line;
return 0;
}
Case-sensitive matching (misses ${JNDI:). Matching bare 'jndi'. Forgetting NULL.
Mixed case. Other ${...} lookups (env, sys) must not match.
O(n×len(needle)).
Solve this exercise in the browser editor — compile and run against the test harness, no setup required.