![]() |
|
[C#] [v1.0.0.1] RunPE Shield - detect processes created with a RunPE - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118) +---- Thread: [C#] [v1.0.0.1] RunPE Shield - detect processes created with a RunPE (/showthread.php?tid=5078503) Pages: Pages
1
2
|
[v1.0.0.1] RunPE Shield - detect processes created with a RunPE - debug - Dec 1, 2015 Summary I created this project to detect malware executed by RunPE's. This is a work in progress, no where near its final stage. That being said, it's probably very buggy, so use with caution. In Action OldSpoiler (Click to View) ![]() Notes In the gif you can see that the first crypted.exe process is declared as clean, as it is not a process created by a runPE. But if it uses a runPE to create a new process, it will kill both processes. TODO
Source Github: https://github.com/debug-hf/RunPE-Shield Change Log v1.0.0.1
Credits Almost all credits go to BahNahNah for his PEToolKit. I modified his code to work in this fashion, so shout out to him for most of the hard work. If you find any bugs or have any suggestions let me know. I think this will be a fun project to work on. Hope you like it! -debug beat you to it Lapan, suck it * - Business Crypt - Dec 1, 2015 Hi DeBuG :^) Glad to see you've moved onto something worthwhile. So if I gather correctly - you're scanning for mismatching fields from the PE on disk and the PE in memory? I believe DarkCoderSC's tool does the same thing. Nice work, it's a clever idea. I can think of at least a couple problems this could run into off the top of my head. Nonetheless, cool. * - debug - Dec 1, 2015 (Dec 1, 2015 06:29 PM)Business Crypt Wrote: Hi DeBuG :^)Correct. And If there are 5 or greater mismatches, it's flagged. I will probably later turn this into more general Anti-Malware program, but for now, wiping out runpe's takes care of alot. ;) * - ucsandaasu - Dec 2, 2015 (Dec 1, 2015 05:53 PM)debug Wrote: Summary mate , this is insane! thank you alot and keep it up * - Cecilia - Dec 2, 2015 Eh yours is less advanced than mine, but you have done a good job in making it available to everyone ;) * - log dot zip - Dec 2, 2015 Finally someone who isn't showing off generic shit malware. Cool idea - reminds me of this demonstration, by Malwarebytes: I'm guessing they're using the same basic flagging principle. +rep for not being a shitter. * - Only3 - Dec 2, 2015 u can use async event https://msdn.microsoft.com/en-us/library/system.management.managementeventwatcher.stop(v=vs.100).ASPx properties https://msdn.microsoft.com/en-us/library/windows/desktop/aa394372(v=vs.85).aspx or simply loop the process anyway theres better and simple ways to do it * - debug - Dec 2, 2015 (Dec 2, 2015 09:03 AM)codeconfusion Wrote: Finally someone who isn't showing off generic shit malware. Cool idea - reminds me of this demonstration, by Malwarebytes:thanks! (Dec 2, 2015 09:46 AM)Only3 Wrote: u can use async event https://msdn.microsoft.com/en-us/library/system.management.managementeventwatcher.stop(v=vs.100).ASPxYes, I plan to move away from WMI. See: todo. Updated with significant improvements. See changelog. * - Wardow - Jun 10, 2016 Many ways to bypass this, I can leave the original PE loaded or, remap it to another place and make so the first module base address points to it, then create another row to the module list with the same info as the first one and use my new base address and patch the program base address in the PEB with that one too, this way your program checks the original application against the disk copy and does not detect anything * - debug - Jun 10, 2016 (Jun 10, 2016 09:41 AM)Wardow Wrote: Many ways to bypass this, I can leave the original PE loaded or, remap it to another place and make so the first module base address points to it, then create another row to the module list with the same info as the first one and use my new base address and patch the program base address in the PEB with that one too, this way your program checks the original application against the disk copy and does not detect anythingI'm sure you can bypass it Wardow, but for 99% of the malware skiddies, this will work just fine. * - The-One - Jun 10, 2016 (Jun 10, 2016 10:27 AM)debug Wrote: I'm sure you can bypass it Wardow, but for 99% of the malware skiddies, this will work just fine. In C# one can easily install EasyHook and write a simple hook for ReadProcessMemory to redirect your calls to ReadProcessMemory and return invalid information. * - Wardow - Jun 11, 2016 (Jun 10, 2016 11:42 AM)The-One Wrote: In C# one can easily install EasyHook and write a simple hook for ReadProcessMemory to redirect your calls to ReadProcessMemory and return invalid information. Not the subject, nor the point, anyone can get over anything using hooking, it's all about integrity level, if you have a driver you can even do that on Anti-Viruses, again, not the point * - The-One - Jun 13, 2016 (Jun 11, 2016 04:39 AM)Wardow Wrote: Not the subject, nor the point, anyone can get over anything using hooking, it's all about integrity level, if you have a driver you can even do that on Anti-Viruses, again, not the point But that is the point I wanted to make; I tried to explain that this tool could easily be fooled and one shouldn't rely on it. Also, whats wrong with hooking? Why should I want to write something that remaps my assembly or messes with the PEB while I can easily hook rpm? * - Wardow - Jun 13, 2016 (Jun 13, 2016 02:24 AM)The-One Wrote: But that is the point I wanted to make; I tried to explain that this tool could easily be fooled and one shouldn't rely on it. Also, whats wrong with hooking? Why should I want to write something that remaps my assembly or messes with the PEB while I can easily hook rpm? "Hooking" is universal, When hooking is only way to bypass you can consider it secure; as is, integrity is what will stop your program from operating, so get it higher when you run it. * - The-One - Jun 13, 2016 (Jun 13, 2016 06:27 AM)Wardow Wrote: "Hooking" is universal, Okay, I get that hooking is universal and that is doesn't affect the integrity but still; why would I write loads of code when I could apply a simple rpm hook, just out of curiosity? |