How To Install Kali Linux On The RasPad - R2

Download as pdf or txt
Download as pdf or txt
You are on page 1of 33

How to set up the RasPad with Kali Linux

by Jason Andreas
Last Updated 8/2/18

Preface: This guide is a combination of many webpages that I found while scouring the
internet. I will make every attempt to give credit to the original authors if/when possible. My
apologies in advance if I miss giving credit to anyone where it is due!

Also, I consider this guide a starting point. I would love for this to grow into a collaboration
effort with many of you participating in making this guide better. You all have unique
insights, and the more minds that work together can only make the RasPad better!

To get started, you will need:

 A Windows PC.
 A micro SD card at least 16GB in size. I used a SanDisk Ultra 64GB XC1 micro SD card. I
highly recommend using a high speed card. The type of SD card you use can make a BIG
difference in performance.
 The SD Memory Card Formatter for Windows.
https://www.sdcard.org/downloads/formatter_4/eula_windows/index.html
 A micro SD to USB adapter or micro SD to SD adapter (if your PC had an SD card reader).
 7-zip for Windows (on your Windows PC)
https://www.7-zip.org/
 Kali Linux for the Raspberry PI 3B and 3B+ (Called Kali Linux Sticky Fingers)
https://docs.google.com/uc?id=1QxYRXwP7NV9JHfWh_owFJlhvhofToV6U&export=dow
nload#StickyFingers-Kali-Pi-armhf-180617.img.xz
 Etcher (on your Windows PC).
https://etcher.io/
 GParted (we will install this your RasPad).
 A USB Keyboard and mouse (until we get Bluetooth operational).
Step 1. Format your microSD card. Even if this is a new microSD card, I still recommend
formatting it using the SD Memory Card Formatter for Windows. This tools not only
formats the card, it does so in a way that the Kali Linux install can read/access.
Step 2. Download the Kali Linux Sticky Fingers install. A direct link to the download can be
found here:
https://docs.google.com/uc?id=1QxYRXwP7NV9JHfWh_owFJlhvhofToV6U&export=downlo
ad#StickyFingers-Kali-Pi-armhf-180617.img.xz

Click Download Anyway. I know that seems scary, but this is a legit file! It will then
download the file StickyFingers-Kali-Pi-armhf-180617.img.xz to your PC.

Step 3. Assuming you have already installed 7-zip on your PC, extract the Kali Linux .img file
by right clicking on the StickyFingers-Kali-Pi-armhf-180617.img.xz file and going to 7-zip,
Extract Files. This will create a folder a folder named StickyFingers-Kali-Pi-armhf-
180617.img and contain a file named StickyFingers-Kali-Pi-armhf-180617.img inside of that
folder.
Step 4. Open Etcher, Click Select Image, and choose the StickyFingers-Kali-Pi-armhf-
180617.img file.

Click Select Drive and Choose the drive letter of your MicroSD card.
BE CAREFUL TO SELECT THE CORRECT DRIVE! Click Continue

Click Flash! It might take as long as 20 minutes to complete this process. Once it is done,
you will have a bootable Kali Linux MicroSD card.
It will give a Flash Complete message once it it done.

Step 5. Install the Micro SD card into your RasPad. Plug the Touch Screen USB cable into a
USB port. Plug in a USB Keyboard and Mouse, then power on the RasPad.
It will boot up Kali Linux and prompt for a username and password
User is: root
Password: toor (We will change this later on)
At first login it will bring you up to a screen that says “Welcome to the first start of the
Panel”. Choose “Use default config”

It will take you to the desktop.


s dffds dfs df

Step 6. – Verifying network access. If you have an Ethernet cable, plug it in now. Otherwise to
connect to Wifi, click the little network icon in the upper right hand side of the screen (next to
the clock). Select the network, type in your Wifi password, and click connect.

Now that we are connected, we need to verify that we have and IP. To do that open a terminal
by clicking the terminal icon down at the bottom of the screen.

