what's this?
normally you cannot delete an exe while running. to delete it, you have to run a code after the exe is terminated. what i'm doing here is injecting a code to an already running process, which makes your exe's deletion possible after its' termination. what it does is basically:
- find a 32 bit process available for injection (not x64 cos lazy)
- allocate some memory on the process
write kernel32.sleep with the time you specify & kernel32.deletefilea using the file you pick (can be the exe itself of course)- enumerate processes with Kernel32.K32EnumProcesses and loop through the pIDs until the specified process is terminated
- delete the specified file
- clear the pages back & exit thread
what can it be used for?
you can have your script do anything irrelevant,
thanks to Jeoni this time it clears the memory with virtualfree leaving no garbage for realQuote:
...
shellcode:
examples attached
i hope this helped someone out there. i know autoit is the worst possible way for injecting a code and this is not the cleanest way to do it but i still think it could be used.