Pentester's Promiscuous Notebook
⌘Ctrlk
TwitterGitHubBlog
Pentester's Promiscuous Notebook
  • README
    • C2
    • Infrastructure
    • OSINT
    • Password Brute Force
    • Perimeter
    • Shells
    • Web
    • Wi-Fi
    • Basics
    • Infrastructure
    • Development
      • API Hashing
      • API Hooking
      • BOF / COFF
      • CFG
      • Code Injection
      • DLL Hijacking
      • Golang
      • Kernel Mode
      • PIC / Shellcode
      • Nim
      • Sandbox Evasion
      • Syscalls
      • Windows API
    • BOF
    • RE
    • WinDbg
    • Git
    • Linux
    • Networking
    • Virtualization
    • Windows
Powered by GitBook
  1. ⚔️Red Team
  2. Development

Nim

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

  • https://s3cur3th1ssh1t.github.io/Playing-with-OffensiveNim/

  • https://github.com/S3cur3Th1sSh1t/Creds/tree/master/nim

  • https://github.com/ajpc500/NimExamples

  • https://huskyhacks.dev/2021/07/17/nim-exploit-dev/

  • https://casvancooten.com/posts/2021/08/building-a-c2-implant-in-nim-considerations-and-lessons-learned/

Install

Windows:

  • https://nim-lang.org/install_windows.html

  • https://git-scm.com/download/win

Linux:

$ sudo apt install mingw-w64 -y
$ sudo apt install nim -y
Or
$ curl https://nim-lang.org/choosenim/init.sh -sSf | sh

Dependencies:

Nim > nimble install winim nimcrypto zippy

Compilation

Basic:

To not popup the console window:

For the best size:

For Windows on Linux:

Add the needed relocation section to the resulting executable (from Windows):

Tools & Packers

  • https://github.com/S3cur3Th1sSh1t/Nim-RunPE

  • https://github.com/S3cur3Th1sSh1t/NimGetSyscallStub

  • https://github.com/chvancooten/NimPackt-v1

  • https://github.com/icyguider/Nimcrypt2

  • https://github.com/adamsvoboda/nim-loader

Last updated 8 months ago

  • Install
  • Compilation
  • Tools & Packers
Nim > nim c program.nim
Nim > nim c --app:gui program.nim
Nim > nim c -d:danger -d:strip --opt:size --passC=-flto --passL=-flto program.nim
$ nim c --cpu:amd64 --os:windows --gcc.exe:x86_64-w64-mingw32-gcc --gcc.linkerexe:x86_64-w64-mingw32-gcc program.nim
Nim > nim c --passL:-Wl,--dynamicbase,--export-all-symbols program.nim