Beginner · Your legal practice lab · topic 6 of 35 · 18 min
Kali Linux: the attacker machine
Explanation
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.)
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 addressesUpdating 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.
sudo apt update # refresh the list of available packages
sudo apt full-upgrade # install the newest versionsFinding 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.
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 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)
Kali Linux is…
Which command shows a machine's IP addresses on Linux?
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
Read more (free)
Related help
Before this, learn
This topic builds on these. If something here feels new, open them first.
Related topics
- Vulnerable targets: Metasploitable, DVWA and Juice ShopYour legal practice lab · same module
- Legal online platforms: TryHackMe, Hack The Box and moreYour legal practice lab · same module
- Burp Suite basics: the intercepting proxyWeb application testing: Burp Suite and the basics
- What Linux and Red Hat Enterprise Linux areLinux and Red Hat (RHCSA to RHCE) · Linux and the shell
- Metasploit basics (in the lab)Deeper lab skills: passwords, privilege, Metasploit, wireless
- The Linux filesystem and everyday commandsDevOps: Git, Docker, Kubernetes and CI/CD · Linux for DevOps
Questions people ask about this
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.
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.
IDS/endpoint tools often catch Metasploit because…Related
Answer: Many modules and payloads have known signatures
Known signatures and unusual connections are detectable.
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.
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
- 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.
- Module 2 exam: the practice lab · 12 questions · 20 min, without help. 4 topics of this module still to finish first.
- Then the next module, Methodology and reconnaissance. 35 topics left in the course before the final exam.