Hack Like a Pro: Linux Basics for the Aspiring Hacker, Part 11 (Apache Web Servers) « Null Byte :: WonderHowTo

Welcome back, my aspiring hackers!In this series onLinux for aspiring hackers, I'm trying to provide you with the basic skills needed to be capable in Linux as a hacker. One area that's critical that we haven't covered yet is building and managing an Apache web server.Apache is found on over 60% of the globe's web servers, so any self-respecting Linux admin should be familiar with it. As a hacker aspiring to hack websites, it's critical to understand the inner workings of Apache, websites, and the backend databases of these sites.In addition, by setting up your own web server, you could serve up malware to anyone who visits your site. If you're thinking of building a botnet, this is one of the best ways of doing that (I'll do a tutorial on building a botnet in the near future).Getting Apache on Your SystemIf you haveBackTrackrunning on your system, Apache is already installed. Many other Linux distros have it installed by default as well. If you don't have Apache installed, you can download and install theLAMP stack.LAMP is an acronym for Linux, Apache, MySQL, PERL, and PHP. These are the most widely used tools for developing websites in the Linux world, and they're very popular in the Microsoft world too, only it's generally referred to as WAMP, where the W simply stands for Windows.Simply download this LAMP stack and install it on your system, and then I will take you through the care and feeding of your LAMP stack to serve up webpages. In addition, we'll download and install a website that we can use for web and database hacking in future tutorials.Step 1: Start Your Apache DaemonThe first step, of course, is to start our Apache daemon. In BackTrack, go theBackTrack->Services->HTTPDand click onapache start.Step 2: Open the Default WebsiteNow that Apache is running, it should be able to serve up its default webpage. Let's typehttp://localhost/in your favorite web browser.Step 3: Open the Index.html FileApache's default webpage is/var/www/index.html. We can edit that file and get Apache to serve up whatever webpage we want, so let's create our own.Use any text editor you please, including vi, gedit, Kate, KWrite, emacs, etc. For demonstration purposes here, I'll open the/var/www/index.htmlwithKWrite.Note here that the default webpage has exactly the text that was displayed when we opened our browser tolocalhost, but inhtmlformat. All we need to do is edit this file to have our web server display the information we want.Step 4: Add Some HtmlNow that we have the web server running and the index file open, we can add whatever text we'd like the web server to serve up. We will create some simple html blocks.Let's serve up this page:<html><body><h1> Null Byte is the Best! </h1><p> If you are new to hacking, wonderhowto.com's Null Byte</p><p>world is the best place to learn hacking!</p></body></html>Now, save this file and close KWrite.Step 5: Let's See What HappensNow that we have saved our/var/www/index.htmlfile, we can check to see what Apache will serve up. Navigate your browser once again tohttp://localhost.Apache has served up our webpage just as we created it!Step 6: Download & Install DVWANow that we have our web server up and running, we want to download and install a website designed especially for hacking, known as theDamn Vulnerable Web ApplicationorDVWA. Let's download it fromhere, then unzip it. To unzip it, type:unzip DVWA-1.0.8.zip -d /var/wwwNext, we need to change permissions to give us (root) execute permissions.chmod 755 DVWA-1.0.8In my next Linux tutorial, we will set up PHP, MySQL, and configure our Damn Vulnerable Web Application so that we can practice website and database hacking, sokeep 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 LicenseRed feathers,green feathers, andworld networkimages via ShutterstockRelatedHow To:Linux Basics for the Aspiring Hacker: Configuring ApacheNews:How to Study for the White Hat Hacker Associate Certification (CWA)Hack Like a Pro:Linux Basics for the Aspiring Hacker, Part 6 (Networking Basics)News:What to Expect from Null Byte in 2015How To:The Essential Skills to Becoming a Master HackerHack Like a Pro:How to Fingerprint Web Servers Using HttprintHack Like a Pro:How to Hack Web Apps, Part 1 (Getting Started)Hack Like a Pro:Windows CMD Remote Commands for the Aspiring Hacker, Part 1Hack Like a Pro:How to Use PowerSploit, Part 1 (Evading Antivirus Software)Hack Like a Pro:How to Use Netcat, the Swiss Army Knife of Hacking ToolsHack Like a Pro:Linux Basics for the Aspiring Hacker, Part 17 (Client DNS)Hack Like a Pro:Linux Basics for the Aspiring Hacker, Part 15 (Creating a Secure Tunnel to MySQL)Hack Like a Pro:How to Hack Web Apps, Part 7 (Finding Hidden Objects with DIRB)Hack Like a Pro:Linux Basics for the Aspiring Hacker, Part 1 (Getting Started)PHP for Hackers:Part 1, Introduction and Setting UpHack Like a Pro:Linux Basics for the Aspiring Hacker, Part 22 (Samba)Goodnight Byte:HackThisSite Walkthrough, Part 10 - Legal Hacker TrainingHow To:Run a Free Web Server From Home on Windows or Linux with ApacheCommunity Byte:HackThisSite Walkthrough, Part 10 - Legal Hacker TrainingGoodnight Byte:HackThisSite Walkthrough, Part 6 - Legal Hacker TrainingCommunity Byte:HackThisSite Walkthrough, Part 6 - Legal Hacker TrainingCommunity Byte:HackThisSite, Realistic 3 - Real Hacking SimulationsGoodnight Byte:HackThisSite Walkthrough, Part 8 - Legal Hacker TrainingCommunity Byte:HackThisSite, Realistic 5 - Real Hacking SimulationsCommunity Byte:HackThisSite, Realistic 4 - Real Hacking SimulationsCommunity Byte:HackThisSite Walkthrough, Part 1 - Legal Hacker TrainingCommunity Byte:HackThisSite Walkthrough, Part 2 - Legal Hacker TrainingGoodnight Byte:HackThisSite Walkthrough, Part 4 - Legal Hacker TrainingCommunity Byte:HackThisSite, Realistic 2 - Real Hacking SimulationsGoodnight Byte:HackThisSite, Realistic 3 - Real Hacking SimulationsGoodnight Byte:HackThisSite Walkthrough, Part 2 - Legal Hacker TrainingHack Like a Pro:Hacking Samba on Ubuntu and Installing the MeterpreterNews:Anonymity, Darknets and Staying Out of Federal Custody, Part Three: Hidden ServicesGoodnight Byte:HackThisSite Walkthrough, Part 9 - Legal Hacker TrainingCommunity Byte:HackThisSite, Realistic 1 - Real Hacking SimulationsGoodnight Byte:HackThisSite Walkthrough, Part 7 - Legal Hacker