Check which device name your DVD/CD drive has (use this name for the rest of the commands):
$ drutil status
Should look something like:
/dev/disk2
Unmount the drive:
$ diskutil unmountDisk /dev/disk2
There should be a message similar to: “Unmount of all volumes on disk2 was successful.”
Use dd to create the ISO image:
$ dd if=/dev/disk2 of=filename.iso bs=2048
Syntax is quite simple; if = input file, of = output file.
Building of ISO image might take around 10 minutes, depending of course of your CD/DVD size.