Linux Basics
SECTION 5
You have now successfully installed a hypervisor and set up Kali Linux, what now?
We use Kali Linux as our primary operating system for hacking activities, but there are many other
distros (Linux distributions). We use Kali because it comes pre-installed
with many tools that are useful for penetration testing and ethical hacking.
What Now?
After setting up your Kali Linux environment, you might be wondering what to do next. This section will guide you through the basic concepts of Linux, which is essential for any hacker. Understanding Linux will help you navigate the system and use command-line tools.
Packet manager & Text Editors
In Kali Linux, package management is handled through APT (Advanced Package Tool). You can use
commands like apt-get to install, update, and remove software
packages.
⚠️ Note: There are a lot of other packet managers, but there are some security implications with using them, so we stick to APT for now.
Text editors like nano and vim
are essential for editing configuration files and writing scripts in linux. Nano is easier to learn
for beginners, while Vim is more powerful and widely used in the industry.
But there is a good middle ground between the two, which is micro. This editor is also used
in Haaga-Helia by one of the lecturers, so you might wanna check it out!
You can find all the necessary instructions on how to install micro on the link above.
Core Commands
Here is a list of which will get you started with mastering your Linux! I know it might look bit intimidating, but best way to learn is to try them out! So open up your Linux terminal and get to it, go through the commands and see what they do! H-T8 also gives you couple of tasks to do in this manual after you studied a bit.
| Command | Description | Example Usage |
|---|---|---|
| ls | List directory contents | ls -l /home/santeri |
| cd | Change directory to | cd /var/log |
| pwd | Show current directory path | pwd |
| cat | Display contents of a file | cat notes.txt |
| less | View file one page at a time | less longfile.txt |
| grep | Search for patterns in files | grep 'error' /var/log/syslog |
| find | Search for files and directories | find /home -name "*.txt" |
| wget | Download files from the web | wget http://example.com/file.zip |
| curl | Transfer data from or to a server | curl -O http://example.com/file.zip |
| nc (netcat) | Network tool (port scanning, chat, etc.) | nc -v -z 192.168.0.1 1-1000 |
Bonus Essentials
Here are some additional essential Linux commands that will further enhance your command-line skills. These commands are crucial for file management, system monitoring, and understanding your environment.
⚠️ Tip: If you want to learn more about a specific command, you can use "man" to view its manual page. Example: $ man ls
| Command | Description | Example Usage |
|---|---|---|
| echo | Print text to terminal | echo "Hello, hacking club!" |
| man | Show manual/help for a command | man grep |
| chmod | Change file permissions | chmod +x script.sh |
| chown | Change file ownership | chown santeri:santeri notes.txt |
| mkdir | Make a new directory | mkdir projects |
| rm | Remove a file or directory | rm old_file.txt or rm -r old_folder |
| cp | Copy files and directories | cp file.txt backup.txt |
| mv | Move or rename files | mv file.txt archive.txt |
| whoami | Show your current username | whoami |
| top | Real-time system resource usage | top |
| ps | Show running processes | ps aux |
Exercise
Here you get to put what you learned to the test, and we'll actually start learning. Skills is not just reading and remembering. It's also failing and finding out!
- Head to the website OverTheWire
- Read the instructions carefully
- Solve the challenges 0-8