http://www.defcon.org/images/defcon-18/dc-18-presentations/RSmith/DEFCON-18-RSmith-pyREtic.pdf
Well worth reading if you are into this sort of thing.
Cal