GithubHelp home page GithubHelp logo

lucabongiorni / marks-pentest-challenge Goto Github PK

View Code? Open in Web Editor NEW

This project forked from markszabo/marks-pentest-challenge

0.0 1.0 0.0 490 KB

Small challenge I set up on my Raspberry Pi for my classmates Damn Vulnerable

PHP 66.13% CSS 33.87%

marks-pentest-challenge's Introduction

Mark's Pentest Challenge

Small penetration testing challenge I set up on my Raspberry Pi for my classmates.

Printscreen

I have started with a freshly installed Raspbian on a Raspberry Pi B.

##Configure your pi## Expand, change root password, optionally change locale.

sudo raspi-config
sudo reboot

##Update everything just to make sure##

sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade

##Install the necessearry packages## For the mysql choose a root password different from your user password.

sudo apt-get install apache2 -y
sudo apt-get install php5 libapache2-mod-php5 -y
sudo apt-get install mysql-server php5-mysql -y
sudo apt-get install php5-curl php-pear php5-gd -y
sudo reboot

###Mark's Pentest Challenge### Clone this repository to /etc/www/html

cd /etc/www/html
sudo git clone https://github.com/markszabo/Marks-Pentest-Challenge.git

Move everything to /etc/www/html.

sudo mv Marks-Pentest-Challenge .

Change the ownership of the files

sudo chown www-data:www-data . -R

##OWASP Mutillidae II## Copy the direct download link from the sourceforge website and use wget to download it to /etc/www/html folder on the pi.

cd /etc/www/html
sudo wget http://downloads.sourceforge.net/project/mutillidae/mutillidae-project/LATEST-mutillidae-2.6.36.zip?r=https%3A%2F%2Fsourceforge.net%2Fprojects%2Fmutillidae%2F&ts=1455613489&use_mirror=heanet

Unzip it and delete the zip

sudo unzip LATEST-mutillidae-2.6.36.zip?r=https%3A%2F%2Fsourceforge.net%2Fprojects%2Fmutillidae%2F&ts=1455613489&use_mirror=heanet
sudo rm LATEST-mutillidae-2.6.36.zip?r=https%3A%2F%2Fsourceforge.net%2Fprojects%2Fmutillidae%2F&ts=1455613489&use_mirror=heanet

Change the sql config file under mutillidae/classes/MySQLHandler.php

sudo nano mutillidae/classes/MySQLHandler.php
static public $mMySQLDatabasePassword = "write_your_sql_password_here";

You can also create a spearate sql user for mutillidae and setup it here. Now change the ownership of the mutillidae directory to enable full access for apache.

sudo chown www-data:www-data mutillidae -R

Now setup the database table. Open your browser and go to http://192.168.0.103/mutillidae/set-up-database.php (change the ip to your pi's ip). You should be greated with a popup: No PHP or MySQL errors were detected when resetting the database. Click OK to proceed to http://192.168.0.103/mutillidae/index.php?page=home.php&popUpNotificationCode=SUD1 or Cancel to stay on this page. Cick OK, and you are done with the setup.

##OWASP Hackademic Challenges Project## Go to /etc/www/html and clone the git repository of the project.

cd /etc/www/html
sudo git clone https://github.com/Hackademic/hackademic.git

Change the ownership and permissions of the directory

sudo chown www-data:www-data hackademic -R
sudo chmod -R 765 hackademic

Now it is time to setup the project. Open your browser and go to http://192.168.0.103/hackademic/. Follow the on-screen setup, and you are done.

Originally Hackademic requries the admin to activate every user account after registration, and the users can not use it beforehand. My setup will be only available on the local network, so I wanted to turn off this feature. To do it I edited the following php file:

sudo nano hackademic/controller/class.LoginController.php
(...)
} if ($user->is_activated != 1){
 header('Location:'.SOURCE_ROOT_PATH."pages/mainlogin.php?msg=activate");
}
(...)

Clearly this part of the code is responsibe for displaying the error message and refusing the login. So I changed the if to never execute: if ($user->is_activated != 1 && 1 == 2).

##Damn Vulnerable Web App## Copy the url of the zip from the projects website and download it to /etc/www/html. Unzip and remove the zip.

cd /etc/www/html
sudo wget https://github.com/RandomStorm/DVWA/archive/v1.9.zip
sudo unzip v1.9.zip 
sudo rm v1.9.zip 

Edit the sql config file. Fill in your sql username and password. Also register on https://www.google.com/recaptcha/admin/create and insert your public and private key.

sudo nano DVWA-1.9/config/config.inc.php

Rename and change the ownership

sudo mv DVWA-1.9 dvwa
sudo chown www-data:www-data dvwa -R

Now open your browser and go to http://192.168.0.103/dvwa/. If it is complaining about something, try to fix it. For me it said PHP function allow_url_include: Disabled, so I went to the /etc/php5/apache2/php.ini and changed this line allow_url_include = Off to on. Then I restarted the webserver with sudo service apache2 restart, and it was working.

##WackoPicko Vulnerable Website## (This is not working right now for me. I'm working on it.) Clone the code from github.

cd /etc/www/html
sudo git clone https://github.com/adamdoupe/WackoPicko.git

Import the WackoPicko database into MySQL using a command like the following. This will create the MySQL user wackopicko with the password webvuln!@# as well as create the wackopicko table.

cd WackoPicko
mysql -uYourSqlUserName -pYourSqlPassword < current.sql

Move the folders, delete the old ones, change ownership and provide the necessearry rights.

cd ..
sudo mv WackoPicko/website/ wackopicko
sudo rm WackoPicko/ -R
sudo chmod 777 -R wackopicko/upload
sudo chown www-data:www-data wackopicko -R

marks-pentest-challenge's People

Contributors

markszabo avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.