Live lesson · progress saved to your account

Red Team & Ethical Hacking Basics

Learn how authorised attack simulation works, and the rules that keep it legal. Read a real-style rules-of-engagement document, see how red, blue and purple teams work together, follow a kill chain from recon to lateral movement mapped to MITRE ATT&CK, spot the Linux and Windows misconfigurations that let attackers climb to admin, and deliver a findings report the IT team can act on. Defence-first: every step ends with the control that breaks it.

advanced130 minwalkthrough

Anyone can read this lesson. To submit answers and earn XP, create a free account.

TASK 01Mission briefing: the Kaveri Textiles engagement

EMAIL · From: Meera Desai, IT Head, Kaveri Textiles (fictional), Surat · Monday 09:12 "Signed rules of engagement attached. Our team has built an isolated replica of the office network for you. Please test it as an attacker would, but only inside the scope, and tell us what to fix before the auditors arrive."

A real attacker and an ethical hacker may use similar techniques. The difference is permission. Before a single packet is sent, an ethical engagement needs paperwork:

Before the first packet: the authorisation gate 0/5 checked

Written authorisation

Signed by someone who owns the systems (Kaveri's MD), not just a friendly admin.

Scope

Exact hosts and ranges: the lab replica 10.10.20.0/24, Annex A hosts only.

Rules of engagement

Allowed and banned techniques, rate limits, data handling.

Testing window

Mon–Fri, 22:00–06:00 IST, so a mistake can't hurt the working day.

Emergency contact

Meera Desai, reachable 24×7, and a stop word to halt everything.

Checking the paperwork…

In India, the Information Technology Act, 2000 decides which side of the line you are on:

  • Section 43: accessing, downloading or damaging a computer system without the owner's permission makes you liable to pay compensation.
  • Section 66: doing any act in section 43 dishonestly or fraudulently is a criminal offence: up to 3 years in prison, a fine up to ₹5 lakh, or both.

"I was only testing" is not a defence. A signed authorisation, a clear scope and the rules of engagement are.

Answer the questions

+10 XP

+10 XP

+10 XP

+10 XP

+10 XP

TASK 02Hands-on: rules of engagement

The rules of engagement (RoE) turn "you may test us" into precise limits: which hosts, which techniques, which hours, who to call, and when to stop. Good testers read them twice and re-read them whenever something unexpected happens.

There are three possible answers to "can I do this?":

  • In scope: written in the RoE, go ahead.
  • Out of scope: not allowed, don't do it, however tempting.
  • Stop and ask: the RoE doesn't cover it, or something has gone wrong. Pause and call the emergency contact.
Lab · Kaveri rules of engagement: in, out, or stop and ask? decide each

RULES OF ENGAGEMENT · Kaveri Textiles (fictional) · signed by the MD

Scope: isolated lab replica 10.10.20.0/24, Annex A hosts only (.10 .15 .20 .30 .40)

Excluded: production 10.10.10.0/24, cloud ERP (SaaS vendor), staff (no social engineering)

Allowed: scanning, password guessing on listed lab accounts (≤5/min), privilege escalation, lateral movement in scope

Not allowed: denial of service, deleting or changing data, copying data off the network

Window: Mon–Fri 22:00–06:00 IST · Emergency contact: Meera Desai, 24×7

Stop rule: real personal data found, or anything stops working: pause and call

Service scan of 10.10.20.15 at 23:00 on Tuesday
Scan 10.10.10.5, the production ERP server, because it answers from the lab
Password guessing against the listed lab accounts at 3 attempts per minute
You open a lab share and find what look like real employee salary slips
Send a fake 'GST update' phishing email to the accounts team
Escalate to root on 10.10.20.30 through a sudo misconfiguration
10.10.20.99 answers but isn't in Annex A
Test at 14:00 on Wednesday because you're ahead of schedule
The lab file server stops responding right after your scan
Try logins on Kaveri's cloud ERP (SaaS) portal

Answer the questions

+10 XP

+10 XP

+10 XP

+30 XP

TASK 03Red, blue and purple teams

Security teams are often described by colour:

Red attacks, blue defends, purple makes both better 0/0 detected

Red team runs

Internal port scan

Default-password login

sudo misconfig abuse

Admin password reuse

Data staging on file server

Blue team sees

…

…

…

…

…

In a classic exercise, blue only learns what it missed when the report arrives weeks later.

  • Red team: plays the adversary. Goal-driven ("reach the payroll data") and usually quiet, to test whether the defenders notice.
  • Blue team: the defenders: SOC, incident response, IT and the controls they run.
  • Purple team: not a separate team so much as a way of working: red and blue sit together, run a technique, check whether it was detected, tune the detection and repeat.

VAPT vs red teaming. A vulnerability assessment and penetration test tries to find as many weaknesses as possible in a defined scope, usually with the defenders aware. A red-team exercise emulates a specific adversary chasing a goal, and measures detection and response as much as vulnerabilities. Most Indian organisations start with VAPT (often required by regulators such as RBI and SEBI, and by CERT-In empanelled auditors) and add red teaming as they mature.

Answer the questions

+10 XP

+10 XP

+10 XP

+10 XP

TASK 04The kill chain in practice

An attack is not one hack; it is a chain of steps, and every link is a chance to stop it. Watch how the Kaveri engagement unfolds across the lab network, with each step mapped to a MITRE ATT&CK tactic and to the detection that should have fired:

The Kaveri engagement, step by step (lab network only) Reconnaissance · TA0043

Target: 10.10.20.0/24

Red: Ping sweep and service scan from the foothold laptop

Should detect: IDS: one host touching 200 ports on 40 hosts

Recon is where it starts. From an internal foothold, testers map which hosts are alive and which services they expose. Most real compromises begin with something boring: a default password, an old service, a share open to everyone.

Recon: from a range of addresses to a list of weak spots 1/5 hosts mapped

10.10.20.10

Domain controller

10.10.20.15

Accounts PC

10.10.20.20

File server

10.10.20.30

Linux app server

10.10.20.40

Office printer

No zero-days needed. Defenders can run the same inventory every month and close these before a tester, or an attacker, finds them.

ATT&CK tactic IDs used in this room:

TacticID
ReconnaissanceTA0043
Initial AccessTA0001
Privilege EscalationTA0004
Lateral MovementTA0008

Answer the questions

+10 XP

+10 XP

+10 XP

+10 XP

TASK 05Hands-on: order the chain, break the chain

Put the five stages of the Kaveri engagement in order, then choose the defensive control that would have broken each one. Defenders only need to break one link, but the earlier the better.

Lab · Order the Kaveri kill chain, then break each link order + control
Moved to the file server with the same local admin password
Mapped live hosts and open services on 10.10.20.0/24
Delivered findings with evidence and fixes
Logged in to the printer admin panel with the factory password
Became root through ravi's NOPASSWD sudo rule

Answer the questions

+10 XP

+10 XP

+30 XP

TASK 06Privilege escalation: Linux and Windows misconfigurations

Initial access usually lands as an ordinary user. Privilege escalation is the climb to root (Linux) or SYSTEM/Administrator (Windows), and it almost always comes from a misconfiguration, not a clever exploit.

Privilege escalation ladder: one bad sudo rule climbing
Shell as ravi Standard user from the initial foothold
Checks own sudo rights sudo -l lists: (root) NOPASSWD: /usr/bin/vim
Editor runs as root An editor can launch a shell, and that shell inherits root
root Full control of the app server

Review rules against GTFOBins: if a binary is listed there with a "sudo" entry, a sudo rule for it hands out root.

Linux, the usual suspects:

  • sudo rules in /etc/sudoers (always edit with visudo). A rule letting a user run an editor, pager or interpreter as root, especially with NOPASSWD, effectively gives them root, because those programs can start a shell. The public GTFOBins project lists which Unix binaries can be abused this way, so defenders use it to review their rules.
  • SUID binaries: the SUID bit (octal 4000) makes a program run with its owner's privileges. Expected on passwd and sudo; dangerous on general tools.
  • Writable scripts run by root (cron jobs, backup scripts) and world-writable system files.
Reading SUID: the s that runs a program as its owner expected
-rwsr-xr-x

owner · group · others · s = SUID (octal 4000)

Windows, the usual suspects:

Windows: four misconfigurations that lead to SYSTEM Unquoted service path

Seen: C:\Program Files\Kaveri Sync\sync agent.exe (runs as LocalSystem)

Risk: Windows tries C:\Program.exe and C:\Program Files\Kaveri.exe first; a writable folder lets someone plant one.

Fix: Quote the path in the service config and keep install folders admin-writable only.

Answer the questions

+10 XP

+10 XP

+10 XP

+10 XP

+10 XP

+10 XP

TASK 07Hands-on: spot the misconfiguration

Here is a static listing collected from the Kaveri lab hosts: sudo rules, SUID files, permissions and Windows configuration. For each entry decide whether it's fine as it is or choose the fix it needs. No exploitation needed: a reviewer who can read a listing like this stops attackers before they start.

Lab · Kaveri configuration review: fine, or fix? judge each entry
# /etc/sudoers

root ALL=(ALL:ALL) ALL

# /etc/sudoers

ravi ALL=(root) NOPASSWD: /usr/bin/vim

# /etc/sudoers

backup ALL=(root) NOPASSWD: /opt/scripts/backup.sh

# ls -l /opt/scripts

-rwxrwxrwx 1 root root 812 backup.sh

# SUID listing

-rwsr-xr-x 1 root root /usr/bin/passwd

# SUID listing

-rwsr-xr-x 1 root root /usr/bin/find

# ls -l /etc

-rw-rw-rw- 1 root root 2451 passwd

# ls -l /etc

-rw-r----- 1 root shadow 1320 shadow

# Windows service

KaveriSync C:\Program Files\Kaveri Sync\sync agent.exe (LocalSystem)

# Windows file

C:\Windows\Panther\unattend.xml <AdministratorPassword>S2F2ZXJp…

Answer the questions

+10 XP

+10 XP

+10 XP

+30 XP

TASK 08Lateral movement and evidence

With admin rights on one machine, attackers look for a way to the next. The most common path in Indian SMB networks is painfully simple: the same local administrator password on every PC, set once by whoever imaged the machines.

Lateral movement: one reused password, five machines 1/5 reached
Accounts PC
HR PC
File server
Backup server
Domain controller

The tester only cracked one PC. The rest fell because the imaging team reused one password.

Defences that break lateral movement:

  • Windows LAPS (Local Administrator Password Solution): a unique, rotated local admin password per machine.
  • Network segmentation: workstations shouldn't reach servers' admin ports.
  • Tiered admin accounts: domain admins never log in to ordinary workstations.
  • Detection: alert on one account logging in to many hosts in minutes.

As you go, collect evidence: timestamped output showing the host, account and what you could reach, with passwords and personal data redacted. Never copy real data off the network to "prove" impact; a screenshot of a directory listing proves access.

Answer the questions

+10 XP

+10 XP

+10 XP

TASK 09Final mission: the findings report

The report is the product. Meera's team needs to know what to fix first, and her managing director needs one paragraph that explains the risk without jargon.

A findings report, assembled Executive summary

Executive summary One page, no jargon: overall risk, top 3 fixes, business impact. → MD and board

Scope & method What was tested, when, under which RoE, and what wasn't. → Auditors

Attack narrative The chain from foothold to file server, as a story. → IT head

Findings Each with severity, evidence (redacted), affected hosts and remediation. → Sysadmins

Remediation plan & retest Owners, deadlines and the date testers will verify the fixes. → Everyone

Kaveri findings

High
Medium
Low

Severity drives the order of the fix list.

Build the Kaveri report: rate each finding, choose the remediation, and pick the evidence approach and executive summary. Deliver it for the Operator badge.

Final mission · Build the Kaveri findings report rate, fix, summarise

Part A · Findings

F1. Same local administrator password on every Windows machine (All 4 Windows hosts)

F2. NOPASSWD sudo rule for vim lets user ravi become root (10.10.20.30)

F3. Office printer admin panel uses the factory default password (10.10.20.40)

F4. SSH banner reveals the exact OpenSSH version (10.10.20.30)

Part B · Evidence approach

Part C · Executive summary (for the MD)

Answer the questions

+10 XP

+10 XP

+10 XP

+30 XP