Header Banner
Null Byte Logo
Null Byte
wonderhowto.mark.png
Cyber Weapons Lab Forum Metasploit Basics Facebook Hacks Password Cracking Top Wi-Fi Adapters Wi-Fi Hacking Linux Basics Mr. Robot Hacks Hack Like a Pro Forensics Recon Social Engineering Networking Basics Antivirus Evasion Spy Tactics MitM Advice from a Hacker

How to Set Up a Pentesting Lab Using XAMPP to Practice Hacking Common Web Applications

Jan 22, 2016 01:26 AM
Sep 14, 2016 05:22 PM
XAMPP software logo variations

Hello friends! This tutorial will teach you how to build a local pentesting lab on your Linux machine which will enable you to easily install common web applications so you can practice locating and exploiting their known vulnerabilities (or discover new ones!). In particular, this is an excellent way to learn how to hack Wordpress, Joomla, and Dupral plus many more!

Basically it's the same idea as building an intentionally vulnerable virtual machine to practice hacking against, except strictly focuses on the most common web applications.

The set up is essentially the same for Windows, although the locations of the folders might be different.

This is the only complete and accurate tutorial online that demonstrates:

  1. How to install XAMPP
  2. How to install Wordpress locally on XAMPP
  3. How to fix pesky error warnings
  4. How to change themes without knowing ftp username/password

Ready? Let's begin!

Download XAMPP

Navigate to the following URL and download the version of XAMPP appropriate for your operating system.

https://www.apachefriends.org/download.html

Download page for XAMPP software featuring versions for Windows and Linux.

After downloading, navigate to your download folder and double click the XAMPP 'installer.run' file. This will install XAMPP onto your system. At the end of the installation, make sure the 'run XAMPP now' tick box is checked and click 'finish'.

On your XAMPP interface, click 'manage servers' then click 'start all'.

XAMPP control panel showing Apache web server and MySQL database starting statuses.

Now it's time to download and install an old version of wordpress so I can practice exploiting it's known vulnerabilities. Click the link below and download the version of wordpress you'd like to practice exploiting. In this tutorial, I am installing wordpress 3.1.3

https://wordpress.org/download/release-archive/

WordPress release archive page displaying version information and download links.

After Downloading, Extract the Zip File into /Opt/Lampp/Htdocs.

File manager interface displaying various folders and files on a computer.

In your browser, navigate to 'localhost/dashboard and click 'phpMyAdmin' in the menu bar in the right upper corner of the page.

Welcome to XAMPP for Linux 5.5.30 - Download and installation guide for Apache, MariaDB, PHP, and Perl.

In the upper left hand corner of the screen, under 'phpMyAdmin', click 'new' to create a new database. Set 'wordpress' as the name of your database, then click 'create'.

In the pic, ignore the wp3.1.3 stuff. At the bottom you'll see my database named 'wordpress'' just like I told you to create

Database management screen in phpMyAdmin showing various database options and settings.

Turn to your folders and navigate to /opt/lampp/htdocs/wordpress and double click the 'wp-config-sample.php file. We will need to edit it appropriately.

File directory view of a WordPress installation on a computer.

Replace 'databasenamehere' with the name of your database, which in my case is 'wordpress'. Replace 'usernamehere' with 'root' and leave 'passwordhere' blank.

Click 'save as' and rename the file 'wp-config.php'.

How to Set Up a Pentesting Lab Using XAMPP to Practice Hacking Common Web Applications

Now we can get on with actually installing WordPress. Open your browser and go to http://localhost/wordpress/

You should see the translation screen that comes before the famous five minute WordPress installation process. Select your language and click 'continue'.

Language selection dropdown in WordPress interface.

Enter the title for your site (you can change this later), chose a unique username and password, enter your email address and click 'finish'.

Viola! Your wordpress installation is now complete!

Fix Pesky Warnings

Now it's time to fix those pesky 'warning' messages showing up on your posts and pages. Navigate to and open your wp-config.php file and add the following line just above the 'define DB_Name' line.

ini_set( 'display_errors', 0 );

Change Your Theme

Fix the issue that will prevent you from changing themes. If you go and try and change your theme, you will notice that it asks for your ftp user name and password. To disable this, add the following line below the line you added in the last step in your wp-config.php file

define('FS_METHOD','direct');

ENJOY!

Pat yourself on the back you've completed something a decent amount of people find difficult.

The next big software update for iPhone is coming sometime in April and will include a Food section in Apple News+, an easy-to-miss new Ambient Music app, Priority Notifications thanks to Apple Intelligence, and updates to apps like Mail, Photos, Podcasts, and Safari. See what else is coming to your iPhone with the iOS 18.4 update.

Related Articles

Comments

No Comments Exist

Be the first, drop a comment!