Cyber security · GCSE · OCR J277 1.4.1, AQA 8525 3.6.2, Edexcel 1CP2 5.3.1 · about 15 min
Phishing, pharming, shouldering and blagging, and a filter that flags them.
[1 mark]What is social engineering?
[1 mark]What is phishing?
[1 mark]What is shouldering?
[1 mark]Which is a warning sign of a phishing email?
[1 mark]Someone rings claiming to be from IT and asks for your password. What is this?
Write score_message(message), which returns how many of the warning_signs appear in the message (ignoring capital letters). For each message in inbox, print <subject>: <score> and then, on the same line, PHISHING if the score is 2 or more. At the end print flagged <n> of <total>.
# the two lines every program starts with: the commands, then the robot
from bugbot import *
connect()
warning_signs = ["urgent", "password", "click here", "you have won", "verify", "gift card"]
inbox = [
("Lunch tomorrow?", "Are you free for lunch tomorrow?"),
("Account alert", "URGENT: verify your password by click here now"),
("You have won", "You have won a gift card, click here to claim"),
("Homework", "Here is the homework for Friday"),
]The hint students can ask for: Write the scoring function so it counts how many warning signs appear in the message, ignoring capitals. Then print each subject with its score, marking the ones that reach the threshold, and count how many you marked.
from bugbot import *
connect()
warning_signs = ["urgent", "password", "click here", "you have won", "verify", "gift card"]
inbox = [
("Lunch tomorrow?", "Are you free for lunch tomorrow?"),
("Account alert", "URGENT: verify your password by click here now"),
("You have won", "You have won a gift card, click here to claim"),
("Homework", "Here is the homework for Friday"),
]
def score_message(message):
return sum(1 for sign in warning_signs if sign in message.lower())
flagged = 0
for subject, body in inbox:
s = score_message(body)
if s >= 2:
print(f"{subject}: {s} PHISHING")
flagged = flagged + 1
else:
print(f"{subject}: {s}")
print(f"flagged {flagged} of {len(inbox)}")
Any program that meets the task's checks is marked correct in the simulator; this is one way, not the only way.