Archive for the ‘Projects’ Category

h1

Creating a Simple Linux Webcam Server

31/05/2013

Whether you’re needing to create your own security camera, or you’re wanting to set up an always-on web video, having constant, recorded video feed can be useful. It’s even more so if you can access it while you’re not at home, say, over the internet. That’s what I did a few weeks ago, with an old computer (Crusher) that I’ve been using as a file server. Now it’s pulling double duty as a constantly-streaming video service that broadcasts over the internet.

See and Record from anywhere

See and Record from anywhere

Now, this setup is quite simple, and as such has a few drawbacks. There is no security implemented in this guide, though that can be done fairly easily afterwards. There is a little bit of upkeep, and it doesn’t do everything on its own (such as file cleanup). On the flipside, it’s not very resource intensive, records everything, can be set up, sent off and running in an afternoon and is extremely stable. I’d also like to mention that it’s dirt cheap, as this can be put on almost any machine made in the last decade.

If these strengths and weaknesses sound like what you’re trying to do, here’s how to put it together.

The Tools

What you’ll need:

  • A PC with at least one free USB port.
  • Ubuntu Linux 10.04LTS or later installed.
  • A Linux-compatible webcam.
  • Access to the internet (from the PC).
  • A Router that can support Virtual Servers or Port Forwarding.

The USB port can be 1.1 or higher. Most webcams don’t push through enough data to really need the higher speeds. Though if you did get a higher-resolution webcam, then make sure you’re attaching it to a port that can handle the load.

This old Dell Optiplex GX1 is enough power to run both a Linux fileserver and webcam server.

This old Dell Optiplex GX1 is enough power to run both a Linux fileserver and webcam server.

In my case, I’m assuming that you picked up a really cheap webecam. For my purposes, I chose the Logitech C200. Everything Logitech is pretty much plug-n-play (ie “It just works”) with Linux. You can pick up that cam for about $12-20, but there are even less expensive ones out there that will function just as well.

The PC that I’m showing you this on is a very old one (Pentium 3-era) with about 512MB of RAM and running Ubuntu 10.04 LTS (server repositories). Now, 10.04 is out of date as of this writing, but I’ve since migrated the repositories over to the sever versions. This guide will still work on 12.04, as I tested it on that system as well, but for the sake of consistency, I’ll be showing you everything from my actual server’s view.

The router needs to support port-forwarding or virtual servers for you to be able to get to it from the internet. If you’re not worried about that, then you can ignore this requirement. Most routers support this anyway, so you’re probably fine. In either case, your “server” will need to able to access the internet.

Motion Setup

Booting your computer with the webcam plugged in should be sufficient to register it in the system. To find out if it is indeed in the system, use the lsusb command (List USB) to see all of the devices connected to your computer via USB. You should get output that says something like the following:

cjjulius@CRUSHER:~$ lsusb
Bus 001 Device 002: ID 046d:0802 Logitech, Inc.
Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

The Logitech device is being registered by the system. If you don’t see your device here, then you’re most likely looking at a hardware issue, as Logitech uses the standard uvcvideo drivers and software-wise sets up very smoothly. If you’re not using Logitech and you’re not seeing your device here, then you’ve got some troubleshooting to do.

Next, we’ll need to find out where in the system our camera is mounted so we can point our software to it. Use the following command to see where your usb device is currently mounted. Basically this command lists all the devices connected to your system, then sends that to the grep tool which in turn filters everything out but devices with the word “video” in them.

cjjulius@CRUSHER:~$ ls /dev/ | grep video
video1

Make a note of this device’s lotion, which in my case is: /dev/video1

Now we need to install motion, our webcam recording software. So, we’ll act as a superuser, telling aptitude to get the software from the repositories and install it:

sudo apt-get install motion

Then we’ll go to the configuration file and edit it, so we can point motion to our webcam and maybe edit a few options. First I’ll copy a backup (in case we goof) and then we’ll edit the original. You can use either nano or gedit, depending on your preference. I’ll use nano, because it is low-resource and Crusher is an old computer doing a lot of stuff. Again, we’ll need to act as a superuser to do so.

sudo cp /etc/motion/motion.conf /etc/motion/montion.conf.bak
sudo nano /etc/motion/motion.conf

In here are a lot of options, and some you’ll probably want to tweak at a later date. Right now we’re just interested in getting this thing rolling and we don’t want to get bogged down in the details. We’re looking for a line labeled “videodevice” under the “Capture Devices” heading. It should be pretty close to the top.

On the same line as videodevice, we want the /dev/video0 line to point to our webcam that we found earlier. So, in my case it reads:

