Lecture 1 - Introduction to Ethical Hacking
Week 1 Roadmap — What this lecture covers
- What ethical hacking is — The discipline, why organisations use it, and how it differs from malicious hacking.
- Scope & intent — Defined targets, approved methods, and the goals that make the work legitimate.
- Authorization & the law — Why written permission is the line between security work and a crime.
- Professional conduct — The ethical duties you carry as someone trusted with access.
- Rules of engagement & isolation — How we contain the work safely - and why we test in a lab, never in production.
- When boundaries break — Real scenarios, what goes wrong, and the lessons that keep you accountable.
Foundations — What is ethical hacking?
Definition
Ethical hacking is the authorized practice of probing systems for weaknesses using the same tools and techniques as an attacker — with permission, within agreed limits, to help the owner fix them before a real adversary finds them.
The ethical hacker ✅
- Works with written authorization
- Stays inside an agreed scope
- Aims to reduce risk for the owner
- Documents findings and reports them
- Avoids unnecessary damage
- Accountable to law and profession
The malicious attacker ❌
- Acts without any permission
- Ignores all limits and scope
- Aims for personal gain or harm
- Hides tracks; avoids detection
- Causes damage where convenient
- Commits a criminal offence
Think of it like a locksmith you hired vs. a burglar. Both know how to pick locks — the difference is entirely about who asked them to be there and what they do once they're inside.
The Business Case — Why organisations hire ethical hackers
Defenders have to be right every time. An attacker has to be right once. Organisations hire ethical hackers to find the gaps first - on their terms, not an adversary's.
- Find weaknesses first — Discover vulnerabilities before criminals do, while there's still time to fix them safely.
- Meet compliance — Many standards and regulations require regular penetration testing and assessment.
- Reduce breach cost — A test costs far less than an incident - data loss, downtime, fines, reputational damage.
- Validate defences — Confirm existing controls actually work under realistic attack, not just on paper.
- Protect customers — Safeguard the sensitive data of users, patients, and clients who trust the organisation.
- Inform decisions — Give leadership evidence-based intelligence to prioritise security investment.
🎯 What Makes It Legitimate — Scope and Intent
Two things separate a sanctioned engagement from an attack: a clearly bounded SCOPE (what you may touch) and a legitimate INTENT (why you're doing it).
SCOPE — the boundaries
- Defined targets & systems — Which hosts, apps, IP ranges, or accounts are in-bounds - and which are explicitly off-limits.
- Approved tools & techniques — Which methods are permitted; some tests forbid denial-of-service or social engineering.
- Time & access limits — When testing may run, and what level of access you start from.
INTENT — the purpose
- Identify vulnerabilities — Surface real, exploitable weaknesses - not to cause harm, but to expose risk.
- Improve security posture — Turn findings into concrete fixes that make the organisation measurably harder to attack.
- Support risk management — Give stakeholders evidence to prioritise, budget, and defend.
Analogy Scope is like the
fence around a construction site — it tells you exactly where you're allowed to dig. Intent is like the building permit — it tells you why digging there is legal in the first place. You need both.
The Line You Must Not Cross — Authorization and Legal Responsibility
Related
Key Principle
Written authorization is what separates security testing from a crime. The identical action - scanning a server, exploiting a flaw - is lawful with permission and a criminal offence without it.
| WITH written authorization | WITHOUT authorization | |
|---|---|---|
| Status | Legitimate security work | A criminal offence |
| Nature | Protected activity · billable engagement · a service to the client | Computer-misuse & cybercrime law · prosecution · academic expulsion |
Same action. Opposite outcome. The only variable is permission.
Proper authorization is explicit and in writing — it names:
- Signed permission — From someone with authority to grant it
- Defined scope — Exact systems and boundaries
- Rules of engagement — What's allowed and prohibited
- Liability terms — Legal protection for both sides
Think of it like a doctor performing surgery. Cutting someone open is assault — unless there's informed consent, a licensed practitioner, and a clearly defined procedure. The scalpel doesn't change; the paperwork does.
🤝 The Duty of Trust — Professional Conduct and Ethical Responsibility
Authorization makes the work legal. Professional conduct makes you trustworthy. You are handed deep access to systems and sensitive data - how you handle that defines your career.
- Act ethically and responsibly — Exercise judgement beyond the letter of the contract. Just because you can do something doesn't mean you should. When unsure, ask before you act.
- Maintain confidentiality — Findings, client data, and vulnerabilities you discover are secrets held in trust. Never disclose them outside the agreed channel.
- Protect sensitive information — Minimise what you touch, secure what you collect, and destroy it when the engagement ends.
- Follow laws & standards — Comply with the law, institutional policy, and professional codes of conduct. Ignorance is not a defence.
🥷 The Unit's Positioning — Offensive Security in a Professional Context
This unit trains you as an ethical offensive operator - someone who thinks like an attacker to produce intelligence a defender can act on. Offence, in service of defence.
- Adversarial mindset — See systems as an attacker does - question assumptions, chase edge cases, find the unlocked door everyone passed.
- Responsible exploitation — Prove impact through controlled exploitation, then stop. Show the risk without becoming the disaster.
- Real-world pen-test mindset — Operate the way professional engagements do - methodical, scoped, evidence-driven.
- Actionable intelligence — Translate technical findings into clear, prioritised guidance stakeholders can use.
📝 Prove Impact, Then Report — Responsible Exploitation and Reporting
Responsible exploitation
The golden rule
Exploit only to prove impact — then stop.
- Prove, don't plunder — Demonstrate the vulnerability is real, then withdraw - don't rummage further than needed.
- No persistence — Never plant backdoors or maintain access beyond what's authorized.
- Avoid unnecessary damage — Every action risks the client's real systems - do the minimum to prove the point.
Clear, accurate reporting
The report is the product — breaking in is just how you earn the evidence.
- Clear — A finding nobody understands gets ignored. Write to be understood.
- Accurate — Don't overstate or understate risk - both cost you credibility or leave people exposed.
- Evidence-based — Back every claim with proof: screenshots, logs, reproducible steps.
- For stakeholders — Executives need business risk; engineers need technical detail to fix it.
Analogy Exploiting a vuln is like a
fire drill, not an actual fire. You demonstrate that the building would burn if a real fire started — you don't actually torch the place to prove your point.
📜 The Contract for Conduct — Rules of Engagement (RoE)
The rules of engagement are the agreed contract defining exactly what is allowed and prohibited during a test. Authorization says "yes, you may test." The RoE says "here is exactly how."
- Approved targets & techniques — The specific systems you may attack and the exact methods you may use.
- Time, access & data limits — When you may test, what access you start with, and what you may do with data you find.
- Protects both parties — A clear, documented boundary that shields the client from harm - and you from liability.
Why this protects YOU Operate strictly within the RoE and you have an agreed, documented boundary. If a system fails while you were acting inside the rules, you're covered — you did exactly what was authorized. Step outside it, and that protection vanishes instantly.
🖥️ Test in a Sandbox, Never in Production — Safe Experimentation and VM Isolation
Related
We practise in isolated lab environments - never on production systems, never on anything you don't own. Virtual machines give you a sandbox you can break, and reset in seconds.
Setup:
- Your host computer stays safe, untouched
- Inside an isolated virtual lab (walled off from host):
- Kali Linux attack VM → attacks →
- Target Windows VM
- (attacks stay inside the isolated lab)
Why isolate:
- No testing on production — Never practise on live, real-world systems - the risk of real damage is unacceptable.
- Prevent accidental spread — Isolation stops malware or exploits escaping into your real network.
- Safe failure, easy reset — Snapshots let you break everything, then roll back to a clean state in seconds.
Like practicing surgery on a cadaver or simulator, not a live patient. Mistakes are free lessons, not tragedies — as long as you stay inside the sandbox.
⚠️ Put It Into Practice — When Ethical Boundaries Break
Three short scenarios. As each appears, ask yourself: what rule broke, who's affected, and what should have happened instead?
Scenario 1 — Unauthorized network scanning
- Someone runs a scan against systems that were never in their approved scope.
Scenario 2 — Payload delivery to real users
- Live malicious payloads are sent to actual people instead of controlled test accounts.
Scenario 3 — Accessing data beyond scope
- Real, confidential data is reached that the engagement never authorized touching.
🧭 A Framework for Grey Areas — Scenario Analysis: What Could Go Wrong?
Apply these four questions to any situation where a boundary might have been crossed. This is how a professional reasons through a grey area in the moment.
- What rules were violated? — Name it specifically - scope, authorization, or a particular clause in the rules of engagement.
- Who or what is affected? — Trace the blast radius: whose systems were touched, whose data exposed, which real people impacted.
- What are the consequences? — Think on every axis - legal (prosecution), technical (breakage, leaks), and professional (reputation, jobs, a place on the course).
- How should it be handled? — The constructive question. Usually: stay in scope, get authorization first, stop and ask when unclear, escalate rather than improvise.
🔑 The Moral Spine of the Unit — Key Lessons from the Scenarios
- Authorization defines legitimacy — Not your skill, not your intentions - authorization is what makes an action legitimate. Everything begins there.
- Intent does not override impact — You may have meant well. If your action caused harm or broke a boundary, good intentions don't erase it. Own your impact.
- Scope limits protect everyone — Boundaries protect the client from damage and protect you from liability. Staying in scope is how everyone stays safe.
- Offensive operators are accountable — Powerful capabilities carry real responsibility - to your client, the law, your profession, and the people you affect.
Adversary Threat Models
Related
- Cyber Kill Chain — High level, linear overview
- MITRE ATT&CK — Much lower level of detail
Source: https://www.lockheedmartin.com/en-us/capabilities/cyber/cyber-kill-chain.html
The 7 stages of the Cyber Kill Chain (linear model):
- Reconnaissance — Harvesting email addresses, conference information, etc.
- Weaponization — Coupling exploit with backdoor into deliverable payload.
- Delivery — Delivering weaponized bundle to the victim via email, web, USB, etc.
- Exploitation — Exploiting a vulnerability to execute code on victim's system.
- Installation — Installing malware on the asset.
- Command & Control (C2) — Command channel for remote manipulation of victim.
- Actions on Objectives — With 'Hands on Keyboard' access, intruders accomplish their original goals.
Analogy The Kill Chain is like a
burglary in sequence: scope the house (recon) → make the tools (weaponize) → get in through the door (delivery) → pick the lock (exploit) → set up camp inside (install) → keep a walkie-talkie to your getaway driver (C2) → actually steal the goods (actions on objectives). Break any single link and the whole chain fails — this is the core defensive insight behind the model.
Source: https://attack.mitre.org/
Unlike the Kill Chain's 7 linear stages, ATT&CK breaks attacker behaviour into much more granular tactics (columns), each containing many specific techniques (cells), including (partial list visible in the matrix):
- Reconnaissance (11 techniques)
- Resource Development (8 techniques)
- Initial Access (11 techniques)
- Execution (17 techniques)
- Persistence (23 techniques)
- Privilege Escalation (14 techniques)
- Defense Evasion (47 techniques)
- Credential Access (17 techniques)
- Discovery (34 techniques)
- Lateral Movement (9 techniques)
- Collection (17 techniques)
- Command and Control (18 techniques)
- Exfiltration (9 techniques)
- Impact (15 techniques)
Analogy If the Kill Chain is a
movie plot summary (beginning, middle, end), ATT&CK is the detailed script with every line of dialogue — a huge reference library of specific real-world techniques mapped to each phase, used by defenders to check "have we covered this exact technique?"
🖐️ Now — Hands On: Start Your VMs
- Begin the first practical exercises - set up your Kali and Windows environments and get comfortable with the basic tooling.
One habit above all
If you're ever unsure whether something is in bounds — ask first.
Linked from
- Lecture 3 - Laws Related to Technology & Technology Related to Law
- Lecture 7 - Computer & Cyber Crime (Part I)
- Lecture 8 - Computer & Cyber Crime (Part II)
- Chapter 1 - Introduction to Software Engineering
- Chapter 1 - Introduction to Cloud Computing
- Chapter 2 - Virtualization I
- Chapter 10 - Operating System Security
- Chapter 13 - Intrusion Detection System (IDS)
- Lecture 1 - Introduction to Cyber Crime
- Lecture 11 - Ethical Hacking - Vulnerability Assessment (VA) and Penetration Test (Pentest)
- Lecture 12 - Penetration Testing with Metasploit
- Lecture 2 - MiTB Attack and Trojan Horse
- Kali-OVA-on-Apple-Silicon
- Lecture 2
- Lecture 3