Wednesday, July 3, 2013

Damn Vulnerable Linux Full Install on Hard Drive

Damn Vulnerable Linux (DVL) is a Linux distribution that was made purposefully insecure and configured poorly for a learning experience to teach things like exploitation. I managed to find an ISO of it off of some torrent a while back and never really did anything with it. Recently, I got an old laptop that was too broken to do what was wanted with it, so I figured I may as well use it for something. So I installed DVL on to it so I have a machine I can experiment with and get back to learning hacking and other such things. Now most of what I found online was installing into a virtual machine, and the directions were also wrong on quite a few steps. So using my limited knowledge, I played around until I got it right. So here's a quick step-by-step to install DVL on a USB flash drive. I'll try to set up a download link at some point as well.

Put the image on a flash drive, I used Unetbootin.

When booting up the computer with the flash drive, remember to check the boot order in the BIOS so that the flash drive is booted first.

When the system loads, log in. Username is root, password is toor.

Now you should be in the prompt. These instructions are for a clean install. First thing we want to do here is identify what device is where, as far as the hard drive and the USB drive. For me, the hard drive was /dev/hda and the USB drive was /dev/sda. This may change if you have multiple hard drives. We need to tweak some stuff on the hard drive, so we want to unmount it first. Check what is mounted in /mnt, then unmount every folder related to the hard drive. For me, it was just this.

umount /mnt/hda

Next we want to repartition  everything because why not. Run this command, change the hda part if you're setting up on a different system.

fdisk /dev/hda

Now in fdisk, you want to delete any partitions. Press p then enter to see all partitions. Delete all of them. The letter d then enter should do the trick, if there's more than one, just repeat starting at 1 and moving up until it says there are no more. Now we want to write a partition. Press n then enter sticking with the default values (just press enter for the prompts) because that makes life easy. Now to save it, press w then enter and it should take a moment to write the partitions. After this, you should be back at the original prompt.

Okay, now we have a partition, but we have not formatted it to a file system type. So if you've been working on hda, just follow along, if not, remember to change hda to your device. Run this command.

mkfs.ext3 /dev/hda1

Let that run and BAM, ext3 partition. The tutorial I found didn't put the number, which lead to everything completely screwing up, so it's important. If not, it gives a warning message I should have listened to.

So now we want to mount back our newly partitioned and formatted space.

mkdir /mnt/dvl
mount /dev/hda1 /mnt/dvl

Okay, now we should be ready and raring to go to the GUI!

startx

Okay, now in the GUI, we do some fun stuff. In the bottom right hand corner is a German flag with a "de" written on it (short for deustch, for those that didn't know and are curious). Right click on that to bring up the language settings and change that to your locale. Trying to use an American keyboard on a German layout does not work at all.

Okay, now that that is out of the way, in the bottom left corner is the thing for the KDE start menu. Click on that, go to the "Be ReSlaxed" > System > BackTrack Installer.

Leave the first box blank, set the second box to /mnt/dvl if it isn't already. Change the radio buttons from Live to Real. Click the install button and let it do its thing. Once it's finished, hold and because we're not done yet. You can click the close button then go to the logout option under the start menu. Now we should be back at the prompt.

At this prompt, you want to put in this command.

lilo -v -b /dev/hda

If you have a different hard drive setup, this command may need to be different. If that is the case, take a moment to look more into the lilo man pages because I don't know much about it.

If all went well, type this command.

poweroff

After it shuts down, remove the USB drive, start it back up and make sure everything works. It took myself 3 times because I kept goofing up, first time I accidentally wiped the USB drive. Second time I forgot to put lilo on. Third time was the charm.

No comments:

Post a Comment

Tag Cloud

.NET (2) A+ (5) ad ds (1) addon (4) Android (4) anonymous functions (1) application (9) arduino (1) artificial intelligence (1) backup (1) bash (6) camera (2) certifications (3) comptia (5) css (2) customize (11) encryption (3) error (13) exploit (5) ftp (1) funny (4) gadget (4) games (3) GUI (5) hardware (16) haskell (6) help (14) HTML (3) imaging (2) irc (1) it (1) java (2) javascript (13) jobs (1) Linux (19) lua (1) Mac (4) malware (1) math (6) msp (1) network (13) perl (2) php (3) plugin (2) powershell (8) privacy (2) programming (24) python (10) radio (2) regex (3) repair (2) security (16) sound (2) speakers (2) ssh (1) story (5) Techs from the Crypt (5) telnet (1) tools (13) troubleshooting (11) tutorial (9) Ubuntu (4) Unix (2) virtualization (2) web design (6) Windows (16) world of warcraft (1) wow (1) wx (1)