Page 4 of 11

Cyberforensics Conference, Glasgow, June 2014

In June, I attended the Cyberforensics 2014 conference in Glasgow.  The conference was spread over two days, and featured talks from academics, companies and those involved with law enforcement e.g. members of Police Scotland, Royal Bank of Scotland and NCC group were in attendance.  One of the talks that sticks in mind was entitled “Temporal Analysis Anomalies with iOS iMessage Communication Exchange” by Kenneth Ovens – I found it particularly interesting (for starters, I was completely unaware the Messages app utilised SQLite).

The conference proved to be a valuable experience in terms of my PhD work, providing me with the opportunity to network with other researchers in the field.  Constructive criticism regarding my presentation has given me some issues to consider when working on my research too.  I really enjoyed the conference and I’m looking forward to attending it next year.

Link to papers-

Keeping the Raspberry Pi Connected via Wi-fi

A few months ago, I set-up my Raspberry Pi with a wi-fi adapter. More recently, I’ve noticed that the wi-fi connection occasionally drops out, and the adapter never attempts to reconnect to the network. This is a problem if I’m trying to access the Pi via SSH.

At this stage, I’m still unsure as to why the wi-fi drops out. Initially, I thought there was an issue with my interfaces file however, adding “auto wlan0” to it in an attempt to force a reconnect failed. Trawling through the syslog files revealed that when the wi-fi dropped, a “link beat lost” message was recorded. I was fairly certain it wasn’t a power supply issue messing with the USB ports so my next idea was to create a cron job to check the status of the wi-fi adapter. This solution worked and I have outlined the steps I used below.

First of all, you need to create a new bash script in the following location (note, I’m using nano as my text editor):

cd ~
sudo nano ../../usr/local/bin/

The file has the following permission (the user can execute the file)

sudo chmod 0100 ../../usr/local/bin/

Next up, here’s the script I used to check the status of the wi-fi connection. What does it do? The Pi attempts to ping Google. If the Pi cannot successfully ping Google, then the script ensures the wi-fi interface is down before bringing it back up. Else, the wi-fi is connected and no action needs to be taken (yay!).

ping -c4 ${TESTIP} > /dev/null
if [ $? != 0 ]
    logger -t $0 "WiFi has gone down- run ifup"
    ifdown --force wlan0
    ifup wlan0
        logger -t $0 "WiFi is currently ok"

Now we need to create a new cron job to schedule when the wifi script runs. The new cron job goes here:

cd ~
nano ../../etc/crontab

How to add the new cron job to crontab:

*/5 * * * * root    /usr/local/bin/ >> /var/log/syslog 2>&1

The above line writes all the messages generated by the file to the syslog file (so “WiFi has gone down- run ifup” or “WiFi is currently ok”). The cron job is also scheduled to run every 5 minutes.

…and that should be it! Well, not quite. It’s probably a good idea to test if the script actually works.

Take the wi-fi interface down:

ifdown wlan0

Of course, this will break your SSH connection. Wait 5 minutes and the wi-fi interface should come back up, allowing you to SSH back into the Pi.

One last check. Have a look at the syslog file. You should see where the wi-fi disconnected and where it reconnected.

nano ../../var/log/syslog

Now you’re done!

Note: this is my first attempt at writing a bash script and a cron job so comments and criticism is welcome!  In the process of writing this blog post, I found Arne’s Blog to be particularly helpful.

Edimax EW-7811Un USB adapter blue light

Lego Light Shield

Recently, I purchased a couple of Edimax EW-7811Un USB adapters for both of my Raspberry Pis, making them wireless.  The Pi I use for the print server is sometimes left on overnight.  “No problem there”, you say.  Well, there is if you’re trying to sleep.  The light from the wi-fi adapter constantly blinks, indicating it’s connected.  At night, this blinking light reflects off the whiteboard in the corner of my room, and it’s rather irritating when you’re dozing off.

Now, there are multiple solutions to the problem.  1) I could turn the Pi off at night.  2) I could modify the driver and turn the light off.  3)  Lego.  Yes, Lego.

If you want to hide the blue blinking light at night, then this Lego build is for you!  Problem solved.

Wireless Raspberry Pi- Edimax EW-7811Un Guide

I recently received a second Raspberry Pi as a gift, and decided to connect it to the internet via wi-fi. Initially, I was unsure as to which wi-fi adapters were compatible with the Pi however, the community suggested the Edimax EW-7811Un USB adapter. The adapter itself is tiny, and can be purchased for less than £10.

Whilst I was trying to set it up, I came across multiple guides offering various conflicting pieces of information, so I thought I’d share what worked for me. Before I go any further, I should state I’m running the Raspbian image.

First, update the repo

$ sudo apt-get update

Then, upgrade the system

$ sudo apt-get upgrade

Next, you need to generate a wpa passphrase based upon the name of your wi-fi network and the password you use to connect to it. Note the use of quotes around the name and password- I had spaces and certain awkward characters in both the name and the password- without the quotes, incorrect values were generated. The wpa_passphrase function will return a string- take a copy of this, you’ll need it later.

$ wpa_passphrase "name of your network" 'password for your network'

The interfaces file on the Pi now needs to be edited

sudo nano /etc/network/interfaces

The following code shows the contents of my interfaces file. There were many conversations online about what this file should contain In the end, this is what worked for me.

auto lo
iface lo inet loopback
iface eth0 inet dhcp
allow-hotplug wlan0
iface wlan0 inet dhcp
wpa-ssid "network name"
wpa-psk the_string_wpa_passphrase_generated

Save the file and reboot the machine. Now the Pi should connect to your wireless home network.

« Older posts Newer posts »

© L.Shepherd 2006-2022. All rights reserved.

Modified version of Hemingway Theme by Anders Noren