Complete the code to identify the type of attack shown in the network log.
if packet.payload.contains('[1]'): alert('Possible SQL injection detected')
The keyword SELECT is commonly used in SQL injection attacks to extract data.
Complete the code to block SQL injection attempts by filtering input containing {{BLANK_1}}.
def is_safe(input_string): return '[1]' not in input_string.upper()
Filtering out SELECT helps prevent common SQL injection attempts.
Fix the error in the network filter rule to detect SQL injection containing {{BLANK_1}}.
if '[1]' in packet.payload.lower(): log('SQL injection attempt')
The payload is converted to lowercase, so the keyword to check must be lowercase select.
Fill both blanks to create a network rule that detects SQL injection attempts with keywords and logical operators.
if '[1]' in packet.payload and '[2]' in packet.payload: alert('SQL injection detected')
SQL injection often uses SELECT with logical operator OR to manipulate queries.
Fill all three blanks to complete the network detection code for SQL injection using keyword, operator, and comment syntax.
if '[1]' in packet.payload and '[2]' in packet.payload and '[3]' in packet.payload: block(packet)
SQL injection payloads often include SELECT, the logical operator OR, and the comment syntax -- to ignore the rest of the query.