PDA

View Full Version : RaspberryPi fun with Kali Linux



ijnnji
2013-03-27, 19:50
I received my first Raspberry Pi last summer and have been learning and building since. I have just been installing the packages I needed; SSLStrip, Ngrep, Dsniff, SET, BEef, Reaver, etc. It is great to see the new Kali Linux version released. I would like to share a particular project that I started as a school project but has become much more. This has been a learning experience and I am most accurately not a programmer. Hopefully this will inspire much better code than I am capable of devising right now as well as spark discussion and bring outside insight to the concept.

Using a combination of a few tutorials of the Raspberry Pi, listed below, I have been able to build a small PCB board with an LCD module as a display and programmable buttons that can start Python or Bash scripts, Metasploit resource files, or whatever. I have also been using PHP and HTML to view log files, execute scripts, start and stop services, or kill processes. I have even written a script using airbase to create an access point and bridge it with the Ethernet interface. Oh, and it is also running on battery power. (A must for covert operations.)

Here are some pictures and video of my Raspberry Pi project. (I know you could totally do a better job than I did!)

Screen Shots
http://1ijnnji1.blogspot.com (http://1ijnnji1.blogspot.com/)


https://vimeo.com/62804569



Using a button to start a script is very simple.
http://learn.adafruit.com/playing-sounds-and-using-buttons-with-raspberry-pi/overview
(http://learn.adafruit.com/playing-sounds-and-using-buttons-with-raspberry-pi/overview)


#!/usr/bin/python

from time import sleep
import os
import RPi.GPIO as GPIO

GPIO.setmode(GPIO.BCM)
GPIO.setup(10, GPIO.IN)
GPIO.setup(9, GPIO.IN)
GPIO.setup(11, GPIO.IN)

while True:
if ( GPIO.input(9) == False ):
os.system('./startUrlsnaf.sh &')
if ( GPIO.input(10) == False ):
os.system('msfconsole –r /root/PWNED &')
if ( GPIO.input(11) == False ):
os.system('echo "123456" >> hello.txt')
sleep(1);



Next I thought it would be great if I could use an LCD module to display what scripts are running or display the IP Address at boot time. There are many ways to call the LCD script; buttons, PHP, etc.

http://www.raspberrypi-spy.co.uk/2012/07/16x2-lcd-module-control-using-python/


You can run these display and button scripts at boot time. So the buttons will work as soon as the boot process has finished.

This is also a good time to have the Raspberry Pi use autossh to connect to a relay server to create an SSH session behind a firewall.


autossh –M 20000 –N –R 4444:localhost:22 bob@RelayServer

SSH into the Relay Server and control the Raspberry Pi via a proxy with browser or directly use the shell.


ssh bob@RelayServer –p 4444 –D 8080


Very Simple PHP example (I have been using an HTML page with a hyperlink to the PHP page.)


<?php
/* Redirect browser */
header("Location: http:/index.html");
shell_exec("sudo /root/PYTHON/yourScript.sh start");
shell_exec("sudo /root/PYTHON/yourScript.sh start");
?>



Very simple stuff but I am just throwing some fresh ideas out there and sharing.
Of course it would be impossible to list everything that I have done with this
project or go into greater detail here. I just hope this will spark some ideas/discussions.

northpole
2013-04-10, 10:12
Nice one. I too have an 16x2 LCD lying around. Should try connecting it to my RPi.