videodevice /dev/video1

Your device line should look something like this in motion.conf

Your videodevice line should look something like this in motion.conf

Save the file and exit the editor. Again, there are lots of options in here (including password protection) but we’re not interested in that right now. We just want to get a simple webcam server up and going, though I encourage you to come back and tweak the settings, or at the very least see what you can do with this program.

Now, you can run motion by simply typing “motion” at the command line. Remember that motion stores video streams as .jpgs and uses the folder you run the command from to store the files. This can fill up smaller drives very quickly.

My method to deal with this is simple, but isn’t elegant. I navigate to the Trash folder and run motion from there. Then, when I want to clear the files, I just log in and empty the trash.

cd ~/.local/Trash/files/
motion

Webcam Viewing

Assuming that motion is now running successfully in your terminal, we can see what your camera is seeing. Open a browser and go to http://127.0.0.1:8081

If you go to any other computer on your network, you can simply put into your browser the following to see your webcam:

(PC's IP address):8081

If you don’t know your Webcam Server’s IP address, we can look at the interface configuration output and filter it for an internet address. You can do this by opening a terminal and typing:

ifconfig | grep "inet addr"

It should be the first one on the first line. Not the 127.0.0.1 line. In my case it’s 192.168.100.6

But, if we’re away from the building with the webcam, that’s not very helpful. We want to be able to access our server from anywhere in the world. So, we need to set up a method of getting to our home machine from elsewhere.

First, we need to forward the appropriate ports so we can see the video stream. Motion, by default, uses only the one you saw before: 8081. We just need to get our router to connect the dots between any connection that comes in from the internet on that port, with our server.

This is what mine looks like, but they're all a little bit different.

This is what mine looks like, but they’re all a little bit different.

Go into your router’s settings page, in my case it’s an Arris modem/router, and go to the Firewall/NAT page (or something like it). Look for “Port Forwarding” or “Virtual Servers”. Select that you want to “Add New”.

Use the 8081-8081 range for both incoming and local ports and then put the local PC’s IP address that we got with the ifconfig above. The description can be anything.

Now, if you go outside your network, you can put in your own home IP address with the :8081 on the end and connect to your webcam. If you don’t know your outside IP address go to a site like WhatisMyIP.com and it will tell you.

Again, this is all well and good, but your IP can change, and even if it doesn’t for a while, that number is hard to remember. So, as our last step, let’s make this more human-readable and dynamic. We’ll go get a free dynamic DNS account and use it to redirect traffic from a more user-friendly name. Keep in mind that while useful, this is still an option and you can still use the IP web address [Your Outside IP]:8081 to get to your webcam.

This is approximately what the Dynamic DNS redirect setup should look like.

This is approximately what the Dynamic DNS redirect setup should look like.

Go to a site like NoIP.com and sign up for a free account. Select that you want to Add a Host and then come up with a unique hostname and use one of the default domains; usually only a few are available for free. You should see your outside IP listed in the box.*

Set it to a port 80 redirect and that you want it to connect to port 8081. You can also mask the URL if you want, but I’ve found that rarely works. Add the host and you should be good to go. Now pointing any browser to your no-ip domain name (without the :8081 on the end) will pipe you from anywhere to your webcam server.

And that’s it, you can go to any computer that has internet access and see what’s going on wherever you set up your webcam.

*I chose NoIP because they have a Linux software package that will update the IP your redirect is associated with automatically. Eventually, your IP is going to rotate and it’s nice to have that piece of software watching that for you. See their page for instructions on how to install it.

-CJ Julius

h1

The Easiest Way to Root a Galaxy Note 10.1

27/05/2013
Unlocking your Samsung Galaxy Note 10.1 (Proceed with Caution)

Proceed with Caution

Rooting your device is a pretty dangerous game, even nowadays when it’s almost commonplace. You can lose your data, void your warranty or even brick your device. However, if you’re looking to really unlock the power of your Android tablet, there’s really no better way. It gives you unparalleled access to your files, ability to install apps that do some pretty amazing things, or even install your own OS aside from Android.

So, obvious warnings aside (above), I want to show you the easiest way I’ve found to root the Galaxy Note 10.1, my favorite tablet. Ideally, you’ll lose no information and really not notice much of a change to the OS, excluding a new app that manages root access. It’s also really quick (maybe 30 minutes at most).

However, one last time, I am pointing out that this can destroy everything, and is just here for your edification; I take no responsibility for you turning your Galaxy Note into a dinner tray.

The Tools

There are four pieces of software and two pieces of hardware that you’ll need for this.

Software:

  1. Windows – Sorry, but you’ll need to use Windows Vista or later (I haven’t tried on XP, so I have no idea, but I imagine it will work)
  2. Android 2.2 or later – Works all the way up to Jellybean 4.1 that I’ve tested.
  3. Samsung Kies – This is the software that you’ll need to set up your computer to modify the system files we’re going to be changing. [Download]
  4. CF-AutoRoot – The rooting software itself, just open this link in a tab and we’ll get back to what you need later. [Download]

Hardware:

  1. Samsung Galaxy Note 10.1 – Your tablet, durh.
  2. Charging Cable – Has a 30-pin connector on one end and a USB on the other.

The Process

First of all, install Samsung Kies if you haven’t already. At the end of the install select the option that you don’t want to launch it (there’s no reason to, we’re not going to be directly using it) and to launch in Normal Mode. That’s all we’re doing with that.

This is what it should look like if you've done it right.

This is what it should look like if you’ve done it right.

On your tablet, open Settings and go to the “About Device” page, usually located at the bottom of the options. You can see your Android version here (make sure it falls in the range listed in tools) and the Model Number. It should be something like GT-N8xxx. Remember this model number.

Look at the page for the CF-AutoRoot forum that is listed above and find a link with your model number in the third post. It must EXACTLY match that number. Download that zip file and unpack it somewhere.

Now, on your tablet, hold in the Power Button and the Volume Down button for about 10 seconds. Your tablet will take a screenshot and then reboot. Keep holding down the buttons until you see a diagnostic screen with an Android symbol and the WARNING page which you should probably read. We’re reaching the point of no return. Click the Volume Up button to acknowledge that you understand the risks. You will see a “Downloading…” message.

This new app will be installed after reboot and will let you manage how apps get access to root.

This new app will be installed after reboot.

Plug the charging cable into the tablet and into a suitable USB port on your computer. Set the tablet aside and leave it alone.

Open the Odin-vxxxxx.exe as an administrator.* You should see a yellow box with COM1 or something like that in it. If not, reboot your computer and try again, starting from the beginning of this paragraph.

In Odin, click on the PDA button. Navigate to the folder where you unpacked Odin executable, select the .MD5 file (it should be the only option) and open it. Click the Start button.

After a few seconds the first box should turn green and say PASS. Once it does the tablet will reboot and your tablet is now rooted.

The Aftermath

Root Explorer App is a really powerful tool, especially for the price (free).

Root Explorer App is a really powerful tool, especially for the price (free).

This “autoroot” is the simplest of roots and keeps your tablet as close to stock (as Samsung released it) as possible. It gives you and apps superuser access and manages them through a new app called SuperSU. This is perfect if you’re looking to install some stuff that needs Superuser access or you want to go poking around yourself. However, this isn’t tailored for power users or those who want to supplant Android with another OS.

The first super-user required app that I send most people to is Root Browser on the Play Store. It’s a powerful file browser and it’s free. Be careful not to damage your system!

*If you don’t see the Odin executable, then you may need to get it separately. A stand-alone version of Odin can be found on the same forum attached to the second post. Just download it and extract it to the same folder as the MD5 and continue on.

-CJ Julius

h1

How I Got My Android Tablet to Boot Windows 95

24/05/2013

I was rummaging through some old software of mine a few weeks ago and taking stock of the old operating systems that I had commercially. I noticed that along with some older versions of Redhat and Ubuntu Server, I owned every version of Windows since 95, including quite a few server versions. I wondered what I could possibly do with them, since I don’t even use my store-bought copy of Windows XP anymore.

Hey, I remember you.

Hey, I remember you.

Then I looked at my new Galaxy Note 10.1 tablet and got an idea. I wondered if I could get Windows 95 to boot on it. So, I fired up Virtual Box and an old machine I had and got to work.

Note: I am using Ubuntu 12.04LTS and a Galaxy Note 10.1 to do this project. Also, I had access to another, older machine with which I could install Windows 95 myself. Your mileage may vary.

Build 95

There are a few ways to go about this. One is to use Virtual Box to create working Windows 95 VDI file and then convert that to an IMG after you’ve got it running and another is to just find a computer with Windows 95 and make an image of the drive. Either way you’ll have to do three things:

  1. Install DOS 5.x or better before installing Windows.
  2. Install Windows 95 and get it working.
  3. Make your image (.IMG) file.
Click to Enlarge

In Virtual Box, you’ll need to set up an MS-DOS environment first and then probably migrate to 95 later.

Now, I’ve tried both ways, and they’re both complex. In the first example, using Virtual Box to create a Windows 95 compatible area for the OS to work in is a pain. This is because the Windows 95 disk is not bootable (and neither is Windows 98 for that matter). You have to have DOS 5.x or later installed first and THEN go to Windows 95. This is as much work today as it was back in when Win95 came out.

Then, once you have Windows 95 running you need to get all the drivers (and you’ll probably have to use an older version of Virtual Box because of compatibility issues), some of them custom-made, install them, and squash bugs as they come up.

When you have everything set up Virtual-Box side, you can convert the VDI to an IMG file to make it usable with the vboxmanage command in termninal:

vboxmanage clonehd Win95.vdi Win95.img --format RAW

This is not the method I recommend, as it is the hardest even with a walk-through, however it may be the easiest for people with limited access to hardware. I had, luckily, a piece of hardware that would run Win95 with minimal effort so I went that route.

First, I put I installed MS-DOS 5.0.7 (available legally and for free here) from some image files to actual real-live 720KB disks. Yes, I still have a few of those. Then I set up my CD-ROM*, no small feat, and began the Windows 95 install.

Once this had been done, I pulled the HDD out of the computer and connected it to an IDE slot in another machine. I then used the dd command to make a raw image file of the newly-added drive. This ended up giving me a large file because I had given a Gig of space to the virtual drive so I’d have lots of space to move around. You could probably get away with only 200 or 300 MB if you wanted to do so. In any case, the command to image the drive was:

dd if=/where/drive/is/mounted/ of=where/you/want/image/ bs=4K

Now I had my Windows 95 image and it was time to get it running on the tablet!

Install 95

There are multiple ways to get Windows to run on your tablet once you have an image you like. I personally went through my version and pulled out all the things I didn’t want so I could create a smaller image. I eventually got the entire thing down to 200MB, but that was with a lot of work. There are also two ways to get the image running on your tablet. There’s the way I did it initially, and then the easy way. I’ll be showing the easy way and then give a brief overview of the more difficult path.

The Easy Way

You’re also going to want to use something like AirDroid, which I’ve reviewed before, to move the files over because chances are you’re going to be doing this a lot. As you make tweaks or move different things back and forth that GUI is going to come in real handy.

Click to Enlarge

After you put in the image location and name, it will need to copy it to the SDLlib’s directory, probably on your internal memory.

Move your image file over to your device and take note of its location. You’ll probably want to write it down or something, make sure you note the CASE of the letters, because that will be very important. Also you’ll need to make sure you have enough space to copy the image over to the working directory of the emulator that we’re going to use here in a minute. So you’ll need at least twice the space of the original IMG file to use it.

Go to the Play Store and find Motioncoding’s Emulator. It looks like an Android with the Windows XP flag colors on it. Download, install and run it.

Once running, go through the menus (using the forward/back buttons, it really couldn’t be more simple) until it asks you to install libSDL and do so. Then select the option under “Import from Library” to Add Custom Images. Name the image whatever you want and put in the path to the image in there. For example, mine is:

/storage/extSdCard/SDL/Win95.img

Select the image from My Images and continue to the end. You should see your OS boot.

The Hard Way

The reason I’m putting the hard way on here is because it gives you a bit more control over your install and, I think at least, runs a bit faster. In any case I’m going to assume that you’re doing it this way because you’re a little more experienced/curious and don’t need me to hold your hand.

Click to Enlarge

Copying over the SDL apk and related software.

Step one is getting a working version of the SDL apk and installing it. You can do a quick Google search for it, but I’m not sure of the legal ramifications (or its copyright) so I’m not putting a direct link here. Keep in mind that you will need to allow “Apps from Unknown Sources” to be installed on your device. This can usually be found in the “Application Settings” area, depending on your version of Android.

Place your Win95 image in the SDL folder with the APK and rename it c.img, and load SDLlib. You may have to do more tweaking at this point as Networking didn’t work out-of-the-box for me. I needed to modify some already existing .bin and .inf files to coax them into doing what I needed to do, and even then it’s a little haphazard. You’ll need to have some method of editing the img file if you can’t get networking going or you’re going to need to re-image the drive every time you want to make a change.

This way you’ll also have access to the BIOS and VGABIOS bin files, if needed, but I didn’t end up touching them.

Android 95

My reasons for doing this were purely academic. I just wanted to see if I could get it to boot and get it usable. After several weeks of poking at it I was, by all of the above methods, able to get 95 and 98 going this way. Windows 98 was just a matter of upgrading 95 and creating a new image file. I can’t think of many reasons to do this other than for the learning experience, though there are lots of pieces of software out there that don’t work so well in modern versions of Windows and maybe you want to take them with you.

Click to Enlarge

Windows 95 successfully running on my Galaxy Note 10.1 with mouse and keyboard support

Also, I was able to get my Logitech keyboard/mouse combo to work through the 30-pin charging port, and while dragging the cursor across the screen and “clicking” by tap was interesting, the keyboard is the way to go. It’s just too cumbersome for daily use otherwise.

So there it is, an Android tablet booting Windows 95/98! You can supposedly do this with Windows 2000 or XP, but I have not tried. If you have let me know, because I’d be interested in how you got native NTFS to work.

*There’s no instruction here because it really depends on your CD-ROM as to how you’d go about this. You’ll have to find one that will work with Win95 and DOS. I had one in the machine already so it was just a matter of setting it up manually through DOS.

-CJ Julius

h1

Using Python 3 on Ubuntu 12.04

14/05/2013
Python on Linux

Python on Linux

Recently, I’ve turned my attention to Python, the programming language. I had some work with it in the past, but never really gotten that far. As a hobby, it was time consuming and other things got in the way. Now that I’ve freed up a small chunk of time every week I’ve decided to devote that to working on learning the new Python 3, since 2.x is going away eventually.

I quickly found out that Python 3 is not directly supported on my platform of choice: Ubuntu 12.04 LTS. So, I needed to get this running from scratch, which involves downloading, compiling and making it easy to get to for working in.

Compiling and Installing

If you haven’t done so already, you’ll need to get a C compiler for Ubuntu. In general, it’s good to keep this resident on your machine anyway, since you don’t always know when you’ll need it and it doesn’t take up a whole lot of space.

sudo apt-get install build-essential

Then, we’ll need to get our Python installer from the web. I’m currently pointing towards the 3.3.1 version, but there will always be newer versions on the horizon, so check the download page.

wget http://www.python.org/ftp/python/3.3.1/Python-3.3.1.tar.bz2

This will download and the bzip tarball of the source code from the python website. Then, we need to un-ball it and change to the newly created directory.

tar jxf ./Python-3.3.1.tar.bz2
cd ./Python-3.3.1

Lastly, we’ll configure the source code, tell it where to install and then point our compiler (the first thing we did) at Python and tell it to put it all together.

./configure --prefix=/opt/python3.3
make && sudo make install

And now the basic Python core is ready to go. You can test it by putting the following in the command line.

/opt/python3.3/bin/python3

You should get the following output, or something quite similar:

Python 3.3.1 (default, May 12 2013, 22:10:01)
[GCC 4.6.3] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>

Getting Fancy

A command line-type of person may want to create a symbolic link that will let them have a sort of “python command”. Keep in mind that in the following code, you can substitute the “/bin/python” for anything you want the command to be (ie. “/bin/py” or “/bin/pthn” which will make the command py or pthn respectively).

mkdir ~/bin
ln -s /opt/python3.3/bin/python ~/bin/python

Alternatively, you may want to install a virtual environment for testing or whatnot. To do this and activate it, use this in the command line.

/opt/python3.3/bin/pyvenv ~/py33
source ~/py33/bin/activate

Integrated Development Environments

If you’re anything like me, then coding directly from gedit or the like is cumbersome and not really all that fun. I like options, a GUI and all the bells and whistles, so I went looking for a an IDE.

KomodoEdit install is as simple as downloading it and running the install.sh

KomodoEdit’s install is as simple as downloading it and running the install.sh

Netbeans was the first choice, as I’d used that before for PHP work. Here, I wanted something more dedicated to Python. If you do decide to go this route, make sure that you get the one from the Netbeans website and install it yourself. The version in the Ubuntu Software Center is terribly out of date and judging from the reviews, fatally flawed.

My second choice was KomodoEdit, the stripped down version of the Komodo IDE which I’ve heard some good things about (but never used). You can get it for both x86 and x64 as an AS package from their website.

If you have another IDE that you like better, let me know and I’ll take a look at it. I’m always on the hunt for a better/easier way to code.

-CJ Julius

h1

Teaching Windows 8 and Ubuntu Linux to Share

08/05/2013
Rinder500 being shared on Zero.

Rinder500 being shared on Zero.

A few weeks ago, I had put together a project to turn a few eSATA drives that I had lying around into a few mobile digital vaults. This was a complete success, and gave me a bunch more room to do future projects. However, it did not give me an easy way to access these drives, especially the one attached to my main Windows machine and my laptop. Having to unplug/replug every time was proving cumbersome.

So, I decided to make my “mobile” drives a little more permanent, and then just give access to them across a system of three computers via wireless. This would give me 750GB between the machines with which to divvy up as I saw fit.

I’ll be approaching this in three parts:

  1. Setting up the 500GB on the Windows 8 machine (Zero) and sharing.
  2. Setting up the 250GB on my Ubuntu File Server (Crusher) and sharing.
  3. Connecting a Laptop (Stewart) and Zero and Crusher.

In my scenario I did not need to share to my file server from my Windows 8 machine. There’s no reason for it to access it, if successful, from anything other than Zero or Stewart.

Zero Trouble

The Rinder 250 share as viewed from the Windows 8 machine (Zero)

The Network as viewed from the Windows 8 machine (Zero)

So, step one was getting my shares running on Zero. The first thing I did was make sure my networking was all in line. Prior to this, I’d only ever used the Windows 8 computer to connect to the internet, never as part of any network. It had been part of another network previously, but not since the OS was upgraded.

In System Properties> Network ID I set it up as part of a Home Computer and gave it the Workgroup “ZRO_WG”. This is so I have an easy way of recognizing this machine on the network uniquely. Then, I simply shared the Rinder500 drive and set it to require a password.

Even though on Windows 8 your login is an email address, you’re only concerned with the username of the account. So if your account is SomeGuy@Somewhere.com then your user name is most likely going to be just “SomeGuy”. In my advanced sharing options (right-click, Advanced Sharing) I put a comment on the share to easily identify it, required a password and a simple name “rinder500”.

And that was it.

Doing Samba

Rinder250 shared on Linux

Rinder250 shared on Linux

In Ubuntu it was almost just as easy. I’m currently running Ubuntu 10.04 Server LTS on my file server, because I’m trying to stay away from Unity as long as I can*, and that’s what was around when I first put this machine together. That should also give you an idea of its age. Keep this in mind as I proceed as some of my methods may not work for new versions or the problems I had may not even be an issue anymore.

You can Share a drive on Ubuntu just like you would share any folder, since that’s how they’re treated when mounted. You do this by heading into the drive, in my case /media/Rinder250 and right-click to share. Then, I used the shares-admin command from terminal and added the users I wanted and verified that my shares had been added properly.

Shares-admin shows all the users and your shares.

Shares-admin shows all the users and your shares.

Your Workgroup defaults to your machine name, so it was Crusher for the file server. I used a local user (me) as someone with full rights to the share, just to keep it simple. But, you can use this method to add any number of users to the share and give them different permissions if you want.

To do any of this however, you will need to install Samba. You will be prompted for it when you try to share, so this isn’t an issue, unless your server isn’t connected to the internet for whatever reason.

Building the Intranet

Now that I had both of the shares created, it was time to link all of them together. I had three machines that I wanted to link together: Zero, Stewart and Crusher. All three had different OS’s and different needs so I’m detailing them individually.

Laptop's (Stewart) view of the network.

Laptop’s (Stewart) view of the network.

Zero

Zero is the Windows 8 machine and sharing the 500GB eSATA drive. The only one that it needed to link to was Crusher. I scanned the network (by doing the cumbersome task of clicking on the Network) and selecting Crusher.local. Then I put in my username and password for the share and Viola! everything was able to be read from and written to.

Crusher

Crusher is the Ubuntu 10.04 Server sharing the 250GB eSata drive. This got complicated, mostly because of the way Samba (on 10.04 at least) handles Windows shares. You can’t just find the share in the network, double click on it and be good. You have to manually type in the address and then fill out the user/pass information. Using the Go > Location menu and then putting in something like:

smb://WORKGROUP;username@ip.address.of.server/share/

Note the case of the case of the words, as they are important. The workgroup has to be in upper case and the username and share need to be in lower case. If it isn’t put in exactly as you see here, then it won’t work.

Stewart

Stewart shared nothing, but needed to access both shares on Crusher and Zero using Ubuntu 12.04. This one was finished just like Ubuntu 10.04 machine, except that I had to put in two shares. Also, instead of an IP for Crusher I was able to put in just crusher.local. Other than that, exactly the same.

In Production

On the two Ubuntu machines I ended up making bookmarks for them, so I could easily get to them without having to type in that long address every time. If I reboot the server, which is rarely, and I don’t have a static IP assigned, I will need to add the share again and bookmark it again.

Now that I have put together these shared drives, I can move or save things to them across the network. I will be using these network drives in the future, when I will attempt to digitize my movie library.

*As mentioned, I do have 12.04 on my laptop, Stewart.

h1

Carve and Sift: My Primer to Linux Computer Forensics

01/05/2013
The Deft Linux Desktop

The Deft Linux Desktop

Actually, the title is a bit of a misnomer. I’d already learned a bit about computer forensics and the process of recovering files on Windows operating systems some years ago. I had pulled a lot of lost data from a machine that had unexpectedly quit working, saving a lot of customer data for a person who, for the sake of their employment, shall remain anonymous.

However, the method I went about it could hardly be called “forensics” as I had to install some software to a USB and I still had to boot into the OS. I did a lot of writing to the disk (a forensics no-no) and not much was really preserved intact, but I did manage to save what needed to be saved. It really didn’t feel like I had done anything that would be useful to, say, a crime lab.

Deft Linux

cyClone_Menu

The cyClone menu system is pretty clear and can produce either raw or compressed image files with SHA1 or MD5 hashes.

A few weeks ago I was asked if I could perform such a task on a newer Windows 7 laptop, one with a terabyte hard drive, resurrecting some home videos and photos that had been deleted. I jumped at the chance for three reasons: First, these files were of special importance to this person, as one of the family members had died recently and had failed to back them up. Secondly, this gave me a chance to try out the new Deft Linux package on a computer that I could actively see if it was successful. Lastly, the data was relatively nonvolatile. If I accidently wiped it, then no one was getting fired.

I downloaded and burned Deft Linux 7 onto a DVD and got to work. Deft is a Live Disc, meaning that the OS loads from the DVD rather than a hard disk, and is largely based on Ubuntu. The Deft Distro itself is an amalgamation of both Linux and Windows software (through WinE) put together by some people in Italy. It has an English version, and is just about as all-inclusive as you can get with the Linux tools. It also is set up not to mount any drives until you tell it to, and even then you can specify to mount as read-only or full access.

After looking through the impressive and useful manual on their website, I concluded that the pieces of software that I was going to use for the job were cyClone, Foremost and Scalpel. Luckily, there is a GUI front-end for the latter and a menu-driven command-line interface for the former. This was just about as simple as it could get.

Carving

After you carve, you'll want to sift through the image file to see what you can find and/or "resurrect".

After the carve you’ll have a dd image file (raw) and a log telling you how long it took and if it passed the SHA1/MD5 verification check.

The first step in getting the data off of a drive is to Carve it. That is to say, you “carve” out the piece of the drive you want to look at and put it somewhere else, some place that ideally has more space or maybe more computing power. In my case, I didn’t have the time, nor interest, in installing the software on my Linux boxes, so I just carved and set it aside.

Also, I wasn’t particularly interested in the entire drive, as they only really used the first 200GB of the 750GB that had been allotted them on the main C: drive. It would have been too time consuming and not revealed much to look at the last ~550GB of it. So, I carved only the first 200GB and placed it on one of the SATA drives that I had made in a previous project. If you want to get really fancy, you can run the command-line dcfldd which is the US Department of Computer Defence Forensics Lab’s enhanced version of the dd command.

Hunchback_GUI

After you carve, you’ll want to sift through the image file to see what you can find and/or “resurrect”.

Remember before when I said that Deft didn’t mount the drive and you could select to mount as Read Only or Full Access? The reason for this is that data is written to the disk when they are mounted in Full Access mode which is default for almost every OS out there. If we’re police investigators trying to get clues about what’s on a computer, we certainly don’t want to taint the crime scene by scribbling all over it. Mounting a partition in read-only mode prevents the us or the OS from accidently doing just that.

Sifting

Sifting is mostly hit-and-miss, with the emphasis on the miss. It also takes quite a long while, depending on the size of the image.

Sifting is mostly hit-and-miss, with the emphasis on the miss. It also takes quite a long while, depending on the size of the image.

This is the part that takes the longest. Now that we have our cloned drive, we need to go through it and pull out all of the files we need and organize them. There are many ways to do this, but the easiest in Deft is to use the Hunchback GUI. This is a GUI front-end for for the scalpel and foremost command-line pieces. Options in Hunchback aren’t as robust as they are from the command-line, which is usually the case, but they were good enough for us.

I selected all the picture and video types, ignoring things like PDFs or EXEs. Then I pointed to another external drive (from a previous project) and told it to drop all the files that it found in that folder and arrange them by type. The software creates folders for each one and copies what it can accordingly.

Once that was done, I re-mounted the internal 750GB drive with full access, dropped the files I had sifted onto it, and I was done. Now, they could look through the files at their leisure (tens of thousands) and get their deleted files back.

A Further Word

This above, while definitely not a how-to, is a very simple way of getting data off of a Windows or other OS’s drive without disturbing the contents. You could even stop at the image stage and take it with you to sift later. It is an EXACT copy of the drive, deleted files and all.

Deft also contains a gargantuan number of other useful tools for doing things besides straight computer forensics. It also has utilities for network forensics, encryption study and more. If you’ve ever been interested in Computer or Network forensics, then Deft is a must have. It’s definitely tool number one on my belt for this kind of work.

-CJ Julius

h1

Bitcoins, Mobile Digital Vaults and Google Fiber (2013.04.26)

26/04/2013

As this blog is an ongoing venture, occasionally I will want to update previous entries or projects. New information is gathered, projects evolve and, in general, things change. Also, I’ve found that updates don’t work so well on old posts because few people bookmark them and then come back later. To combat this, every once in a while I will be giving updates in rapid fire about previous entries. Those posts will be automatically updated via “pingback” in the comments section, so if you actually do bookmark them, then you’ll get notified that way.

Without further ado:

Bitcoins

bitcoins

Even the experts don’t know if Bitcoin is economically viable.

On April 11, 2013, Bitcoin Exchange Halted Trades in order to bring down the price of the coins. They also released a statement denying the bubble and assuring everyone that it was a solid currency. Whether it is or not remains to be seen as it has had its share of detractors and the largest U.S. exchange shut down following the big hype. As stated in my previous post, no matter how it turns out, it’s a fascinating convergence of technology and economics, much in line with the computerized traders on the stock market today. While I’m still extremely skeptical, I’m secretly rooting for an all-digital currency.

Mobile Digital Vaults

DiskInternals Linux Reader

A little cumbersome, but you can read your EXT drives.

My last project involved taking an old 500GB SATA drive, using TrueCrypt and a snazzy drive enclosure to turn it into a mobile digital vault. This was largely successful, although I could not get Windows to format a large enough partition for some reason. This led to me formatting the virtual drive into EXT4, which meant that I could not read it on Windows. I don’t use Windows that much, so that was not a big deal, however I wanted to see if I could find a method that would let me do so.

The blue light on the front show drive access.

The blue light on the front indicates drive access.

I mentioned that I used a piece of software called EXT2READ which I found out later did not work. When I tested it prior to writing the article, I found that I was able to read the drive, though some days after when I tried to copy a .DOCX file from an EXT3 partition to my NTFS Windows drive, the file was corrupted and unreadable. So, I tried another piece of software by DiskInternals to read EXT2/3/4 drives and it worked flawlessly, seeing the newly mounted TrueCrypt drive and letting me access it.

Also, I got another drive enclosure, the Nexstar3 by Vantec to house another 250GB SATA drive. The only major difference between the two is that the NexStar3 does not have a fan built in thus making it significantly smaller. It also requires two different sized screwdrivers to get your drive in, which I thought was odd, but otherwise it seems to be a solid piece of equipment. This drive is a little more “mobile” than the other so I’ve moved all of my encrypted drives that I want to take with me over to this one making the Rosewill enclosure largely stationary on my desktop.

Google Fiber

Google Fiber is stirring up some dust in Austin

Google Fiber is stirring up some dust in Austin

AT&T is feeling threatened by Google Fiber and has launched a counter-offensive aimed at bringing fiber to mainstream consumers in Austin. Some have argued that this is just posturing, but that they even bothered to acknowledge Google’s plans means that they’re taking the move towards a fiber infrastructure seriously to some degree. On the heals of this announcement came Time Warner Cable’s decision to wire Austin for WiFi. Austin Texas is going to be one of the most internet-connected cities in the U.S. at this rate.

Again, as I said in the last post, there is no bad news.

Future Projects

I have several new projects lined up for the next month, a few which are already underway. First of all, I need to take a 1TB (terabyte) hard drive and resurrect some files that got deleted from it. I will probably be using Deft Linux for this, which should be interesting. I’ve only “carved and sifted” once before.

Also, I got my Raspberry Pi up and going, which was interesting in and of itself, but I’m thinking that I’ll drop Wheezy and move toward XBMC. I had hoped to stream video from my Windows shared drive and onto my TV. We’ll see how that goes.

Lastly, I want to do a longer Wednesday post about Security on the Internet. The utilities I use to keep myself secure might be interesting to others out there. The use of VPNs, two step authentication and software to obscure passwords will be some of the pieces I’ll touch upon.

-CJ Julius