From the terminal windows type:


ifconfig
It will show you several devices. If you are using Ethernet, the IP will be listed next to inet on
eth0. If you are using Wifi, your IP will be listed next inet on wlan0. If you see an IP address
listed there (other than 169.254.x.x) you are connected to the internet.

Keep the terminal window open. It will be used in the next step.
Step 7. Resizing the Root partition (/sdb2) on the microSD card.
However before proceeding any further in Kali linux, we will need to increase the partition
size of the /root partition.
The Kali image is based off of an 8GB SD. This is totally inadequate (thus the need for at
least a 16GB SD). If you skip this step and do not increase your partition, you are
guaranteed to run out of space and corrupt your copy of Kali!
To increase the /root partition, we must install a program called GParted Partition Manager.
To install Gparted, open a terminal by clicking the terminal icon down at the bottom of the
screen.

From the terminal windows type:


sudo apt-get install gparted

Press y and enter to start the install.


Once the install is completed, click Applications, System, GParted
Once you have Gparted open it will show to partition you your microSD card. On my
RasPad this was called /dev/mmcblk0.

As you can see, there is a bunch of unallocated space!

Next, right click on the ext4 partition (called mmcbkl0p2 on my RasPad) and left click
Resize/Move

Ds dfs df

s dfds

Expand the drive to the maximum size, and click Resize.


Next click the arrow that says “Apply All Operations”

It will ask if you are sure you want to do this. Click Apply.

Once it is completed, it will give a Completed Operations message. Click Close. Then exit out
of Gparted.
Step 8 (optional) – Installing VNC on your RasPad
This step is not necessary if you don’t want to remotely control the RasPad from another
device. I will do it so that I can show you how it is installed, and be able to take some higher
quality screen shots going forward.
Rather than reinvent the wheel, I refer you this website. Follow the instructions step-by-step
and it will enable VNC.
https://dephace.com/install-vnc-viewer-on-raspberry-pi-with-kali-linux/

I know this is a LOT of stuff to type in the terminal window. Just take is slowly and double
check what you type to ensure that it is correct. It will be WELL worth it when you are able to
VNC into the Raspad!
Also make sure you restart your RasPad after completing these steps. Then try to VNC into the
RasPad. It should work now!
Step 9. Disable Screen Lock
One of the annoying things that I noticed, was that when the screen saver enabled, I would lose
access to VNC, and have to type in a password on the device. Since there is no onscreen
keyboard, this is really annoying. So we will turn it off!
To do this, go to Setting, and Power Manager.
The first thing we want to turn off is having the Raspad hibernate. This can be done by going
the Display tab and sliding the “Switch off after” to Never.

Then go the Security tab, and setting “Automatically lock the session:” to Never.

Step 10 – Get Bluetooth working.


If you bought the RasPad kit that included the Keyboard/Trackpad, you will probably
want to get this working.
To do this, open a terminal window and type:
apt-get install blueman
Then you need to open the Bluetooth Manager. To do this, go to Applications, Setting,
Bluetooth Manager.

Make sure your keyboard is powered on, Press Fn and C. That will put your keyboard in pairing
mode. On your RasPad, click Search to Search for Bluetooth Devices

Select the Bluetooth 3.0 Keyboard and Click Setup. It will open a pairing wizard.
Pair Device is selected by default. Click Next
It will then say “Pairing in progress”. Type in the code that was displayed on the screen on the
wireless keyboard and press Enter

At this point it will say Connect to: Select Human Interface Device Service (HID) and Click Next.
It will then say Device added and connected successfully. Click Close.

Your wireless keyboard and touchpad now should work!

Note – Sometimes when you reboot, it will not automatically reconnect to the keyboard. If it
does this, put your keyboard in pairing mode (Fn + C), then click on the Bluetooth icon in the
upper right hand of the screen. Go down to Recent Connections, and Human Interface Device
Service. It should then reconnect and the keyboard should work.
Step 11 – Changing the root password
We really need to change the root password to something else.
To do this, open a terminal window and type:
passwd root

