Kali 2.0 Dojo Black Hat USA 2015 – Offensive Security

https://www.offensive-security.com/kali-linux/kali-dojo-bhusa-2015/

http://docs.kali.org/kali-on-arm/install-kali-linux-arm-raspberry-pi

The Raspberry Pi is a low-cost, credit-card-sized ARM computer. Despite being a good bit less powerful than a laptop or desktop PC, its affordability makes it an excellent option for a tiny Linux system and it can do far more than act as a media hub.

The Raspberry Pi provides a SD card slot for mass storage and will attempt to boot off that device when the board is powered on.

By default, the Kali Linux Raspberry Pi image has been streamlined with the minimum tools, similar to all the other ARM images. If you wish to upgrade the installation to a standard desktop installation, you can include the extra tools by installing the kali-linux-fullmetapackage. For more information on metapackages, please refer to our tools page.

Kali Linux on Raspberry Pi — Pre-built Version

If you’re unfamiliar with the details of downloading and validating a Kali Linux image, or forusing that image to create a bootable device, it’s strongly recommended that you refer to the more detailed procedures described in the specific articles on those subjects.

To install a prebuilt image of the standard build of Kali Linux on your Raspberry Pi, the general process goes as follows:

  1. Get a fast SD card with at least 8 GB capacity. Class 10 cards are highly recommended.
  2. Download and validate the Kali Linux Raspberry Pi image from the Offensive Securitydownloads area. The process for validating an image is described in more detail in the article on  “Downloading Kali Linux”.
  3. Use the dd utility to image this file to your SD card. The full process for creating a bootable USB or SD device is described in the article on “Making a Kali Live USB Drive”. In the following example, we assume that the image is named “kali-1.0.9-rpi.img”, that it’s is in your current working directory, and that the SD card is located at /dev/sdb. Donot simply copy these value, change this to the correct drive path corresponding to your SD card.
WARNING! This command will overwrite any existing data on your SD card. If you specify the wrong device path, you could wipe out your computer’s hard disk!
root@kali:~ dd if=kali-1.0.9-rpi.img of=/dev/sdb bs=512k

This process can take a while depending on your SD card’s device speed and image size. Once the dd operation is complete, insert the SD card into the Raspberry Pi and power it on.

You should be able to log into Kali (as user root, using the password toor) and execute thestartx command at the shell prompt to start up the XFCE desktop environment.

IMPORTANT! Please change your SSH host keys as soon as possible as all ARM images are pre-configured the same keys. You should also change the root password to something more secure, especially if this machine will be publicly accessible!

Changing the SSH host keys can be accomplished by doing the following:

root@kali:~ rm /etc/ssh/ssh_host_*
root@kali:~ dpkg-reconfigure openssh-server
root@kali:~ service ssh restart

Kali Linux on Raspberry Pi — Custom Build

If you are a developer and want to tinker with the Kali Raspberry Pi image, including changing the kernel configuration, customizing the packages included, or making other modifications, you can work with the rpi.sh script in the kali-arm-build-scripts repository on github, and follow the README.md file’s instructions.

You will need to set up an ARM cross-compilation environment before you can build a Raspberry Pi image of Kali Linux. A general overview of the build process for ARM devices can be found in the article on “Preparing a Kali Linux ARM chroot”.

 

TFT touch screen support request from the Kali Forums

Several weeks ago a request in the Kali forums prompted us to look at the integration of the Adafruit 2.8in TFT touch screen for Kali Linux. A few weeks and much less hair later, we are happy to announce the availability of this image in our Offensive Security custom Kali images section.

Great for various Raspberry Pi projects

Although slightly on the expensive side – especially compared to the Raspberry Pi itself – a small functional touch screen that can do a whopping 320×240 resolution can be extremely useful at times. We used it in one of our hardware projects and implemented a couple of Desktop shortcuts that would “start” and “stop” our automated tool, giving us both an input and output source.

