Thursday, April 7, 2011

Xen: Duplicate MAC addresses/UUID's

I have not quite gotten to the point of using the migrate feature with virt-manager to try and get an image file from one server to another, but rather I have done an scp of the domU image and its config file.

However, if you have done this once already you will run into several problems with having a duplicate MAC address and a duplicate uuid. To solve these two issues you can do the following:

new random MAC address:
import random
mac = [ 0x00, 0x16, 0x3e,
 random.randint(0x00, 0x7f),
 random.randint(0x00, 0xff),
 random.randint(0x00, 0xff) ]
print ':'.join(map(lambda x: "%02x" % x, mac))

new uuid:
in centos you can run 'uuidgen' to get a new uuid.

Take these two pieces of information and edit the domU configuration file. Of course you will also need to make sure that you change the name of the domU as well.

Steps:
scp -p domU.img username(root?)@ip:/location(e.g. /var/lib/xen/images/domU.img)
scp -p domU username(root?)@ip:/location(e.g. /etc/xen/domU)

vim domU[config]
name = "[domU Name]"
uuid = "[new uuid]" (e.g. E793FDB1-7180-4AE8-92EC-742D48335058)
...
vif = "[ mac=[new MAC address],...]" (e.g. 00:16:3e:17:dd:0c)

save and quit, and your new domU should be ready to start.

Wednesday, March 30, 2011

Creating an iso on Mac OS X

I know that a lot of you have done this already, but I always forget the best way to create an iso from a cd on the Mac.

I ran across an entry on a forum (http://forums.macrumors.com/showthread.php?t=220740#6) from tgage who gave the following:

From within Terminal (Applications->Utilities->Terminal)

Mac OS X Tiger (10.4)

You can determine the device that is you CD/DVD drive using the following command:

drutil status

Vendor Product Rev
MATSHITA DVD-R UJ-825 DAM5

Type: CD-ROM Name: /dev/disk1
Cur Write: 16x CD Sessions: 1
Max Write: 16x CD Tracks: 3
Overwritable: 00:00:00 blocks: 0 / 0.00MB / 0.00MiB
Space Free: 00:00:00 blocks: 0 / 0.00MB / 0.00MiB
Space Used: 66:55:27 blocks: 301152 / 616.76MB / 588.19MiB
Writability:


Now you will need to umount the disk with the following command:

diskutil unmountDisk disk1

Now you can write the ISO file with the dd utility:

dd if=/dev/disk1 of=file.iso

When finished you will want to remount the disk:

diskutil mountDisk disk1



Thats it.  Just wait for it to finish creating the iso and you are good to go.

Wednesday, March 23, 2011

Firefox 4 Security Features

http://isc.sans.edu/diary/Firefox+4+Security+Features/10594

On March 22nd 2010 Mozilla released the long awaited firefox 4 browser.  Of the improvements to the browser Mozilla added what is referred to as "XSS and Content Security Policy (CSP)".  This does a rather decent job at preventing certain browser pop-ups/alert boxes.

However, for someone that plays around with XSS and loves alert boxes this was a slight problem.  You won't find CSP in any of the menu options but you will find it in 'about:config'.  If you do a search for CSP you will find the following two entries:

security.csp.debug - false
security.csp.enable - true

If you want to make sure that you can test your alert boxes it is highly recommended that you go and mark 'security.csp.enable' as 'false'.