It will ask you to type in a new password, and then to confirm it.
The root password is changed.

Step 12 – Getting Kali to automatically log in when booting up.

The way kali works by default, it prompts for an ID and password when it boots up. This can
really be annoying on a touch based device like the RasPad. So let’s turn it off.
The information below is based upon this website:
https://whitedome.com.au/re4son/topic/enable-auto-login/

Open a Terminal window, then type the following:

The information below is based upon this website:


/usr/local/src/re4son-kernel_4*/re4son-pi-tft-setup -a root

You will see a screen like this. Press Y and the Raspad will reboot. (Note It took about 2 minutes to
reboot).
Once the RasPad boots back up, it will go directly to the desktop without asking for you to log
in.

Step 13 – Making items larger to ease touchscreen usage.


Now that we have the RasPad up and running, let’s make things a bit larger so that it is easier to
use that nice touch screen.
Keep in mind that these are personal preferences. You can adjust them to fit your needs.

Go to Applications, Settings, Appearance.

Click on the Fonts tab, and change the DPI. I found around 145-150 was a good size to be
touch screen friendly.

Change the DPI and click close.


Now Click on the Applications menu and notice the difference.

Now we should make the “Start Menu” a little bit bigger for ease of use. Click Applications,
Setting, and Panel.
I have found that we only need to make the menu just slightly bigger to be touch friendly.

In the Display Tab, underneath Measurements, change the Row Size to 35 and click close. I
found that any larger than that, then it begins to run into the applications menu and I was
accidentally opening programs.

Step 14 – Adding Synaptic to your RasPad.


Up to this point, we have been adding programs via command line, however there is a great
program called Synaptic that makes installing apps as easy as click and install!
Open the terminal window and type:
apt-get install synaptic

Now before opening Synaptic, we need to import some GPG keys. We will be adding some
additional sources to Synaptic, and this step is essential to make this work.
So from the terminal window type these 3 commands:
wget http://archive.raspberrypi.org/debian/raspberrypi.gpg.key
apt-key add raspberrypi.gpg.key
wget https://archive.raspbian.org/raspbian.public.key -O - | sudo apt-key add -

You can close the terminal windows now

Once Synaptic is installed (and the GPG keys are added), you can open Synaptic under
Applications, System, Synaptic Package Manager

Now we want to add some additional sources. To do this click Settings, Repositories
Once the Repositories windows opens. Maximize the Repositories window to see it better.
Then click New, and type in the following (be mindful of spaces).
URI:

http://archive.raspberrypi.org/debian

Distribution:

stretch

Section(s):

ui main

It should look like this:

Click New again and type in the following:


URI:

http://mirrordirector.raspbian.org/raspbian

Distribution:

stretch
Section(s):

rpi non-free contrib main

Click OK to close the Repositories window.


It will say Repositories Changed. Click Reload.
Step 15 (optional) – Adding programming languages to the RasPad.
The following program languages shipped with Sunfounder’s 8GB Raspian image

Now that we have Synaptic installed, we can simply search for each of them and install them
one at a time. Since this is a bit repetitious, I will only show you how to install the first one on
the list (Blue J).
So in Synaptic, click on the Search button and type in BlueJ, and click search.

Once it finds the program, right click on it, and left click Mark for Installation.
Sometimes it brings up a message to Mark additional required changes, click Mark

Then Click Apply

It will ask you if you want to apply the following changes. Click Apply.

At this point it will download and install the software.

That pretty much it. Just repeat the same process for any other software you want to install.
Step 16 – Prerequisites before installing Sunfounder’s Dragit software
I’m finding that it is quite a challenge to get the Dragit software working. The further I dig, the
more I seem to need.
To start with, we will need the Raspi-Config software. This allows us to change a number of
settings like enabling SSH access, to setting the time. In this case, we need to enable I2C.
So Open the Terminal window and type in the following:
apt-get install raspi-config

