July 9th, 2004, 03:35 PM
Setting up coLinux so you can pen-test linux without needing 2 computers
"If Linux runs on every architecture, why should another operating system be in its way? "
Well here goes with my second tut, its not supposed to be an idiot proof guide and some brain power may have to be used.
CoLinux is set to bridge the gap between windows and linux like never before. Before we've
had bootable CD's you have to reboot and put the CD in to run the linux distro (knoppix, slax...). Theres also virutal machines such as VMware and Bochs, both allow you to
effectivly run an operating system inside and operating system, meaning 2 different
operating systems can be used at the same time. You could try Cygwin also.
There are a few reasons why you wouldnt want to use these options and consider Colinux -
1)VMware costs $199 I think, which is quite a large amount of money to shell out for a hobby
considering quite a few people on AO only muck about with security as a hobby, although for
the members involved in the industry it might be a viable solution
2)Things like bochs arent very user friendly and require a certain amount of knowledge to set up.
3)Cygwin isnt up to much IMO, things used routinly in security areas are quite un balances in Cygwin and are frequently in and out of distributions and also arent supported as fully as perhaps they should be, commands im talking about include "su", "man", "mkdir -p" "chmod". In the "using cygwin section of there website theres more about what doesnt work that about what does (http://www.cygwin.com/faq/faq_3.html#SEC27)
Of cause like phish said in his post originally highlighting coLinux is that he'd far sooner use several computers, im also like this but supposing you can afford or cant access more than 1 computer? we'll coLinux allows you to run both windows and linux at the same time, with a network connection between the 2 so they are networked. This allows you to experiment with things such as pen testing, without having to physically set up a network.
The aim of this tutorial is to get to the stage where you have a linux command line and have basic networking setup so that you can get applications and continue to develop your system.
Using CoLinux omitts the need to dual boot! this often cause a great deal of confusion amongst newbies and I believe that its simpler to install coLinux than dual boot
I will be using the debain image file, as it was a smaller file size and Im more familar with it than gentoo, there is also a fedora image now availiable which wasnt availiable when I set about setting up CoLinux on my box. I do not intend on going into detail about how to create images.
There is a port availiable for windows 9x however it is somewhat limited and CoLinux is mostly aimed at 2000 and Xp (I am unsure as to whether it will work on NT or 2003server, but i would assume it would)
Files you need -
from here grab both the executable and an image. ie -
coLinux-0.6.1.exe and Debian-20040605.ext3.1610mb.bz2
Execute the executable, and follow the instrutions here. At the "choose components" screen ensure that all items are ticked. At the next screen change the desination folder to yourdirve:\coLinux, for instance c:\coLinux. The drive letter varies depending on how your computer is set up, on mine its d:\coLinux (I think ive laboured that point enough...).
Click Install and let it go!
Move the image file you downloaded to c:\coLinux.
Navigate to where you installed it, there are a few files that may need to be altered to get coLinux running on your computer. Open the file "default.colinux.xml" in notepad. Locate the
lines beginning with "<block_device..." and make sure that these lines refer to your drive and the image file your using, the default line refers to the dirve being C, so on mine this prevented the virtual monitor working so I had to change it to D. Also ensure that the image filename is set to file you have downloaded. Save and exit. Now create a batch file in c:\coLinux calle somehting like start.bat and enter the following line in it "colinux-daemon.exe -t nt -c default.colinux.xml" of course excluding the quotes.
From here create a shortcut for start and place it in your start menu or on your desktop for convenience sake, this step can be ommited if you cant be bothered.
An area for playing with here is creating a batch file with the oppurtunity to select which xml file to use, this way you can use to image files and not have to modify the xml file every time you want to try a different image.
Right now to enable networking, in windows do the following steps.
Start-->settings-->control panel-->add hardware-->"next"-->"yes i have already connected the hardware"-->scroll down to the bottom and select "add a new hardware device"-->install the hardware that I manually select from a list-->network adapters-->TapWin32Project and select TAP-Win32-Adapter-->next-->next-->finish
The tap driver enables you to access your windows internet connection though coLinux. Now to set up the internet connection sharing. This only applys for dial in connections as this is all ive had the option of testing on, but the process i assume is similar for adsl and internet connections though a network. -
Start-->settings-->control panel-->right click on your ISP icon and select properties-->click the advanced tab-->mark the allow ICS button and check that the name given here is the same as the name of the icon for the TAP driver.-->click ok.
Now we're ready to fire up coLinux for the first time..
Either double click on the short cut you may of created, or go to c:\coLinux and double click on the icon "colinux-daemon". This will start coLinux and the usually linux boot up will happen (to anyone that doesnt no this is loads of sentences and coloured bits scrolling down the screen).
youll be presented with the login propmt, the defualt user name is root and there is no password so just bang enter.
As soon as you in its probably advisible to create a password, use the "passwd" command and follow the instructions
Now like most systems you shouldnt muck about in root all the time so use the adduser command to create your usually account.
Ok a quick fix to getting the networking working is to type "ifconfig eth0 192.168.0.2" 192.168.0.1 is used by windows for the tap driver, so you can use this address. But anything where the last digit of the ip is >= 2 but less than 255. Of course you probably dont want to type ifconfig everytime you start colinux, so youll need to edit /etc/network, use the editor nano to edit the files setting the gateway to 192.168.0.1 and your address to something like 192.168.0.23. To save in nano do ctrl-O and then exit with ctrl-x.
An example of how the file should look as provided at the coLinux site is here
as you can see they have used the value 40 in there address, but i like the number 23...
source = www.colinux.org
# Used by ifup(8) and ifdown(8). See the interfaces(5) manpage or
# /usr/share/doc/ifupdown/examples for more information.
auto lo eth0
iface eth0 inet static
iface lo inet loopback
Now try "ping www.google.com" you should be rewarded with ping results :-)
That means your setup is complete!
You can now use apt-get to update you image (this is for debian) and a good HOW-TO can be
found here -
You can also download files from CVS's and by using other means. You'll probably be keen to get a GUI, there isnt one as defualt so youll need to learn about X-windows and also how to install it.
I hope that this tutorial has provided you with and insight of how to setup coLinux, Im planning on using it to reverse engineer USB comms for a webcam and another USB device so that I can write a driver for linux. You might wish to use it to try penetration testing agaisnt linux from windows or the other way around.
Oh yea another cool thing about this is that it means that you can use your WinModem under linux and someof you that have tried to get winmodems working in linux will no what an un-fun experiecne this is.
July 11th, 2004, 01:36 AM
Check out the switch to linux video clip at www.pureehosting.com , it's pretty good.
July 11th, 2004, 06:00 PM
Heh, thats a cool flash movie...pretty much the reason why I got into linux :-)