rpitft_kali-1024x682_optimised

Source code for the Kali Raspberry Pi TFT touch screen image

Due to the nature of the patches and image configuration, we had to build a separate image for the TFT Kali Raspberry Pi image. However, our build script for this image can easily be modified to accommodate any changes you may require. As with all our custom Kali Linux ARM images, we can find the source of the build script in our Offsec github page.

 

Originally published at The Scotto Grotto. You can comment here or there.

RPI-Wireless-Hotspot (via – http://elinux.org/RPI-Wireless-Hotspot)

Contents

What does it do?

This project configures your Raspberry Pi to connect to the Internet through ethernet, and share that connection over WiFi.

What do you need?

  • A Raspberry Pi, model B.
  • A boot SD card for the Raspberry Pi.
  • A USB WiFi device that supports “Access Point” mode.
  • An Ethernet cable to connect to the local network.

Please make sure you Wifi dongle supports Access Point or Master Mode

  • Edimax does NOT support Access Point (UPDATE 7/9/13: Edimax DOES support Access point, tutorial here: Raspberry Hotspot with Edimax USB WiFi Adapter)
  • AirLink 101 / AWL5088 does NOT support Access Point
  • Panda Ultra, Mid-Range and 300Mbps Wireless N adapters support Access Point
  • Ralink RT5370 and RT5372 DO support Access Point

What skill level is required?

This project does not require any coding or compilation. Very basic Linux and networking knowledge would be useful, but not essential.

To edit a configuration file (for example /etc/udhcpd.conf) use the following command

sudo nano /etc/udhcpd.conf

You will find yourself in a simple editor. Move around using the arrow keys. To save the file press Ctrl-o. To exit press Ctrl-x.

How does it work?

The Raspberry Pi is configured as a WiFi Hotspot, just like you would see in an internet cafe. It allows you to connect to the internet over WiFi using the Raspberry Pi as the bridge to the internet. The basic steps are

  • Enable a WiFi Access Point and broadcast on the channel of your choice
  • Assign dynamic IP addresses to any device that connects to WiFi network
  • Join the WiFi and Ethernet networks together by using Network Address Translation

Instructions

The following steps were performed on Raspbian but should be much the same on any Debian-based distro.

1. Install the necessary software.

sudo apt-get install hostapd udhcpd

2. Configure DHCP. Edit the file /etc/udhcpd.conf and configure it like this:

start 192.168.42.2 # This is the range of IPs that the hostspot will give to client devices.
end 192.168.42.20
interface wlan0 # The device uDHCP listens on.
remaining yes
opt dns 8.8.8.8 4.2.2.2 # The DNS servers client devices will use.
opt subnet 255.255.255.0
opt router 192.168.42.1 # The Pi's IP address on wlan0 which we will set up shortly.
opt lease 864000 # 10 day DHCP lease time in seconds

Edit the file /etc/default/udhcpd and change the line:

DHCPD_ENABLED="no"

to

#DHCPD_ENABLED="no"

You will need to give the Pi a static IP address with the following command:

sudo ifconfig wlan0 192.168.42.1

To set this up automatically on boot, edit the file /etc/network/interfaces and replace the line “iface wlan0 inet dhcp” to:

iface wlan0 inet static
  address 192.168.42.1
  netmask 255.255.255.0

If the line “iface wlan0 inet dhcp” is not present, add the above lines to the bottom of the file.

Change the lines (they probably won’t all be next to each other):

allow-hotplug wlan0
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet manual

to:

#allow-hotplug wlan0
#wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
#iface default inet dhcp

3. Configure HostAPD. You can create an open network, or a WPA-secured network. A secure network is recommended to prevent unauthorized use and tampering, but you can also create an open network. To create a WPA-secured network, edit the file /etc/hostapd/hostapd.conf (create it if it doesn’t exist) and add the following lines:

interface=wlan0
driver=nl80211
ssid=My_AP
hw_mode=g
channel=6
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=My_Passphrase
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP

Change ssid=, channel=, and wpa_passphrase= to values of your choice. SSID is the hotspot’s name which is broadcast to other devices, channel is what frequency the hotspot will run on, wpa_passphrase is the password for the wireless network. For many, many more options see the file /usr/share/doc/hostapd/examples/hostapd.conf.gz

If you would like to create an open network, put the following text into /etc/hostapd/hostapd.conf:

interface=wlan0
ssid=My_AP
hw_mode=g
channel=6
auth_algs=1
wmm_enabled=0

Change ssid= and channel= to values of your choice. Note that anyone will be able to connect to your network, which is generally not a good idea. Also, some regions will hold an access point’s owner responsible for any traffic that passes though an open wireless network, regardless of who actually caused that traffic.

Edit the file /etc/default/hostapd and change the line:

#DAEMON_CONF=""

to:

DAEMON_CONF="/etc/hostapd/hostapd.conf"

4. Configure NAT (Network Address Translation). NAT is a technique that allows several devices to use a single connection to the internet. Linux supports NAT using Netfilter (also known as iptables) and is fairly easy to set up. First, enable IP forwarding in the kernel:

sudo sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward"

To set this up automatically on boot, edit the file /etc/sysctl.conf and add the following line to the bottom of the file:

net.ipv4.ip_forward=1

Second, to enable NAT in the kernel, run the following commands:

sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
sudo iptables -A FORWARD -i eth0 -o wlan0 -m state --state RELATED,ESTABLISHED -j ACCEPT
sudo iptables -A FORWARD -i wlan0 -o eth0 -j ACCEPT

These instructions don’t give a good solution for rerouting https and for URLs referring to a page inside a domain, like www.nu.nl/38274.htm. The user will see a 404 error. Your Pi is now NAT-ing. To make this permanent so you don’t have to run the commands after each reboot, run the following command:

sudo sh -c "iptables-save > /etc/iptables.ipv4.nat"

Now edit the file /etc/network/interfaces and add the following line to the bottom of the file:

up iptables-restore < /etc/iptables.ipv4.nat

5. Fire it up! Run the following commands to start the access point:

sudo service hostapd start
sudo service udhcpd start

Your Pi should now be hosting a wireless hotspot. To get the hotspot to start on boot, run these additional commands:

sudo update-rc.d hostapd enable
sudo update-rc.d udhcpd enable

At the completion of these instructions, your Pi should be providing a wireless network and allowing other devices to connect to the Internet. From my experience, the Pi makes a decent access point, although with cheaper WiFi dongles range will be fairly limited. I haven’t stress tested this setup, but it seems to work fairly well and is handy when a “real” access point isn’t available. I wrote most of the instructions from memory, if you find any errors/typos I’ll correct them.

This tutorial originally was a post on the Raspberry Pi forum here, you can reply to that topic if you have issues. Thanks go to all the people who tested my tutorial on the forum, and to poing who contributed the WPA HostAPD config.
Please make sure you Wifi dongle supports Access Point or Master Mode

  • Edimax doesn’t support Access Point (UPDATE 7/9/13: Edimax DOES support Access point, tutorial here: Raspberry Hotspot with Edimax USB WiFi Adapter)
  • AirLink 101 / AWL5088 doesn’t support Access Point
  • Panda Ultra, Mid-Range and 300Mbps Wireless N Adapters support Access Point
  • Ralink RT5370 supports Access Point

via – http://elinux.org/RPI-Wireless-Hotspot

 


see also  – http://itsacleanmachine.blogspot.com/2013/02/wifi-access-point-with-raspberry-pi.html

http://qcktech.blogspot.com/2012/08/raspberry-pi-as-router.html

https://github.com/scottobear/rpi-update

 

Originally published at The Scotto Grotto. You can comment here or there.