apt-get install python-smbus

apt-get install python2

raspi-config

It will bring up the Raspberry Pi Software Configuration Tool. Keep in mind that I have a Raspberry PI
3B+. These menus may look differently on the 3B.

For Raspberry Pi 3B users, you may want to refer to this Sunfounder link:

https://www.sunfounder.com/learn/appendix-1-i2c-configuration-sensor-kit-v2-0-for-b.html

Select 5, Interfacing Options


Select P5, I2C Enable/Disable Automatic loading of I2C kernel module

Would you like the ARM I2C interface to be enabled? Select Yes.

It will then give a message that it is enabled.


Select Finish to close the Raspberry Pi Configuration Tool

Step 17 – Installing the Sunfounder GPIO program.


Now that we have a working RasPad, we need to get some of the more advanced features
working. To begin with, we need to be able to see the status of the GPIO pins. Sunfounder
has written a really great script to do this via the terminal window.
Detailed information can be found here on Sunfounder’s website:
https://www.sunfounder.com/learn/sensor-kit-v2-0-for-raspberry-pi-b-plus/introduction-
sensor-kit-v2-0-for-b-plus.html

So to install this script, do the following from a terminal window:


git clone git://git.drogon.net/wiringPi
It will download the script to the Raspad.
Once downloaded do the following (one at a time):
cd wiringPi

git pull origin

./build

It will then compile and install the GPIO program.


Next from the terminal window type:

gpio readall

It should then show you all listing of each GPIO pin.


Step 18 – Install the Sunfounder Dragit Software (Not working at this point)

All of this work has been building to this point. Now we can begin to actually do something with this
RasPad. So next we are going to install Sunfounder’s new programming language Dragit.

More detailed information can be found on Sunfounder’s website here:


https://www.sunfounder.com/learn/download/VXNpbmdfU2Vuc29yX2tpdF93aXRoX0RyYWdpdF8ucGR
m/dispi

To get Dragit installed, open a Terminal window and type in the following:

wget https://s3.amazonaws.com/sunfounder/Raspberry/dragit_installer.py

It will then download the software to your RasPad. Once it is done downloading type the following:

python dragit_installer.py

It will bring an installer. Dragit is already selected by default. Just press Tab and the cursor
will go down to OK. Then press Enter.
It will then install the Dragit software.

At this point you need to reboot your Raspad for the changes to take effect.

Once your Raspad is rebooted, you should be able to open the Firefox browser and type:
localhost:8000 and Dragit will load.

Note - As of this writing, I was not able to get dragit to load. I am working with Sunfounder
to find a fix.
-All went perfectly until step 10 Bluetooth. Typed in the apt-get install blueman when prompted and got lots of
fetch errors. At the end of these it suggested running apt-get update. I did this and that ran OK. Then retried the
blueman install and it worked. Continuing now with rest of the install.

-I probably should add and apt-get update prior to having you run the commands. That kind of runs a refresh with
the servers and checks to see if there are any updates to any of the installed apps.

-I actually rebuilt my RadPad from scratch (no pun intended) for this R2 revision to make sure I didn't miss anything.
I had not installed Scratch yet, so I just now went to Synaptic and searched for Scratch. It was way down on the list,
but I was able to select and install Scratch and Scratch 2.

-Linux is case sensitive. Also keep that in mind when typing in commands in the terminal window.

-These are the 3 commands you need to type in to add the additional sources. I recommend setting up VNC and
connecting to your RasPad via VNC. Then you can simply copy and paste those commands directly into the terminal
window.
wget http://archive.raspberrypi.org/debian/raspberrypi.gpg.key
apt-key add raspberrypi.gpg.key
wget https://archive.raspbian.org/raspbian.public.key -O - | sudo apt-key add -

-You will get errors and some software will not show up in synaptic if you don't import those gpg keys and then add
the repositories. Linux is unforgiving. An extra space or a Capital letter and it won't work correctly

You might also like