Ethical Hacking Training

Our students have the highest exam pass rate in the industry!

Skillset

Abstract

Data storage has become a critical problem that facing computer scientists. Not only is it the huge amount of data; it is also also the problem of safety and privacy because of the revolution of information technology security. In order to find a possible solution to these problems, this project combines open hardware and open source software. It is based on Raspberry Pi 2, which is a single-computer board with powerful characteristics (Quad-Core CPU, 1GB in the RAM and 3D Full HD graphic) and OwnCloud, a file sharing web script. The main challenge of this project is how to combine eight (or more) Raspberry Pi and make them as one cloud server with parallel processing. Presently, a web server fulfilling these requirements is $2000, but the price of the same server made with Raspberry Pi is $500.

We aim to address the following questions:

What is the Open Hardware Technology?

How we can combine eight Raspberry Pi in a parallel processing?

How we can make a secure file sharing environment using OwnCloud?

Only large companies can buy one due to the cost. On the other hand, the Raspberry Pi server can be made by anyone with the money. This simple cloud server is secure because the OwnCloud script will be configured with a SSL certificate to encrypt the user’s data to prevent the Man in the Middle attacks. Furthermore, the companies’ employers will be able to share their files privately without using any external drive, which avoids the transfer of viruses and malware. In addition, the companies’ files will be hidden from attackers because the server will be local. Consequently, they will be seen by the people who are connected to the same network with the server. This project uses a combination of open hardware and open software technology, so it will be developed and updated by developers around the world.

Ethical Hacking Training – Resources (InfoSec)

This cloud server will be made with two main steps: first, the building of the server (the hardware part) by installing and configuring Raspbian OS in the first Raspberry Pi, and then, the installation and configuration of MPICH and MPI4PY libraries and applying the same configuration in the other boards. Second, the preparation of the server to be able to run the OwnCloud script (the software part). That is will be made by installing and configuring PHP5, APACHE2 and OPENSSL packages. Then, we will configure the OwnCloud’s databases system and admin account. As a result, the server will have the following characteristics:

CPU: 7.2 GHZ / 32 Cores

HDD: 512 GB

RAM: 8 GB

Graphics: 3D / Full HD 1080p + 8 HDMI Ports

You can buy one for about $516.

Introduction

Raspberry Pi 2 is a single-board computer that allows us to create a lot interesting projects by programming this board to do the specific tasks with a suitable price. This board is created by Raspberry Pi Foundation to support the teaching of computer science around the world, and to promote the open hardware technology. We will discuss together the method of creating a simple cloud server with Raspberry Pi 2. This cheaper server will allow the people who are connected to the same network to store and share their files together on the cloud in a secure way. On the other hand, we will use OwnCloud script, which is a free and open source file sharing software. Therefore, our project will be a combination of an open hardware and an open source software to introduce what is called now the Open Cloud Technology. I believe that the Open Hardware technology can improve the creativity of the computer science students .

Building the server

Requirements :

To build this simple server we need :

Hardware :

8 x Raspberry Pi 2

1 x Switches 8 Ethernet Ports

2 x USB 2.0 Hubs ( 2 x 4 Ports )

8 x SD Cards ( 8 x 64GB )

8 x Power cables ( Micro USB )

10 x Networking Cables

Software :

OS : Raspbian OS

Apps :

Win32-disk Imager

MPICH sources

MPI4PY

The challenge of this project is how to combine of 8 Raspberry Pi that each one has the following technical characteristics:

900 MHz Quad-Core ARM Cortex A7 CPU

1 GB RAM

4 USB ports

40 GPIO pins

Full HDMI port

Ethernet port

3.5 mm audio jack and composite video

Camera interface (CSI)

Display interface (DSI)

MicroSD card slot

BroadCom VideoCore IV 3D graphics core

So if we combine only 8 Raspberries, we will have a server which has these characteristics :

CPU : 7.2 Ghz / 32 Cores

HDD : 512 GB

RAM : 8 GB

Graphics : 3D / Full HD 1080p + 8 HDMI Ports.

Install and Configure Raspbian OS in the First board (Pi01) :

In this step, we will install and configure the Raspbian OS on the Raspberry Pi 2. First, we should write in each MicroSD card the number of the Raspberry Pi 2 ( Pi01, Pi02, Pi03, …) to organize our work. Take the MicroSD card (Pi01) and connect it to your laptop. After that, download Raspbian OS from this link

Once the burning of Raspbian OS image finished, connect the MicroSD card to your Raspberry Pi (Pi01) this board will control the other boards to create a parallel processing system. Then, connect power cable, keyboard, mouse and Ethernet cable. You will see this screen below:

