← WA Computer Science ATAR Unit 2

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.

Understanding Exploit in WA Computer Science ATAR Unit 2

What it does: The exploit is the tool and the vulnerability is its target, so the code shows the exploit acting on the weakness. A vulnerability can exist without an exploit. The risk grows once an exploit is created for it. The missing input validation is the vulnerability. The crafted SQL is the exploit that takes advantage of it. Patching removes the weakness. The attacker still has the exploit, but it has nothing to take advantage of.

Common mistakes: A vulnerability is a weakness, not a tool. 'attack script' describes an exploit. The line should describe a flaw, such as vuln = "unpatched flaw". 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.

Class: _____________________  ·  Name: _____________________  ·  Date: _________

Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.

This module's key terms are also in a printable crossword (Modules 125–266) and word search (Modules 28–266).

Take this worksheet further — free with Cloodit

Each concept is reinforced from every angle — learned, then applied, then tested.

Learning
Duo
Which statement describes an exploit?
A flaw in software that has not been fixedA method or code that takes advantage of a vulnerability
Matches
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.
Applying
Meanings
Term
exploit
Meaning
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.
Practice
vulnerability ← "unpatched software"
Testing
Gaps
= "crafted SQL string"
Check Answer
Spots
1vuln = "unpatched flaw"
2vuln = "attack script"

Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.

The 'Golden Eagle' badge — High Flyer, one of Cloodit's 106 collectible badges
Students earn collectable badges

Over 100 of them, across seven natural biomes.

Study Buddy
Students build a real study resource

Turns their work into revision material ready for Flash Cards and Exam study.

Diamond Dash — one of Cloodit's live, competitive Sprint games
Students lock in with Sprints

Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.

A Cloodit certificate of achievement, ready to personalise and print
Custom printable certificates

Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.

Quick Questions

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 ✓
The flaw is the vulnerability. The exploit is the tool or method that uses that flaw to attack.
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 ✓
The missing input validation is the vulnerability. The crafted SQL is the exploit that takes advantage of it.
3. In the same web form scenario, what is the lack of input validation?
A. The vulnerability ✓
B. The exploit
A vulnerability is a weakness in a system. The exploit is what is used against that weakness.
4. True or false: an exploit can exist and still do nothing if the system has no matching vulnerability.
A. True ✓
B. False
An exploit needs a vulnerability to work. If the weakness has been patched, the exploit has nothing to take advantage of.
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
The weakness (vulnerability) is what is left open. The exploit is the method used to get in through it.

Match the Pairs

exploit → A method or piece of code that takes advantage of a vulnerability to attack a system
vulnerability → A flaw or weakness in a system that an exploit could take advantage of
An attacker uses a tool to take advantage of a weakness in a login page → exploit(vulnerability)
A weakness exists but no attack tool has been written for it yet → vulnerability = True exploit = None
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.
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.

Key Term

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.

Fill in the Blanks

1. vulnerability = "unvalidated input" exploit = "crafted SQL string"
Hint: Type the variable name for the tool or code that takes advantage of the weakness on the line above.
2. vulnerability = "default admin password" exploit = "log in with admin/admin"
Hint: Type the variable name for the flaw that the exploit on the next line targets.
3. vulnerable = TRUE hasTool = TRUE attack = vulnerable AND hasTool
Hint: Type the logical operator that needs both the weakness and the tool to be true for the attack to work.
4. IF vulnerable THEN exploit(system)
Hint: Type the name of the tool that is only used when a weakness is present.
5. patch(system) vulnerable = FALSE attack = FALSE
Hint: Type the function name for the action that fixes the flaw so the exploit no longer works.

Spot the Error

Question 1
A vuln = "unpatched flaw"
B vuln = "attack script"
C print(exploit, "hits", vuln)
Line 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".
Question 2
A def can_exploit(patched):
B # a patch removes the flaw
C return not patched
D return patched
Line 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.
Question 3
A vuln == "weak password rule"
B exploit = "guessing script"
C print(vuln, "is the weakness")
Line A — == compares values; it does not assign. The variable vuln is never created, so the later print fails. Assignment needs a single =.
Question 4
A weakness = "unvalidated input"
B exploit = "unvalidated input"
C print("Exploit:", exploit)
Line B — Unvalidated input is the weakness (the vulnerability). The exploit is the tool or method that takes advantage of it, such as SQL injection.
Question 5
A if vuln or exploit:
B print("Attack works")
C else:
D print("Attack fails")
Line 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'.

Student with a class code? Join your class →