Keeping the Raspberry Pi 3 clock up to date

June 27th, 2016

Raspberry Pi 3The Raspberry Pi 3 is an excellent piece of hardware. With 4 ARM A53 cores, 1Gb RAM and integrated 802.11bgn wifi, at only $35, they’re giving them away!

One of the biggest pain points when using the Pi for data acquisition is a lack of a battery backed clock. Each time the Pi boots up, it reverts to it’s manufacture date. Sure, with a working network connection we can synchronise with NTP easily enough, but what happens when we don’t have network access?

The Pi foundation deliberately avoided including a battery backed clock – it’s changes the size, adds extra circuitry and a battery, and increases the price.

How do we know when our clock is wrong? When the Pi boots up, until we’ve made a successful NTP call, our clock is wrong.

How can we prevent our clock going backwards? Use fake-hwclock. The system time is logged, and then restored on next boot to whatever it was previously. The clock will be wrong, but at least it won’t have gone backwards. This can save us from a number of code related issues.

ARPI600The other option, is to get an addon clock. After much research, I settled on the ARPI600.

First – it obviously includes the needed RTC over an I2C interface. The PDF setup guide is pretty simple and just works.

Second – it includes XBee support – a whole range of radio modules.

Third – it gives you the Arduino headers and opens up the Pi to the full Arduino ecosystem.

Fourth – it provides a USB interface for both power, and the serial UART interface, saving on that 4 wire debug cable.

The case? A bit of a problem – if anyone knows of one that will take a Pi3, ARPI600 hat and any Arduino hats, I’m all ears – until then, I’ll need to print my own.

Anyway, back to time keeping. After an initial time set with NTP, we can set our accurate time to the ARPI600 with hwclock -w

Later on after a fresh boot, we can set our clock to match that of the ARPI600 with hwclock -s. Lastly, to print out the clock on the ARPI600, it’s hwclock -r.

 

 

Fully Automatic Wireless Hacking Station

April 26th, 2013

This article describes a working all-in-one standalone mobile wireless attack station that can perform MITM type attacks on clients automatically and without any internet access or other external connectivity or influence.

In laypersons terms; this portable battery powered device can automatically entice wireless devices to connect to it, be that iPhones/iPads, Androids and other phones or laptops and PCs. Most devices will connect to it automatically without the user even realizing. The device will provide a fake network running fake email and web servers and using some network trickery, will capture the hostname, username and password of any attempted connection and log it, along with the GPS co-ordinates of where the details were captured. This device could be used to hijack corporate and personal email logins, facebook logins, and so on.

HTTPS ActiveSync


Messing around with airbase-ng, part of the aircrack-ng suite over the last few months and researching wireless client vulnerabilities has led to an interesting proof of concept project. There are several weaknesses within the current wireless technologies in widespread use. First however, an explanation of the project. The project description was to launch a wireless man in the middle (MITM) attack, without having another end to connect the victim to. We need to create a MITM attack without having any internet access. Such an attack could theoretically be used on the tube, in locked down buildings, on the move, and so on, and without the use of a mobile data card. Built on top of a modified raspberry pwn release, although any Linux distribution would have been suitable, I have set my wireless device with a power output of 30dBm and started the following automated process:

Firstly, an airbase instance on my rtl8187 card as follows;

/usr/local/sbin/airbase-ng -c 3 wlan0 –essids “/root/pen/code/scripts/essids” -P -C 60 -I 60 -vv|grep –line-buffered  “directed probe request”|tee /run/probes

This starts an access point on channel 3, beaconing the SSIDs contained within /root/pen/code/scripts/essids as well as any probe requests that the access point may receive from clients looking to connect to an access point. Now, in a little more detail, regular ‘non-hidden’ access points will broadcast ‘beacons’ which are pieces of data that specify the SSID (wireless network name) as well as the supported encryption types and so on. These beacons are usually sent every 100msec. Wireless clients will send probe packets, containing the SSIDs of all wireless networks that they have stored, and asking if any of them are here.

Raspberry Pi

Raspberry Pi

The -P switch to airbase-ng will have airbase respond to all probes saying “yes, that’s me” at which point assuming the encryption or lack thereof matches the stored profile, the client will attempt to associate. Mid way through building this test however, Apple released IOS 6, and one of the changes seems that the iPhone will now only send out broadcast probes rather than directed probes, rendering the -P feature useless against them. The broadcast probe is where the device sends out a “is anyone there?” probe, and waits to see which access points reply. Most iPhones however have connected at some point to a wireless hotspot, and so the SSIDs I chose for the essids file are “Boingo Hotspot”, “BTOpenzone” and “BTWiFi” in the UK. I believe that “attwifi” is a popular one in the US.

Read the rest of this entry »

Raspberry Pwn

October 15th, 2012

I’ve recently acquired two Raspberry Pi boards along with power supplies and a nice case. I was attracted by the price and the processing power/RAM vs power consumption. The first thing I was interested to install was the Raspberry Pwn release. I wouldn’t call it a distro as such, it’s more of a script that just downloads tools that most pen testers would download themselves at some point. The Raspberry Pwn site advises that it is not compatible with ‘Raspbian’ which is the newer release shown on the Raspberry Pi site, although I couldn’t see a reason why. I downloaded the installer and ran it manually line by line some time ago, and I remember it running correctly and without issue. There were a few changes to the aptitude installs to address missing packages and I also gave up trying to download the exploitdb through SVN at the end of the script as it seems to be permanently down. I also downloaded aircrack, dnsmasq, compat-wireless, mdk3-v6, nmap, mitmproxy, reaver, and sqlmap.

[nggallery id=3]
Read the rest of this entry »