Skip to main content

#3: Kali Linux on the Beaglebone Black

Ethernet and USB Problems

I tried Fedora on the BBB, but it is slightly behind the curve (strange for Fedora, which is usually bleeding edge), the ethernet and USB ports do not work yet since it needs a newer kernel.  The Debian distributions are better on the BBB.

So, one can blow against the wind, or try Debian...

Penetration Tests

I am working on a networked project which is an island system - it is not connected to anything else at the moment.  I say at the moment - since I know that sooner or later, the bosses will demand that it be connected to the something else, at which point the lack of attention to security will come to bite everyone.

There is a small security and penetration test oriented Debian based distribution called Kali Linux that you can get here http://docs.kali.org/armel-armhf/install-kali-arm-on-a-beaglebone-black

Kali installs on a SD card, so your original Angstrom Linux on the BBB will remain unaltered, which makes it worth a try.

An interesting feature of Kali, is the website, which was nicely translated into 13 languages.

With this version, you should be able to do various nefarious things to your fellow developers using the Metasploit package...

Get it and Prepare an SD Card

You can download the ARM HF image here http://www.kali.org/downloads/

Specifically:

Uncompress it with xzcat:
(For a Mac, get the xz utilities here: http://macpkg.sourceforge.net/)


xzcat kali-linux-1.0.6-armhf.img.xz > kali-linux-1.0.6-armhf.img


and copy it to the SD card with Data Definition like this: 
$ su -
password
# dd if=kali-linux-1.0.6-armhf.img of=/dev/sdb bs=512k

Using Data Definition on a Mac

Stop the automounter called diskarbitrationd temporarily, otherwise the SD card will be mounted and 'busy': 
$ sudo launchctl list | grep diskarbitrationd
16 - com.apple.diskarbitrationd 

$ sudo kill -SIGSTOP 16

Only now, stick the SD card into the Mac SD slot.

Open a terminal and type
$ ls /dev/disk*
/dev/disk0    /dev/disk0s2    /dev/disk1
/dev/disk0s1    /dev/disk0s3    /dev/disk1s1
 

The disk0 is your SSD and you don't want to mess with that!
The disk1 is the SD card.

Now, with the SD card unmounted, you can use dd to copy the BBB image to disk1:
$ sudo dd if=kali-linux-1.0.6-armhf.img of=/dev/disk1 bs=512k

On a Mac, Ctrl-T will show the dd progress.

Note that if you accidentally dd to /dev/disk0, then you will destroy your Mac system.
So, don't do that!

Finally, re-enable the automounter:
$ sudo kill -SIGCONT 16

Accessing the SD card from a Virtual Machine

I run Fedora 20 on my Macbook Pro and getting Virtualbox to see the SD card is somewhat painful.

First of all make sure that the Fedora virtual machine is NOT running.

Stop the automounter as above to ensure that the SD card is not mounted, then access it using a raw disk image.

Make a raw disk image file for Virtualbox:
$ VBoxManage internalcommands createrawvmdk -filename /path/to/file.vmdk -rawdisk /dev/disk1


Attach the raw disk to a guest VM within the VirtualBox UI:
  1. Ensure the guest VM is not running.
  2. Open the settings area for the guest VM
  3. Click on "Storage" in the toolbar
  4. Next to the controller click on the icon to "Add Hard Disk"
  5. Select "Choose existing disk"
  6. Navigate to the /path/to/file.vmdk you used in step 3 and select it
  7. You should now be returned to the Storage tab and see your file.vmdk in the list.
  8. Start the VM
  9. The SD card will then be available as /dev/sdb 
Now you can use the Fedora VM to access the SD card normally and finally, when done, you can re-enable the automounter using kill -SIGCONT.

Boot Kali

Unplug the USB power cable, install the serial cable (Black wire at the little dot), plug in both USBs and run screen:
$ screen /dev/ttyUSB0 115200
or on a Mac:
$ ls /dev/tty.usb*
/dev/tty.usbserial-AH0142BF
$ screen /dev/tty.usbserial-AH0142BF 115200
Now plug in the USB power cable again and watch her boot.
There is also a little reset button on the corner at the 4 LEDs.

Bugs

Finally, I managed to boot the SD card and got this:
Hit any key to stop autoboot:  0
gpio: pin 53 (gpio 53) value is 1
mmc0 is current device
micro SD card found
mmc0 is current device
gpio: pin 54 (gpio 54) value is 1
SD/MMC found on device 0
** File not found uEnv.txt **
gpio: pin 55 (gpio 55) value is 1
** Invalid partition 2 **
U-Boot#


Hmm... now I'm wondering whether the mods on the Fedora BBB page are required here too:
$ cd /media
$ cp __/usr/share/uboot-beaglebone/* uboot/ 
$ cp uboot/uEnv.txt.beaglebone uboot/uEnv.txt
$ nano uboot/uEnv.txt 
abcboard=am335x-bone > abcboard=am335x-boneblack 
Some more sleuthing is required to sort this out.

Soooo, remove the USB power cable, remove the SD card and stick it into the Mac.
Aaaargh! Stupid automounter and stupid Mac that doesn't support the file system...

Boot a Linux machine and stick it in again.

An error occurred while accessing DEBIAN_LIVE...

Bah, humbug!  No wonder it won't boot either.

It really looks like it is time to find another distro again, or to build the darn thing myself.

Build It Yourself

If you are more adventurous, the Kali build scripts are on github here https://github.com/offensive-security/kali-arm-build-scripts

Get bbb.sh and README.md for the details.

I think I'll rather install QEMU and build my own version of Fedora ARM, since that is the distribution I like the most.   More on this later.

Eish...

Comments

Popular posts from this blog

Parasitic Quadrifilar Helical Antenna

This article was reprinted in OSCAR News, March 2018:  http://www.amsat-uk.org If you want to receive Satellite Weather Pictures , then you need a decent antenna, otherwise you will receive more noise than picture. For polar orbit satellites, one needs an antenna with a mushroom shaped radiation pattern .  It needs to have strong gain towards the horizon where the satellites are distant, less gain upwards where they are close and as little as possible downwards, which would be wasted and a source of noise.  Most satellites are spin stabilized and therefore the antenna also needs circular polarization, otherwise the received signal will flutter as the antennas rotate through nulls. The helical antenna, first proposed by Kraus in 1948, is the natural solution to circular polarized satellite communications.  It is a simple twisted wire - there seems to be nothing to it.  Various papers have been published on helix antennas, so the operation is pretty well ...

Unlock CRA PDF Forms

Unlock Canada Revenue Agency PDF Forms It appears that there is a relatively new PDF feature to prevent casual copying and saving of a file and that some programs save PDF files with these foolish features active by default.  Many forms from the Canada Revenue Agency are locked in this way, which makes it difficult to do one's taxes, since one can fill the form, but cannot save it.  One can only print the form.  It should be possible to print to a file or export it to a new PDF file, but it is far better to reset the annoying anti-taxpayer flags, since the 'printed' form cannot be edited easily any more and I always manage to make a mistake or three that need to be corrected after review. If there is a Linux (virtual) machine handy, install qpdf and use it to reset the silly flags: $ su - password # dnf update # dnf install qpdf # exit $ qpdf --decrypt lockedfile.pdf unlockedfile.pdf One doesn't need a password to unlock these flags, so the fix is instant. La voila! He...

To C or not to C, That is the Question

As most would know, the Kernighan and Ritchie C Programming Language is an improved version of B, which is a simplified version of BCPL, which is derived from ALGOL, which is the Ur computer language that started the whole madness, when Adam needed an operating system for his Abacus, to count Eve's apples in the garden of Eden in Iraq.  The result is that C is my favourite, most hated computer language , which I use for everything. At university, I learned FORTRAN with punch cards on a Sperry-Univac, in order to run SPICE, to simulate an operational amplifier.  Computers rapidly lost their glamour after that era! Nobody taught me C.  I bought the book and figured it out myself. Over time, I wrote a couple of assemblers, a linker-locator, various low level debuggers and schedulers and I even fixed a bug in a C compiler - not because I wanted to, but because I had to, to get the job done!   Much of my software work was down in the weeds with DSP and radio modems...