Background:
(((Scroll to / Control+F 'Process' for the required steps.)))
I have been trying for the last month or so to install a persistent security distro on a flash drive. My original issue was that I simply did not have a USB drive with enough space. My old keys broke, and those remaining were at about 4GB each, not enough to have any reasonable amount of space. Why are they so![https://s-media-cache-ak0.pinimg.com/236x/3d/82/de/3d82de7cade5beffb59a8a64be6d4706.jpg](https://s-media-cache-ak0.pinimg.com/236x/3d/82/de/3d82de7cade5beffb59a8a64be6d4706.jpg)
Oh, thanks ^_^/.
After finally acquiring a flash drive with enough space (Thanks Wes!), I began the process of trying to install BackBox, but even though it would install and sometimes even load, it had no persistence. I then tried various ways of setting up persistence, such as using a casper file, making the bootable USB using various programs in both Windows and Linux (Lili, Rufus, Unetboot, Startup Disk Creator, dd, etc), and even manually creating a "persistence" ext4 partition. None of them was able to save files past a reboot.
![https://s-media-cache-ak0.pinimg.com/736x/b9/7a/be/b97abe7878595d010ef2e1ee75170dda.jpg](https://s-media-cache-ak0.pinimg.com/736x/b9/7a/be/b97abe7878595d010ef2e1ee75170dda.jpg)
It was suggested that I try Kali instead (Thanks Steve!), because most of the reason I used Backbox was size and I now have a 32GB flash drive. I was sceptical because I am used to Backbox and will need to learn a new OS--the last time I used Kali it was still BackTrack--but Kali has also been updated much more recently than Backbox and thus I assume may have more support for various issues.
Upon attempting the same as the above for Kali; I could not even get the operating system to load. I downloaded Kali two times (torrent), to see if the file was an issue. In the end I found a process that worked, and when I finally got it up and running, and triple checked the persistence and stability, J0hnny told me I should post about it, so I'm going to start a series on random stuff like this!
Anyway, the process that worked is below, but first here are some error messages and what I think they meant.
Things I Learned / Errors:
An uncaught exception was raised: Invalid version string 'GNU/LINUX'
You need to disable Secure Boot in the BIOS or you will see:Selected Boot Image Did Not Authenticate
I have not yet figure out why Backbox does not require this, but Kali does, you'd think they'd be the same. Here is a handy website for on-boot function keys in a nifty table. I am using an HP Spectre x360, so F10 for bios and F9 for the boot selection screen.
Process (AKA Get Dunked On, Struggle!):
These contain the only commands I've found which seemed to have written Kali in a way where it would boot on my laptop and retain information after a reboot.
Here are my specific steps, followed again as I am writing this guide May 9th 2017.
- (Optional) Remove all partitions from the drive.
- Make sure you know your drive location [$ sudo fdisk -l] and that it is mounted.
- $ sudo dd if=kali-linux-xfce-2017.1-amd64.iso of=/dev/sdb bs=512k
- if is the input file, so make sure it points to the exact location of your iso.
- My drive was in /dev/sdb, note that this does not point to sdb1 or any other specific partition. I believe (thanks to J0hnny) that is one of the reasons this worked over the other guides.
- Definitely change this command, I'm using kali xfce for reasons that you likely are not. Tab completion is your friend, as always.
- This actually installs Kali, so if you don't need persistence, you can stop here.
- You could even grab a coffee, reboot your system, or go to the bathroom right now!
- su
- type yo' root password!
- end=7gb
- read start _ < <(du -bcm kali-linux-xfce-2017.1-amd64.iso | tail -1); echo $start
- Ctrl+shift+v if you don't remember how to paste into a terminal.
- You should see a number as output.
- parted /dev/sdb mkpart primary $start $end
- If the response includes '...the closest location we can manage...' and it doesn't seem suspect (where suspect is something like two equal numbers, which happened when I had incorrectly partitioned the drive: start over) then confirm.
- If it says 'the resulting partition is not properly aligned for best performance', you can ignore that.
- You'll likely see 'Information: You may need to update /etc/fstab'. For some reason I thought this meant I broke something, but it is fine.
- When this is done you should have 3 partitions on /dev/sdb. If you have fewer or more (and I have messed this up in both directions): start over. You can check this with fdisk -l since you are probably still the superuser. If you aren't: do an su again for the next set of commands.
- mkfs.ext3 -L persistence /dev/sdb3
- e2label /dev/sdb3 persistence
- mkdir -p /mnt/hostd
- mount /dev/sdb3 /mnt/hostd
- echo "/ union" > /mnt/hostd/persistence.conf
- umount /dev/sdb3
- I actually received a 'not mounted' once, but everything still worked that time. You probably shouldn't see that, though :P.
Restart and you're good to go!
Now, go Hack the Planet
Upcoming projects
Learning about passwords and rules in JTR (jumbo edition) and Hashcat. Already made great progress thanks to people in the Burbsec Slack channel!
Getting a chromebook for conferences (an amazing suggestion by the aforementioned Steve,) so I can have a dedicated machine. I'm tweaking this installation now and will end up permanently installing it on the machine. I am currently looking at this model: ASUS C100PA-DB01 Chromebook Flip. This means there will likely be a post on installing Kali to a chromebook in a few months.
No comments:
Post a Comment