The shell command to analyze
true if the command contains dangerous patterns, false otherwise
Parses a shell command string into individual sub-commands using a
quote-aware state-machine tokenizer. Respects single quotes, double
quotes, and backslash escapes. Splits on operators &&, ||, |&,
|, &, and ;, as well as newline characters outside quotes.
Collapses runs of whitespace outside quotes and strips meaningless
backslash escapes outside quotes (e.g. \h → h). Degrades
gracefully when quotes are unmatched.
The shell command to parse
Array of trimmed sub-commands with empty entries filtered out
Checks if a command contains dangerous patterns that could indicate bypass attacks. Detects: