Kali Linux

Nim-RunPE : A Nim Implementation Of Reflective PE-Loading From Memory

Nim-RunPE , is a Nim implementation of reflective PE-Loading from memory. The base for this code was taken from RunPE-In-Memory – which I ported to Nim.

You’ll need to install the following dependencies:

nimble install ptr_math winim

I did test this with Nim Version 1.6.2 only, so use that version for testing or I cannot guarantee no errors when using another version.

Compile

If you want to pass arguments on runtime or don’t want to pass arguments at all compile via:

nim c NimRunPE.nim

If you want to hardcode custom arguments modify const exeArgs to your needs and compile with:

nim c -d:args NimRunPE.nim – this was contributed by @glynx, thanks

More Information

The technique itself it pretty old, but I didn’t find a Nim implementation yet. So this has changed now. 🙂

If you plan to load e.g. Mimikatz with this technique – make sure to compile a version from source on your own, as the release binaries don’t accept arguments after being loaded reflectively by this loader. Why? I really don’t know it’s strange but a fact. If you compile on your own it will still work:

My private Packer is also weaponized with this technique – but all Win32 functions are replaced with Syscalls there. That makes the technique stealthier.

R K

Recent Posts

Cybersecurity Toolkit – Essential Python Tools For Penetration Testing

Welcome to the Cybersecurity Toolkit, a collection of essential Python tools designed for penetration testing…

3 hours ago

i-Haklab : Unleashing The Power Of Termux For Enhanced Cybersecurity

The main objective of the creation of this laboratory is to transport the applications, tools…

3 hours ago

Dark FB – A Comprehensive Toolkit For Advanced Facebook Interactions

"Dark FB" is a powerful toolkit designed for those who wish to delve deeper into…

3 hours ago

Wifi-Hacking.py : Your Ultimate Guide To Ethical WiFi Penetration Testing

Unlock the potential of ethical hacking with Wifi-Hacking.py, a powerful cybersecurity tool designed to navigate…

1 day ago

THREAT ACTORS – TTPs : Decoding The Digital Underworld Through Comprehensive Mapping

This repository was created with the aim of assisting companies and independent researchers about Tactics,…

1 day ago

MagicDot : Harnessing DOT-To-NT Path Conversion For Rootkit-Like Capabilities

A set of rootkit-like abilities for unprivileged users, and vulnerabilities based on the DOT-to-NT path…

1 day ago