Figure 1 Raspberry Pi Configuration Screen

If not, try to type sudo raspbi-config . After that, configure the expand file system, overlock the Raspberry Pi to 900 Mhz, change the hostname to Pi01, split the memory to 16 MB graphics, and enable the SSH mode to allow us to control the board via another laptop ( in the same network). Before you reboot the board, enable the auto login by typing at the command line sudo nano /etc/inittab to edit the inittab file. Find this line #1:2345:respawn:/sbin/getty –noclear 38400 tty1 and comment out it by deleting ‘#’, and add this line in beneath it 1:2345:respawn:/bin/login -f pi tty1 </dev/tty1 >/dev/tty1 2>&1 . Now, you can reboot your board.

Configure the MPICH :

MPICH is an open source software that allows to us to create a multi-processing communication between computers in a parallel way. You can install this software by following these directions.

Install and Configure MPI4PY :

We installed gfortran a C compiler, and we know that Raspberry Pi is a python coding environment, so we should install MPI4PY package to compile *.py files. You can follow these steps to install and configure MPI4PY :

Install and Configure Raspbian OS on the other boards :

After finishing this procedure, we will have another image of the Raspbian OS which is configured to be able to use it in the other boards ( Its size is greater than the original image). So we will clone this image to all the other MicroSD cards ( Pi02,P03,Pi04,….,Pi08).

We will use the same method for all the boards. First, you should turn off the MicroSD card from the first Raspberry Pi by taping:

sudo poweroff

Then, connect the other MicroSD card (Pi02) in your laptop, and burn the new Raspbian image in it using Win32-Disk Imager (like in the previous steps), and repeat that for all of the MicroSD card (Pi03, Pi04… Pi08). After that, you should install nmap to control your network by typing in the terminal:

sudo apt-get update

sudo apt-get install nmap

Before we continue, you should connect all the boards to the router and the power, and insert the MicroSD cards in each one. In order to configure the network status of each Raspberry Pi, you should determine your internal IP by typing:

ifconfig

sudo nmap -sn 192.168.1.* (Scan subnet for the boards on the network)

We should first connect to all the boards with ssh protocol and do the same configuration listed in chapter 1.2 (The Raspberry Configuration Screen) and change the hostname to Pi0* (the appropriate value) using these commands.

You will configure all these Raspberry Pi’s from Pi01.

Pi02

ssh pi@192.168.1.3

sudo raspi-config

Pi03

ssh pi@192.168.1.4

sudo raspi-config

Pi04

ssh pi@192.168.1.5

sudo raspi-config

Pi05

ssh pi@192.168.1.6

sudo raspi-config

Pi06

ssh pi@192.168.1.7

sudo raspi-config

Pi07

ssh pi@192.168.1.8

sudo raspi-config

Pi08

ssh pi@192.168.1.9

sudo raspi-config

mpiexec -n 1 hostname (Run the test file)

mkdir mpi_test ( Create a test directory)

cd mpi_test (Open the test directory)

nano machinefile ( Create the machinefile file to allow to the MPI to read them)

Unfortunately, you will see that only Pi01 works because we don’t have the permissions to write and read the other boards. In order to solve this problem, we should create authentication keys by following the commands below.

This step will allow you to add the public-private keys to the boards :

PI01

ssh-keygen (Generate a new key and save it in /home/pi/.ssh/id_rsa without PASSWORD)

cd ~

cd .ssh (Open .ssh directory)

cp id_rsa.pub pi01 (Copy the key to a new file called pi01)

ssh pi@192.168.1.3 (Connect to Pi02 and do the same thing by following the commands below)

PI02

ssh-keygen

cd .ssh

cp id_rsa.pub pi02

scp 192.168.1.2:/home/pi/.ssh/pi01 .

cat pi01 >> authorized_keys

exit

ssh pi@192.168.1.4

PI03

ssh-keygen

cd .ssh

cp id_rsa.pub pi03

scp 192.168.1.2:/home/pi/.ssh/pi01 .

cat pi01 >> authorized_keys

exit

ssh pi@192.168.1.5

PI04

ssh-keygen

cd .ssh

cp id_rsa.pub pi04

scp 192.168.1.2:/home/pi/.ssh/pi01 .

cat pi01 >> authorized_keys

exit

ssh pi@192.168.1.6

PI05

ssh-keygen

cd .ssh

cp id_rsa.pub pi05

scp 192.168.1.2:/home/pi/.ssh/pi01 .

cat pi01 >> authorized_keys

exit

ssh pi@192.168.1.7

