Skip to content

Beginner · Your legal practice lab · topic 6 of 35 · 18 min

Kali Linux: the attacker machine

Explanation

Kali Linux is a free Linux distribution made for security testing. It comes with hundreds of tools already installed, such as nmap, Burp Suite and Metasploit. You run it as a VM and drive it from the terminal. Learning a few basic commands is enough to start.

What Kali is

Kali Linux is a version of Linux built and maintained for penetration testing and security work. Instead of installing dozens of tools one by one, you get them ready to use. It is free and made by Offensive Security. You will usually run it as a VM in your lab.

Kali is just a tool; it does nothing illegal by itself. The same rules apply: only test machines you are allowed to test. Having Kali installed is normal for a learner or professional.

Getting around the terminal

Most testing happens in the terminal, a text window where you type commands. Here are the few you need at the start. (The prompt ends with $ for a normal user or # for the root/administrator user.)

bash
pwd            # print working directory: where am I?
ls -la         # list files here, including hidden ones
cd /opt        # change directory to /opt
cat notes.txt  # show a file's contents
nano notes.txt # edit a file in a simple editor
ip addr        # show this machine's IP addresses
Basic Linux commands you will use every day.

Updating Kali

Keep Kali up to date so its tools and the system have the latest fixes. On a Debian-based system like Kali you use the apt package manager.

bash
sudo apt update        # refresh the list of available packages
sudo apt full-upgrade  # install the newest versions
sudo runs a command as the administrator (root). It will ask for your password.

Finding your lab's addresses

To attack a target you need its IP address (its number on the network). Run ip addr on both the attacker and the target. On a host-only network they will usually share the first three numbers, for example 192.168.56.x.

Careful: Do not log in as root for everyday work. Use a normal user and sudo only when needed. Running everything as root makes a small mistake far more damaging.
Tip: When you forget how a tool works, almost every command has a manual: type man nmap or nmap --help. Reading the help is faster than guessing.

Alternatives

Kali is not the only option. Parrot Security OS is similar. You can also add security tools to an ordinary Ubuntu. For this course, any of them is fine; the tools and ideas are the same.

Need help?

Stuck on a word or an idea? Search this course, or every course, and jump straight to the explanation or a worked question.

Try:

Watch the lesson

Kali Linux: the attacker machine · 1/7

Kali = tools ready to go

Kali Linux is a free Linux built for security testing, with the tools pre-installed.

Prefer a video by a teacher? Find free videos on “kali linux basics terminal commands for beginners” on YouTube ↗

In real life: First contact in the lab

After booting Kali and DVWA, a learner runs ip addr on each. Kali shows 192.168.56.101; DVWA shows 192.168.56.102. From Kali she runs ping 192.168.56.102 and sees replies — the two VMs can talk, and the network is isolated to the lab. She has not attacked anything yet, but she has confirmed the lab works, which is the right first step.

Practice (0/3 done)

Task 1 · Question

Kali Linux is…

Task 2 · Question

Which command shows a machine's IP addresses on Linux?

Task 3 · Code · Python

When reading output, you often need the file name at the end of a Linux path. Write basename(path) that returns the part after the last "/". basename("/opt/tools/nmap") returns "nmap"; basename("report.txt") returns "report.txt".

Quick quiz

Question 1

1.What does sudo do?

Question 2

2.The safest everyday practice is to…

Question 3

3.To read a tool's manual you type…

Question 4

4.An alternative security-focused Linux similar to Kali is…

Read more (free)

Open a question to see the answer and why. The first ones are this topic's own quiz, so try the quiz above before you peek.

What does sudo do?

Answer: Runs a command as the administrator (root)

sudo runs a single command with administrator rights.

The safest everyday practice is to…

Answer: Use a normal user and sudo only when needed

Avoid being root all the time; use sudo for the few commands that need it.

To read a tool's manual you type…

Answer: man toolname

man toolname (or toolname --help) shows how a command works.

An alternative security-focused Linux similar to Kali is…

Answer: Parrot Security OS

Parrot Security OS is a comparable distribution.

A free, open-source alternative to Burp is…Related

Answer: OWASP ZAP

OWASP ZAP is a free alternative proxy.

From Burp Suite basics: the intercepting proxy

What does the Linux kernel do?Related

Answer: Talks to the hardware and runs processes

The kernel is the core of the OS: hardware, memory, processes.

From What Linux and Red Hat Enterprise Linux are

IDS/endpoint tools often catch Metasploit because…Related

Answer: Many modules and payloads have known signatures

Known signatures and unusual connections are detectable.

From Metasploit basics (in the lab)

Which package manager do you use on Rocky Linux?Related

Answer: dnf

Rocky Linux and other RHEL-family systems use dnf. apt is for Debian and Ubuntu, apk for Alpine.

From The Linux filesystem and everyday commands

Pass the quiz (60% or more) or mark this topic as done when you are ready.

Your progress is saved on this device only.

Next steps

  1. 2 more topics in “Your legal practice lab” before its exam: Vulnerable targets: Metasploitable, DVWA and Juice Shop, Legal online platforms: TryHackMe, Hack The Box and more.
  2. Module 2 exam: the practice lab · 12 questions · 20 min, without help. 4 topics of this module still to finish first.
  3. Then the next module, Methodology and reconnaissance. 35 topics left in the course before the final exam.

← Previous: Why you need an isolated lab