Lesson plan: Reading Application Logs

AP Cybersecurity · Unit 5 Securing Applications and Data · Topic 5.6 Detecting Attacks on Data and Applications · Practice set

At a glance

Suggested time
3 class periods (45 min)
Pacing
Last of three sets for Topic 5.6, and the last teaching set before the Unit 5 Performance Task and the Unit 5 Test. The CED gives Topic 5.6 seven class periods; this plan suggests 2 for Detective Controls for Data, 2 for Integrity Hashing and 3 for this set, since reading logs takes the longest. The split is this plan's suggestion; the CED sets only the topic's total. Day 3 ends with Part E of the CED's sample free-response question.
Before this set
Injection Attacks (how SQL injection and cross-site scripting work), Memory and Path Attacks (buffer overflows and directory traversal) and the Foundations lesson Web Applications, Databases, and Files (how a web application, its database and its files fit together). From Reading Authentication Logs, in Securing Devices: read each line against what is normal, and cite the line. Status codes: the lesson defines 200 (served) and 500 (the program failed). Problem 8 🔒, Problem 12 🔒 and Problem 14 🔒 also use 404 (not found), and the CED's sample questions use 400 (bad request) and 403 (forbidden), so put all five on the board at the start of Day 2.
Skills
3.D Detect and classify cyberattacks by analyzing digital evidence with and without the support of AI.

The one idea: Read each request for something you can point to: SQL symbols and capitalized control words, a script tag, ../ in a requested path or in a parameter that names a file, or a field far longer than that field normally holds. That sign names the attack. The stem says what normal looks like here, and the status code says only how the server answered, so a refused request is still an attempt.

Day by day

Day 1 · Symbols and tags45 min

Day 2 · Paths and lengths45 min

Day 3 · What a log proves, and the free-response question45 min

Differentiation

If students are struggling
Hand out the chart from Day 1 (attack, what to look for, where it shows up) and have students circle the matching characters in each line before they read the choices. Do Problem 5 🔒 and Problem 9 🔒 with a partner, and hold Problem 12 🔒 for homework.
Extension
Write a new table of four requests in the style of Problem 13 🔒, with a baseline in the stem and four choices, and trade with a partner who works it and explains the answer. Or write an eight-line log for a school website with one line for each attack and two ordinary lines that look suspicious, and trade with a partner.
Vocabulary support
status code, parameter, query string, GET and POST, SQL control words, Boolean condition, comment (--), script tag, ../ sequence, URL length, cookie length, total request length, indicator of compromise (IoC).

From the course framework

LO 5.6.E Apply detection techniques to identify and report indicators of application attacks by analyzing log files.

  • 5.6.E.1 SQL injection attacks can be detected by reviewing application and server logs of user input for SQL control words and symbols such as: A single or double quote character: ", '; Boolean conditions like OR 1=1; A double dash (which indicates a comment in SQL): --; SQL control words (always in capital letters) like WHERE, IN, FROM
  • 5.6.E.2 XSS attacks can be detected by reviewing user input for suspicious tags, particularly the <script>...</script> tag.
  • 5.6.E.3 For web applications, buffer overflows can be detected by checking the amount of data the user is sending to the web application in their request. The fields commonly checked are the URL length, cookie length, query string length, and total request length. Long strings in any of these fields can be an indicator of an attempted buffer overflow attack.
  • 5.6.E.4 Directory traversal attacks can be detected by reviewing application and server logs. HTTP GET requests that include paths with sequences of ../ are indicators of an adversary attempting a directory traversal.