A penetration tester is enhancing a Python reconnaissance utility that iterates through each line of a web page response. The script must raise an alert whenever the substring "admin" appears anywhere in the line, even if additional text surrounds it. Which conditional statement meets this requirement?
Using the expression 'admin' in line returns True when the substring occurs anywhere in the string, so the alert fires on partial matches. Equality comparisons and prefix-only checks fail when extra characters are present, and the regular-expression example matches only the exact word.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What does partial matching mean in this context?
Open an interactive chat with Bash
How does ignoring other characters improve keyword detection?
Open an interactive chat with Bash
Why is checking the beginning of the line insufficient for keyword detection?