PyFault: Win32 Fault Injection Library
Justin Seitz (jms) <jmsbughunterca> Tuesday, July 10 2007 01:42.21 CDT


I have released a tiny little python class for fault injection, currently hosted here: VDA Labs - PyFault

Currently it only supports DLL injection and ejection in their simplest forms. I really just needed something quick and dirty and I was tired of using other little apps to do it. As well if you are coding DLL's as an exploit payload, its useful to be able to quickly load and unload them from a target process to make sure you are playing nice. It's pretty straightforward to use:


from pyfault import *

fault = pyfault()

pid = 1234

injected = fault.inject_dll("C:\injecteddll.dll",pid)

if injected == True:
    print "We succesfully injected our DLL, gonna eject that business now."
    ejected = fault.eject_dll("injecteddll.dll",pid)
    print "Result of ejection: %s" % ejected


It only requires ctypes to be installed (which you should have if you are using PaiMei).

The main thing I am looking for is some suggestions on fault injection scenarios that other's would like to see, I personally have tracked down some interesting bugs when torturing software in this manner. Definitely drop me a line, bug fixes, suggestions, extensions, etc.



Comments
Posted: Wednesday, December 31 1969 18:00.00 CST