Friday, October 25, 2013

Binary Bomb!!!! BOOMMM!!!!

BINARY BOMB - A BOOM at each phase!

A "binary bomb" is a Linux executable C program that consists of six "phases." Each phase expects the user to enter a particular string on stdin. If the user enters the expected string, then that phase
is "defused." Otherwise the bomb "explodes" by printing "BOOM!!!".
The goal is to defuse as many phases as possible without defusing the bomb.



Each bomb phase tests a different aspect of machine language programs:
  Phase 1: string comparison
  Phase 2: loops
  Phase 3: conditionals/switches
  Phase 4: recursive calls and the stack discipline
  Phase 5: pointers
  Phase 6: linked lists/pointers/structs

There is also a "secret phase" that only appears if students append a certain string to the solution to Phase 4. 

Each user gets a unique bomb that they must solve themselves.  The unique
solution to each bomb is available to the instructor.

Catch the source code at Binary Labs: CMU Binary Bomb

Wednesday, October 23, 2013

Disk encryption installation of ArchLinux.

ArchLinux - System Encryption with a keyfile on a external flashdrive/CD/USB:

Script for the arch-linux - full system encryption with a keyfile on a external drive.

#!/bin/bash
modprobe dm_mod
cryptsetup -c aes-xts-plain -s 512 luksFormat /dev/sda2 /mnt/USB/keyfile.jpg
cryptsetup -d /mnt/USB/keyfile.jpg luksOpen /dev/sda2 rootcrypt
mkfs -t ext4 /dev/mapper/rootcrypt
mkfs -t ext4 /dev/sda1
mkdir /mnt/boot
mount /dev/sda1 /mnt/boot
mount /dev/mapper/rootcrypt /mnt
pacstrap -i /mnt base base-devel
genfstab -p /mnt > /mnt/etc/fstab
arch-chroot /mnt
bash
cd //boot
pacman -S syslinux
nano /etc/syslinux/syslinux.cfg
//append the keyfile path//
cryptdevice=/dev/sda2:rootcrypt root=/dev/mapper/rootcrypt ro cryptkey=/dev/disk/by-label/USB:vfat:keyfile.jpg
nano /etc/mkinitcpio.conf
//add encrypt hook //
MODULES="dm_mod vfat ext4"
HOOKS=base udev block autodetect encrypt filesystems
//Save the file and exit//
syslinux-install_update -i
syslinux-install_update -a
syslinux-install_update -m
nano /etc/hostname
passwd
ln -s /usr/share/zoneinfo/America/New_York /etc/localtime
nano /etc/locale.gen
LANG="en_US.UTF-8"
//Save and exit the file//
nano /etc/locale.conf
//Uncomment the en_US.UTF-8 line//
//Save and exit the file//
exit
exit
mkinitcpio -p linux
umount /dev/sda1
reboot