Many hackers have studied computer fundamentals in a Windows or Mac environment, thus they are not familiar with Linux. Occasionally, this lack of familiarity poses the biggest challenge to learning the necessary abilities to work as a professional white hat hacker.
Linux is the only hacking platform—and for good reason. Having said that, you must master the fundamentals of Linux if you want to become a hacker. The goal of this essay series is to teach aspiring hackers the fundamentals of Linux that they will need to advance to become skilled, white hat hackers.
I will make an effort to gradually and rationally increase your Linux proficiency so that you can perform the numerous hacks I will demonstrate on The Tech Leaners.
I’ll walk you through some of the fundamentals of setting up Kali Linux Basics for Beginners in this lesson. For all of my examples, the ideas are applicable to almost all Linux distributions.
Launch a Terminal
Opening a terminal is typically the first thing you do when working with Linux. In Kali Linux, we may double click the terminal icon located at the top of the page or we can press control+alt+t.
The terminal shown below will open when you click on it or type Ctrl+Alt+T.
By default, this terminal opens a shell. All a shell is is a command line environment in which we can develop scripts and execute commands on the underlying operating systems (more on scripts later). Although Linux offers a wide variety of shell environments, the Bourne Again Shell, also known as BASH, is the most widely used. With Kali and many other Linux distributions, this is the default shell.
File Systems
Linux file systems are not constrained by the physical drive, in contrast to Windows file systems. The root, or /, is the first entry in the file structure of the Linux file system. This is just the top of the logical file hierarchy; it does not represent the physical drive.
The / or root of the file system is located at the very top of the file system, as can be seen in the schematic of the Linux file system above. This should not be confused with the “root” user; they are two distinct entities. In this case, root is just the file structure’s base. For a novice, the following subdirectories beneath / are most likely the most crucial:
- /root:- This is the home directory of the supremely strong root user.
- /etc:- In Linux, configuration files are often stored in /etc.
- /home:- A user’s home directory is located at /home.
- /mnt:- Other file systems can be mounted or attached to the filesystem using the /mnt directory.
- /bin:- The Windows language’s binaries, or executables, are located at /bin.
- /lib:- The libraries are located in the directory /lib. These are shared applications, much like Windows DLLs.
pwd
When working in Linux, we sometimes need to know what directory we are in. The command, current working directory, or pwd, returns the location in the directory hierarchy where you are. This is important while navigating the directory hierarchy. Let’s try “pwd” and see where we end up.
As you can see, Linux returned /root, indicating that we are in the directory of the root user. If we were in another directory, it would have returned the name of that directory, as we will see later.
whoami
We can log in as any authorized user on Linux. You will most likely be signed in as “root” as the system administrator, but this is not recommended while performing normal chores. This is a security precaution because anyone who hacks you while you are logged in as root will gain root privileges and control of the machine. It is preferable to log in as a regular user. You may have forgotten who you logged in as at times. Typing “whoami” will correct this.
cd
Navigating the file system using the terminal is a necessary skill in Linux. We can change directories with the cd or change directory command, just like in Windows command line computers. We can switch directories by typing cd followed by the directory name, for example;
As the prompt suggests, we are now in the /etc directory, which we can validate by typing pwd.
We can use the cd command followed by.. to advance up one level in the file structure, for example;
kali > cd..
To advance two levels, type cd followed by a double dot and a forward slash (../) followed by a second double dot, for example;
kali > cd../..
We can just type to move up to the root level of the file structure.
kali > cd /
where / denotes the file structure’s top or root.
ls
When viewing the contents of a directory, we can use the ls or list commands.
kali > ls -l
When conducting a listing in Linux, I always use the -l flag, but to each their own. Finally, some files in Linux are hidden and will not be revealed by a basic ls or ls -l operation. The secret files will be seen if we add a lower case a (-a).
kali > ls -la
help
There’s a help file for almost every command. A brief help screen is provided by these help files to aid with your comprehension of the command, utility, or application. To get guidance using aircrack-ng, the greatest wireless cracking program, for example, I could just type the command and then the –help option. Be mindful of the double dash (–). In Linux, it is customary to use a double dash (–) before word choices like “help” and a single (-) before options that are single letters, though this is not always followed. Check out more examples on the aircrack-ng help screen.
Kali > aircrack-ng —help
In certain instances, you can obtain the help file by using either the -h or? For example, to get guidance with nmap, the best port scanning tool, type kali > nmap -h.
Take note that, as in nmap -h, I used a single dash before the h.
Man
You can access further information on a specific application or command by visiting its manual page, in addition to the help switch that is accessible for the majority of commands and applications. A documentation for all utilities, commands, and applications is kept up to date by almost all Linux distributions. Simply type “man” before any command, tool, or application, such “;” to access the manual.
Man > aircrack-ng kali
This brings up the aircarck-ng handbook, which provides us with more comprehensive information than the –help screen. Linux opens the man page with other commands, including one for file display, which we shall examine in a moment. With the Enter key, we may navigate this manual file, and the PGDN or PGUP keys can be used to page down. We simply type “q” to exit.
I hope you learn everything on the Part 1 of linux. I will try my best to provide another lesson on the Linux Basics for Beginners.