Hack Like a Pro: Linux Basics for the Aspiring Hacker, Part 1 (Getting Started) « Null Byte :: WonderHowTo

Welcome back, my hacker trainees!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.There are some exceptions, though, including software likeCain and Abel, Havij,Zenmap, andMetasploitthat are developed or ported for Windows.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 likeBackTrackor Kali.Image viawonderhowto.comFor those of you who've never used Linux, I dedicatethis series on the basics of Linuxwith an emphasis on the skills you need for hacking. So, let's open up BackTrack or your other Linux distribution and let me show you a few things.Step 1: Boot Up LinuxOnce you've booted up BackTrack, logged in as "root" and then type:bt > startxYou should have a screen that looks similar to this.Step 2: Open a TerminalTo 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.If you've ever used the command prompt in Windows, the Linux terminal is similar, but far more powerful. Unlike the Windows command prompt, you can do EVERYTHING in Linux from the terminal and control it more precisely than in Windows.It's important to keep in mind that unlike Windows, Linux is case-sensitive. This means that "Desktop" is different from "desktop" which is different from "DeskTop". Those who are new to Linux often find this challenging, so try to keep this in mind.Step 3: Examine the Directory StructureLet'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 ac:\at the beginning of our Linux file system, but rathera /.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.To visualize the file system, let's take a look at this diagram below.It's important to have a basic understanding of this file structure because often we need to navigate through it from the terminal without the use of a graphical tool like Windows Explorer.A couple key things to note in this graphical representation:The/bindirectory is where binaries are stored. These are the programs that make Linux run./etcis generally where the configuration files are stored. In Linux, nearly everything is configured with a text file that is stored under/etc./devdirectory holds device files, similar to Windows device drivers./varis generally where log files, among other files, are stored.Step 4: Using PwdWhen 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 > pwdpwdstands for "present working directory" and as you can see, it returns "/root" meaning we're in the root users directory (don't confuse this with the top of the directory tree "root." This is the rootusersdirectory).pwd is a handy command to remember as we can use it any time to tell us where we are in the directory tree.Step 5: Using Cd CommandWe can change the directory we're working in by using thecd(change directory) command. In this case, let's navigate "up" to the top of the directory structure by typing:bt > cd ..Thecdcommand followed by the double dots (..) says, "move me up one level in the directory tree." Notice that our command prompt has changed and when we typepwdwe see that Linux responds by telling us we are in the "/" or the top of the directory tree (or the root directory).bt > pwdStep 6: Using the Whoami CommandIn our last lesson of this tutorial, we'll use thewhoamicommand. 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 > whoamiThat's it for now. In thenext several tutorials, I will continue to give you the basics of Linux that you'll need to be a pro hacker, so keep coming back!Want to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseCover image byBotheredByBees/FlickrRelatedNews:How to Study for the White Hat Hacker Associate Certification (CWA)Hack Like a Pro:Linux Basics for the Aspiring Hacker, Part 11 (Apache Web Servers)How To:The Essential Skills to Becoming a Master HackerHack Like a Pro:Linux Basics for the Aspiring Hacker, Part 6 (Networking Basics)How to Hack Like a Pro:Getting Started with MetasploitHack Like a Pro:Linux Basics for the Aspiring Hacker, Part 2 (Creating Directories & Files)Hack Like a Pro:Linux Basics for the Aspiring Hacker, Part 12 (Loadable Kernel Modules)Hack Like a Pro:Linux Basics for the Aspiring Hacker, Part 25 (Inetd, the Super Daemon)Hack Like a Pro:Linux Basics for the Aspiring Hacker, Part 13 (Mounting Drives & Devices)Hack Like a Pro:Linux Basics for the Aspiring Hacker, Part 21 (GRUB Bootloader)Hack Like a Pro:Linux Basics for the Aspiring Hacker, Part 9 (Managing Environmental Variables)News:What to Expect from Null Byte in 2015Hack Like a Pro:Linux Basics for the Aspiring Hacker, Part 15 (Creating a Secure Tunnel to MySQL)Hack Like a Pro:Linux Basics for the Aspiring Hacker, Part 5 (Installing New Software)Hack Like a Pro:Linux Basics for the Aspiring Hacker, Part 22 (Samba)Goodnight Byte:HackThisSite Walkthrough, Part 6 - Legal Hacker TrainingCommunity Byte:HackThisSite Walkthrough, Part 2 - Legal Hacker TrainingCommunity Byte:HackThisSite Walkthrough, Part 6 - Legal Hacker TrainingGoodnight Byte:HackThisSite Walkthrough, Part 4 - Legal Hacker TrainingCommunity Byte:HackThisSite Walkthrough, Part 1 - Legal Hacker TrainingHack Like a Pro:Hacking Samba on Ubuntu and Installing the MeterpreterGoodnight Byte:HackThisSite Walkthrough, Part 8 - Legal Hacker TrainingCommunity Byte:HackThisSite Walkthrough, Part 5 - Legal Hacker TrainingTHE FILM LAB:Intro to Final Cut Pro - 02Community Byte:HackThisSite, Realistic 2 - Real Hacking SimulationsGoodnight Byte:HackThisSite Walkthrough, Part 10 - Legal Hacker TrainingGoodnight Byte:HackThisSite Walkthrough, Part 9 - Legal Hacker TrainingCommunity Byte:HackThisSite, Realistic 3 - Real Hacking SimulationsHow To:How Hackers Take Your Encrypted Passwords & Crack ThemCommunity Byte:HackThisSite, Realistic 4 - Real Hacking SimulationsCommunity Byte:HackThisSite Walkthrough, Part 10 - Legal Hacker TrainingCommunity Byte:HackThisSite, Realistic 5 - Real Hacking SimulationsNews:Let Me Introduce MyselfCommunity Byte:HackThisSite, Realistic 1 - Real Hacking SimulationsCommunity Byte:HackThisSite Walkthrough, Part 9 - Legal Hacker TrainingHow To:Chain VPNs for Complete Anonymity