PI06

ssh-keygen

cd .ssh

cp id_rsa.pub pi06

scp 192.168.1.2:/home/pi/.ssh/pi01 .

cat pi01 >> authorized_keys

exit

ssh pi@192.168.1.8

PI07

ssh-keygen

cd .ssh

cp id_rsa.pub pi07

scp 192.168.1.2:/home/pi/.ssh/pi01 .

cat pi01 >> authorized_keys

exit

ssh pi@192.168.1.9

PI08

ssh-keygen

cd .ssh

cp id_rsa.pub pi08

scp 192.168.1.2:/home/pi/.ssh/pi01 .

cat pi01 >> authorized_keys

exit

We are in PI01: Add the other boards to the authorized_keys list :

scp 192.168.1.3:/home/pi/.ssh/pi02

cat pi02 >> authorized_keys

scp 192.168.1.4:/home/pi/.ssh/pi03

cat pi03 >> authorized_keys

scp 192.168.1.5:/home/pi/.ssh/pi04

cat pi04 >> authorized_keys

scp 192.168.1.6:/home/pi/.ssh/pi05

cat pi05 >> authorized_keys

scp 192.168.1.7:/home/pi/.ssh/pi06

cat pi06 >> authorized_keys

scp 192.168.1.8:/home/pi/.ssh/pi07
cat pi07 >> authorized_keys

scp 192.168.1.9:/home/pi/.ssh/pi08

cat pi08 >> authorized_keys

Configure your File Sharing Cloud Server :

Download the needed packages :

After we built our server, we will work on Pi01 because it controls all the other boards. First, we should give it a static internal IP. (As mentioned before, the IP of Pi01 is: 192.168.1.2 )

Follow these directions to give it a static IP :

sudo nano /etc/network/interfaces (Edit the interfaces file)

Figure 2 /etc/network/interfaces file

Then, save, exit the file and restart the networking to apply the new configurations.

sudo /etc/init.d/networking restart

After that, we check that our OS is updated.

sudo apt-get update

After we finish these steps, we will install :

Apache with SSL ( To make our server a web server and secure the file transfering by SSL Certificate. The URL of our server will be : https://192.168.1.2/ )

The importance of OPENSSL is that he protect the user from Man in the Middle attacks which allow the attacker to steal the user’s personal data such as the email, password and transferred image in the network by encrypting the ingoing and outgoing connections ( See Figure 3 below ).

Figure 3 Man in the Middle Attacks

Configure the OwnCloud Script :

OwnCloud is an open source web-based script which allows to users to store and share their files between them in the cloud. The important thing about OwnCloud is that it support all devices (as you can see in Figure 4).

Figure 4 How OwnCloud Works

In order to install this script in our server, we should first download its package.

Conclusion :

To sum up, this cloud was made by a combination of 8 single-computer boards and a file sharing script. As you can see, if we use the Open Hardware Technology well, we can do creative projects at minimum costs. As a result, we made together a simple cloud server that will help companies employers with sharing their files without any risk with :

I am Ahmed Lekssays. I am 19 years old. I am from Douirane near Imintanout, Morocco. I am a senior security researcher and developer at OWASP Foundation. I am currently studying Computer Science at Al Akhawayn University in Ifrane, Morocco. I am interested in Open Technology (Arduino, Raspberry Pi…). I have helped many companies in securing their application such as Twitter and WhatsApp.

One response to “Build A Simple Cloud Using the Open Hardware Technology”

Your email address will not be published. Required fields are marked *

Comment

Name *

Email *

Website

Save my name, email, and website in this browser for the next time I comment.

+ 6 = 12

About InfoSec

At Infosec, we believe knowledge is the most powerful tool in the fight against cybercrime. We provide the best certification and skills development training for IT and security professionals, as well as employee security awareness training and phishing simulations. Learn more at infosecinstitute.com.

Connect with us

Join our newsletter

File download

First Name

Last Name

Work Phone Number

Work Email Address

Job Title

Why Take This Training?

How will you fund your training?

What is your training budget?

InfoSec institute respects your privacy and will never use your personal information for anything other than to notify you of your requested course pricing. We will never sell your information to third parties. You will not be spammed.

Comments

What is Skillset?

Skillset

Practice tests & assessments.

Practice for certification success with the Skillset library of over 100,000 practice test questions. We analyze your responses and can determine when you are ready to sit for the test. Along your journey to exam readiness, we will:

1. Determine which required skills your knowledge is sufficient
2. Which required skills you need to work on
3. Recommend specific skills to practice on next
4. Track your progress towards a certification exam