Ravindra BagaleCourses & study guides मराठी Track your progress

18. Ethics, the Law and a Safe Kali Lab

Chala mitrano, aaj to divas aala jyachi tumhi vaat baghat hota – Kali Linux! Pan thamba. Aadhi ek goshta doktyat pakki basava lagel: hacking tools he shastra aahet, aani shastra kasa vaparaycha he kayda aani ethics tharavtat. Ekach tool ne ek ethical hacker company la vachavto aani dusra tyach tool ne turungat jato – farak fakt permission cha aani hetu cha. Aaj aapan aadhi kayda (IT Act 2000) samju, mag ek surakshit lab banvu jithe tumhi manasokt sarav karu shakta – konalahi tras na deta, kayda na modta. Ghabru naka, pan he chapter halkyat gheu naka. He purna Part 10 aani 11 cha paaya aahe.

What you will learn in this chapter

  • The one rule of ethical hacking: written permission and defined scope
  • Key sections of the Information Technology Act, 2000 (verify every number yourself)
  • Where to report cyber crime in India (cybercrime.gov.in, helpline 1930, CERT-In)
  • Building a safe, isolated lab: Kali, Metasploitable 2, DVWA, Juice Shop on a host-only network
  • Kali Linux basics: what it is, how to update it, and how to stay organised
  • A pre-engagement checklist you will use before every lab

Concepts in this chapter

  1. 18.1The One Rule: Permission and Scope
  2. 18.2Indian Cyber Law: The IT Act, 2000 (Verify Every Number)
  3. 18.3Reporting Cyber Crime in India
  4. 18.4Building a Safe, Isolated Lab
  5. 18.5Kali Linux Basics
  6. 18.6The Pre-Engagement Checklist
  7. 18.7Red vs Blue, Project and Real Incidents

The chapter recap is at the end of the last concept page.

Chapter 18: Ethics, law and a safe Kali lab — practice tasks

Open chapter lessons · Full guided lab: virtualbox isolated lab host only (not repeated here)

18.1 Legal or not? (paper)

EasyIT

Why: Good intent is not permission.

What: Mark each scenario Legal or Illegal.

Data file: scenarios.csv

Scenario
Scan your own VM
Scan your college website to 'help'
TryHackMe free room
Test a friend's shop app without written OK

About this file: Made-up scenarios. Each row is one situation to judge.

How:

  1. Read each row.
  2. Ask: written permission from the owner?

Expected output: Rows 1 and 3 Legal; 2 and 4 Illegal.

Hint

Indian IT Act sections 43/66 apply without permission.

Answer / how to check
  1. Only owner-permitted tests are legal.

18.2 Prove your Kali VM is isolated

MediumIT

Why: Attack tools must not reach your home network.

What: Check Kali only sees the host-only network.

How:

  1. In Kali run ip -4 addr.
  2. ping -c2 8.8.8.8
  3. ping -c2 <target VM IP>

Expected output: Internet ping fails; target VM ping works.

Hint

Use a Host-only adapter in VirtualBox.

Answer / how to check
  1. Only 192.168.56.x is reachable.

18.3 Start a testing log

EasyBanking

Why: Logs protect you and help reports.

What: Record every command you run.

How:

  1. script -a ~/pentest-$(date +%F).log
  2. Run a few commands, then exit.
  3. tail ~/pentest-*.log

Expected output: Commands and outputs saved with date.

Hint

script records the whole terminal.

Answer / how to check
  1. File exists and has your commands.

Why this chapter comes before every tool

Parts 1–9 taught you to build systems. Parts 10 onwards teach you to test them. Between those two sits the law. India's Information Technology Act, 2000 (with later amendments) makes unauthorised access to a computer system an offence. "I was only learning" is not a defence. That is why every lab in this book is limited to machines you own or have written permission to test.

Real examples

Indian context: the National Cyber Crime Reporting Portal (cybercrime.gov.in) and the 1930 helpline exist because real people lose money to online fraud every day. Ethical hackers help organisations fix weaknesses before criminals find them. Global: companies like Microsoft, Google and Meta run bug-bounty programmes. They invite testing on named products, under published rules. Outside those rules, the same activity is illegal. Everyday: a locksmith may practise on locks he owns. Opening a neighbour's door without asking is a crime, even if he only wanted to "check the lock".

Safe labWrittenpermissionHost-onlynetworkYour VMsonlyNotes +rollbackReport +fix
Five conditions for every lab session. If one is missing, stop.

What you will be able to do after this chapter

  1. Explain the difference between an ethical hacker and a criminal in one clear table.
  2. List where to report cyber crime in India.
  3. Build a host-only lab with Kali and a vulnerable VM.
  4. Run a pre-engagement checklist before every session.

Recap

  • Tools are the same. Permission and intent decide whether the work is legal.
  • Own lab only, always.

Defender's worksheet (do this today)

  1. Write the lesson title and date in your notebook.
  2. List three systems you own (VMs, personal projects, or lab apps) where this lesson applies.
  3. Run one safe command or checklist item from the lesson on a lab system only.
  4. Paste the command and its output under an Evidence heading.
  5. Write one fix you would give a teammate in two sentences.
  6. Write one mistake students make with this topic and how to avoid it.

More real-world pictures

Indian workplace (sample data)

Suppose we are a junior analyst at Tech Mahindra supporting a client SOC. After reading this lesson you add one detection or one hardening item to the team weekly checklist, with the owner name and a due date. That is how learning becomes operations.

Global practice

Public bodies such as CERT-In (India), CISA (US) and NCSC (UK) publish advisories that map to the same ideas: patch, least privilege, logging and user awareness. Bookmark one advisory feed and read it every Monday.

Home and family

Explain this lesson to a family member in four sentences without jargon. If they can repeat the main warning back to you, you understand it well enough to teach.

Connect to earlier chapters

Parts 1 to 9 built Linux, web servers, databases and cloud pieces. This lesson only makes sense when you can point to a concrete config file, package name or architecture box from those parts. If you cannot, revisit the matching earlier chapter before you practise any tool command.

Common mistakes

  • Skipping written permission just for a quick scan.
  • Practising on hostel or office Wi-Fi targets without authorisation.
  • Collecting tool output without writing the fix.
  • Copying exploit commands onto production to verify. Verification for defenders means checking versions and patches, not firing modules.

Recap

  • Evidence, fix, owner, date.
  • Own lab only.
  • Teach one other person the warning from this lesson.