Linux Basics for the Aspiring Hacker, Part 1 (Getting Started)
A number of you have written me regarding which operating system is best for hacking. I'll start by saying that nearly every professional and expert hacker uses Linux or Unix. Although some hacks can be done with Windows and Mac OS, nearly all of the hacking tools are developed specifically for Linux.
When these Linux apps are developed in Linux and then ported over to Windows, they often lose some of their capabilities. In addition, there are capabilities built into Linux that simply are not available in Windows. That is why hacker tools are in most cases ONLY developed for Linux.
To summarize, to be a real expert hacker, you should master a few Linux skills and work from a Linux distribution like BackTrack or Kali.
Step 1Boot Up Linux
Once you've booted up BackTrack, logged in as "root" and then type:- bt > startx
Step 2Open a Terminal
To become proficient in Linux, you MUST master the terminal. Many things can be done now in the various Linux distributions by simply pointing and clicking, similar to Windows or Mac OS, but the expert hacker must know how to use the terminal to run most of the hacking tools.So, let's open a terminal by clicking on the terminal icon on the bottom bar. That should give us a screen that looks similar to this.
Step 3Examine the Directory Structure
Let's start with some basic Linux. Many beginners get tripped up by the structure of the file system in Linux. Unlike Windows, Linux's file system is not linked to a physical drive like in Windows, so we don't have a c:\ at the beginning of our Linux file system, but rather a /.The forward slash (/) represents the "root" of the file system or the very top of the file system. All other directories (folders) are beneath this directory just like folders and sub-folders are beneath the c:\ drive.
A couple key things to note in this graphical representation:
- The /bin directory is where binaries are stored. These are the programs that make Linux run.
- /etc is generally where the configuration files are stored. In Linux, nearly everything is configured with a text file that is stored under /etc.
- /dev directory holds device files, similar to Windows device drivers.
- /var is generally where log files, among other files, are stored.
Step 4Using Pwd
When we open a terminal in BackTrack, the default directory we're in is our "home" directory. As you can see from the graphic above, it's to the right of the "root" directory or one level "below" root. We can confirm what directory we are in by typing:- bt > pwd
Step 5Using Cd Command
We can change the directory we're working in by using the cd (change directory) command. In this case, let's navigate "up" to the top of the directory structure by typing:- bt > cd ..
- bt > pwd
Step 6Using the Whoami Command
In our last lesson of this tutorial, we'll use the whoami command. This command will return the name of the user we're logged in as. Since we're the root user, we can log in to any user account and that user's name would be displayed here.- bt > whoami
Comments
Post a Comment