Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.
Shade in the A or B circle for each question.
Draw a line connecting each item on the left to its match on the right.
| Left column | Right column | |
|---|---|---|
| 1password = "admin123" # default login | AAny program can have vulnerabilities. Though more code usually means more places for bugs, even small apps have flaws. | |
| 2for i in range(11): items[i] = 0 | BA coding mistake: the loop writes past the end of a 10-item list, which is a bug an attacker might exploit | |
| 3A software vulnerability can be a flaw in a program's settings, not just its code | CA vulnerability is the weakness (a bug or bad setting). The attack is what happens when someone uses it. | |
| 4A coding mistake is a vulnerability when the program trusts input it never checked | Dallow_guest_access = True # default | |
| 5Thinking: "Only big programs have vulnerabilities, so my small app is safe." | Equery = "SELECT * FROM users WHERE name='" + name + "'" | |
| 6Thinking: "A vulnerability is the attack itself, such as a hacker stealing data." | FAn insecure default setting: a well-known password left in place that attackers can easily guess |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
software vulnerability — A flaw or bug in a program's code or settings, such as a coding mistake or an insecure default, that an attacker could use to get access or cause damage.debug = False # off on live sitesif len(name) <= 20:
print(name)bugs = lines * ratepassword = "admin"
if password == "admin":
print("Change the default!")newpass = input("Set a new one: ")