# *_* coding: euc_kr_*_ # Dll injection/ejection tool by nopter@gmail.com # Thanks to jdemott@vdalabs.com import os, sys try: from pyfault import * except: print "[-]python pyfault module needed" print "Download: http://vdalabs.com/tools/pyfault.html" sys.exit(1) try: import wmi except: print "[-]python wmi module needed" print "Download: http://tgolden.sc.sabren.com/python/wmi.html" sys.exit(1) help = "usage: %s (-i|-e) [DLL Name] [Process Name]" %os.path.basename(sys.argv[0]) c = wmi.WMI () fault = pyfault() if (len(sys.argv) < 3 or sys.argv[1].lower() == '-h' or sys.argv[1].lower() == '--help'): print help sys.exit(1) opt = sys.argv[1] dll_name1 = os.path.abspath(sys.argv[2]) dll_name2 = os.path.basename(sys.argv[2]) process_name = sys.argv[3] if opt == '-e': try: for process in c.Win32_Process(): if process.Name == process_name: pid = process.ProcessID injected = fault.eject_dll(dll_name2,pid) print "Result of ejection: %s" %dll_name2 except: print "[-]Ejection Error" sys.exit() if opt == '-i': try: for process in c.Win32_Process(): if process.Name == process_name: pid = process.ProcessID injected = fault.inject_dll(dll_name1,pid) print "Result of injection: %s" %dll_name2 except: print "[-]injection Error" sys.exit() # tagging # DLL Injection Ejection # ÀÎÁ§¼Ç