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
- Open (5 min)Project the lesson's opening log (eight lines of the bookstore's web server log) before any reading. Pairs mark each line shopper or not and say why. Collect the marks and come back to each line as the lesson reaches it.
- Mini-lesson (15 min)Teach Reading Application Logs, from the top through the box "Spotting cross site scripting", stopping before "Directory traversal". Students start a chart that lasts the whole set: the attack, what to look for, and where it shows up (a URL parameter or a form field). At the gift note paragraph, ask why a POST request's text never reaches the server log.
- Do together (10 min)Problem 1 🔒 Problem 2 🔒 🔒 Teacher notes: sign in as a teacher to see this🔒 Teacher notes: open the full plan to see this
- On their own (10 min)Problem 5 🔒: every SQL injection line among the requests · Problem 6 🔒: why one markup tag is reported and another is not.
- Exit check (5 min)🔒 Teacher notes: sign in as a teacher to see this🔒 Teacher notes: open the full plan to see this
Day 2 · Paths and lengths45 min
- Open (5 min)Go back to the lesson's opening log. Two lines from 198.51.100.83 are still unexplained, the fourth and the seventh. Ask pairs what is odd about each before the reading. List the five status codes on the board: 200, 400, 403, 404, and 500.
- Mini-lesson (15 min)Teach Reading Application Logs, "Directory traversal" and "Buffer overflow attempts", stopping before "Code Red, 2001". At the lesson's question ("What gives that line away?"), pairs answer before the next paragraph. Students add both attacks to the chart, and for buffer overflows they list the fields the box measures: the URL, the cookie, the query string, and the request as a whole.
- Do together (10 min)Problem 4 🔒 Problem 3 🔒 🔒 Teacher notes: sign in as a teacher to see this🔒 Teacher notes: open the full plan to see this
- On their own (10 min)Problem 7 🔒: which field holds an id thousands of characters long · Problem 9 🔒: every long request, with a campaign link among them · Problem 8 🔒: which traversal reached a file.
- Discuss (5 min)Problem 8 🔒 Problem 7 🔒 Problem 3 🔒 Problem 9 🔒 🔒 Teacher notes: sign in as a teacher to see this🔒 Teacher notes: open the full plan to see this
Day 3 · What a log proves, and the free-response question45 min
- Mini-lesson (10 min)Teach Reading Application Logs, "Code Red, 2001". Stop at the CERT advisory's request and its question ("which indicator does it carry, and what does finding it in a log prove?"). Pairs write an answer before the next paragraph, then read on to see what else a defender would need: the status code and a check of the server's own software.
- Do together (10 min)Problem 13 🔒 Problem 14 🔒 🔒 Teacher notes: sign in as a teacher to see this🔒 Teacher notes: open the full plan to see this
- On their own (10 min)Problem 10 🔒 Problem 11 🔒: name the attack from a mixed log, now with all four signs on the chart · Problem 12 🔒: a review rule that reports exactly two requests. Students who finish write the rule a reviewer would use for each of the other three attacks.
- Groups (15 min)🔒 Teacher notes: sign in as a teacher to see this🔒 Teacher notes: open the full plan to see this
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).
🔒 Answer keyEvery problem's answer, the concept and essential knowledge it checks, and the trap it targets.Sign in as a teacher to see this🔒 Traps this set testsWhat each common wrong answer looks like, and one line to say when you see it.Sign in as a teacher to see this🔒 What to emphasizeThe points that decide the set's problems.Sign in as a teacher to see this🔒 Questions to ask aloudQuestions for the class discussion, with what to listen for.Sign in as a teacher to see this🔒 On the examHow the set's ideas appear on the AP exam, from the course framework.Sign in as a teacher to see this🔒 Your class so farLive results for your section: the problems a third or more missed on the first try, the most common wrong answer, and what it usually means.Sign in as a teacher to see this
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.