Exploit

Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.

Exploit

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. Which statement describes an exploit?
A A flaw in software that has not been fixed
B A method or code that takes advantage of a vulnerability
2. A web form does not check what users type in. An attacker enters crafted SQL to read the database. What is the crafted SQL?
A The vulnerability
B The exploit
3. In the same web form scenario, what is the lack of input validation?
A The vulnerability
B The exploit
4. True or false: an exploit can exist and still do nothing if the system has no matching vulnerability.
A True
B False
5. Which is the better description of the relationship between the two terms?
A The vulnerability is the open window and the exploit is the way of climbing through it
B The exploit is the open window and the vulnerability is the way of climbing through it

Match the Pairs

Draw a line connecting each item on the left to its match on the right.

Left columnRight column
1exploit Avulnerability = True exploit = None
2vulnerability BA flaw or weakness in a system that an exploit could take advantage of
3An attacker uses a tool to take advantage of a weakness in a login page CA method or piece of code that takes advantage of a vulnerability to attack a system
4A weakness exists but no attack tool has been written for it yet Dexploit(vulnerability)
5The exploit is the flaw in the software that lets attackers in. EThis mixes up the terms. The flaw is the vulnerability, while the exploit is the method or code that uses the flaw.
6Patching the software removes the exploit from the attacker's computer. FPatching fixes the vulnerability in the software. The attacker may still hold the exploit, but it no longer works against the patched system.

Definitions

exploit

Fill in the Blanks

Complete each line of code by filling in the missing parts.

1.
vulnerability = "unvalidated input" _______ = "crafted SQL string"
2.
_____________ = "default admin password" exploit = "log in with admin/admin"
3.
vulnerable = TRUE hasTool = TRUE attack = vulnerable ___ hasTool
4.
IF vulnerable THEN _______(system)
5.
_____(system) vulnerable = FALSE attack = FALSE

Spot the Error

Shade in the letter of the line that contains an error.

Question 1
A vuln = "unpatched flaw"
B vuln = "attack script"
C print(exploit, "hits", vuln)
Question 2
A def can_exploit(patched):
B # a patch removes the flaw
C return not patched
D return patched
Question 3
A vuln == "weak password rule"
B exploit = "guessing script"
C print(vuln, "is the weakness")
Question 4
A weakness = "unvalidated input"
B exploit = "unvalidated input"
C print("Exploit:", exploit)
Question 5
A if vuln or exploit:
B print("Attack works")
C else:
D print("Attack fails")

Answer Key

Exploit
Section A: Quick Questions
Q1
B — A method or code that takes advantage of a vulnerability
Q2
B — The exploit
Q3
A — The vulnerability
Q4
A — True
Q5
A — The vulnerability is the open window and the exploit is the way of climbing through it
Section B: Match the Pairs
Q1
exploit → A method or piece of code that takes advantage of a vulnerability to attack a system
Q2
vulnerability → A flaw or weakness in a system that an exploit could take advantage of
Q3
An attacker uses a tool to take advantage of a weakness in a login page → exploit(vulnerability)
Q4
A weakness exists but no attack tool has been written for it yet → vulnerability = True exploit = None
Q5
The exploit is the flaw in the software that lets attackers in. → This mixes up the terms. The flaw is the vulnerability, while the exploit is the method or code that uses the flaw.
Q6
Patching the software removes the exploit from the attacker's computer. → Patching fixes the vulnerability in the software. The attacker may still hold the exploit, but it no longer works against the patched system.
Section C: Definitions
Q1
exploit — A method or piece of code that takes advantage of a vulnerability (the weakness) to attack a system. The vulnerability is the flaw; the exploit is the tool that uses it.
Section D: Fill in the Blanks
Q1
vulnerability = "unvalidated input" exploit = "crafted SQL string"
Q2
vulnerability = "default admin password" exploit = "log in with admin/admin"
Q3
vulnerable = TRUE hasTool = TRUE attack = vulnerable AND hasTool
Q4
IF vulnerable THEN exploit(system)
Q5
patch(system) vulnerable = FALSE attack = FALSE
Section E: Spot the Error
Q1
B — A vulnerability is a weakness, not a tool. 'attack script' describes an exploit. The line should describe a flaw, such as vuln = "unpatched flaw".
Q2
D — This is line 3 of the program in the array, but the broken line is the return statement. An exploit only works while the flaw is still unpatched, so the function should return not patched.
Q3
A — == compares values; it does not assign. The variable vuln is never created, so the later print fails. Assignment needs a single =.
Q4
B — Unvalidated input is the weakness (the vulnerability). The exploit is the tool or method that takes advantage of it, such as SQL injection.
Q5
A — An attack needs both a vulnerability and an exploit that uses it. With 'or', an exploit with no flaw to target, or a flaw with no exploit, would wrongly succeed. It should be 'and'.