Skip to content

sha0coder/mwemu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

scemu

x86 32bits emulator, for securely emulating shellcodes

Features

  • rust safety, good for malware. All dependencies are in rust.
  • very fast emulation (much faster than unicorn) 3,000,000 instructions/second 100,000 instructions/second printing every instruction -vv.
  • powered by iced-x86 rust dissasembler awesome library.
  • iteration detector.
  • memory and register tracking.
  • colorized.
  • stop at specific moment and explore the state or modify it.
  • 77 instructions implemented.
  • 49 winapi implemented of 5 dlls.
  • all linux syscalls.
  • SEH chains.
  • vectored exception handler.
  • int3.
  • non debugged cpuid.
  • zero unsafe{} blocks.
  • tests with known payloads:
    • metasploit shellcodes
    • metasploit encoder
    • cobalt strike
    • guloader (not totally for now)

TODO

- more fpu
- mmx
- 64 bits
- scripting?
- stagers: get next stage

Usage

usage

Some use cases

scemu emulates a simple shellcode detecting the execve() interrupt. exploring basic shellcode

We select the line to stop and inspect the memory. inspecting basic shellcode

After emulating near 2 million instructions of GuLoader win32 in linux, faking cpuid's and other tricks in the way, arrives to a sigtrap to confuse debuggers. exception handlers

Example of memory dump on the api loader. exception handlers

There are several maps by default, and can be created more with apis like LoadLibraryA or manually from the console.

exception handlers

Emulating basic windows shellcode based on LdrLoadDLl() that prints a message: msgbox

The console allow to view an edit the current state of the cpu: console

The cobalt strike api loader is the same that metasploit, emulating it: api loader

Cobalt Strike API called: cobalt strike

Metasploit rshell API called: msf rshell

Metasploit SGN encoder using few fpu to hide the polymorfism: msf encoded

Metasploit shikata-ga-nai encoder that also starts with fpu: msf encoded