cybersecurity · beginner · ~15 min · safe pentest lab
Group tools by purpose.
Map a tool name to the engagement phase it belongs to.
Implement int tool_category(const char *name) that returns a category code for name.
Categories:
1 = recon: nmap2 = password attacks: hydra, john3 = sniffing: wireshark0 = any other namename: a NUL-terminated tool name the grader passes.Returns int: the category code (0..3).
tool_category("nmap") -> 1
tool_category("hydra") -> 2
tool_category("wireshark") -> 3
tool_category("burpsuite") -> 0 (not categorised here)
A NUL-terminated tool name name.
An int category: 1=recon, 2=password, 3=sniffing, 0=other.
nmap->1; hydra/john->2; wireshark->3; otherwise 0.
#include <string.h>
int tool_category(const char *name) {
/* TODO */
return 0;
}
Solve this exercise in the browser editor — compile and run against the test harness, no setup required.