Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Dockerfile and documentation #16

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

obilodeau
Copy link

I ran into nim and/or mingw-w64 compiler issues when trying to use this project on Arch linux:

{standard input}: Assembler messages:
{standard input}: Error: open SEH entry at end of file (missing .seh_endproc)
Error: execution of an external compiler program '/usr/bin/x86_64-w64-mingw32-gcc -c -w -fmax-errors=3 -mno-ms-bitfields -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions         -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security         -fstack-clash-protection -fcf-protection -DWIN32_LEAN_AND_MEAN -masm=intel -Os -fno-ident   -I/usr/lib/nim -I/home/olivier/[...]/Nimcrypt2 -o /home/olivier/.cache/nim/stub_r/@m..@s..@s..@s..@s..@s..@s..@susr@slib@snim@[email protected] /home/olivier/.cache/nim/stub_r/@m..@s..@s..@s..@s..@s..@s..@susr@slib@snim@[email protected]' failed with exit code: 1

[!] Stub compilation failed! Check stub for errors.
during RTL pass: final
/home/olivier/.cache/nim/stub_r/@m..@s..@s..@s..@s..@s..@s..@susr@slib@[email protected]: In function ‘raiseOutOfMem__system_3740’:
/home/olivier/.cache/nim/stub_r/@m..@s..@s..@s..@s..@s..@s..@susr@slib@[email protected]:1039:1: internal compiler error: in seh_emit_stackalloc, at config/i386/winnt.cc:1055
 1039 | }
      | ^
0x19c77e7 internal_error(char const*, ...)
	???:0
0x6738cc fancy_abort(char const*, int, char const*)
	???:0
0xfc88e8 i386_pe_seh_unwind_emit(_IO_FILE*, rtx_insn*)
	???:0
0x8da73b final_scan_insn(rtx_insn*, _IO_FILE*, int, int, int*)
	???:0
Please submit a full bug report, with preprocessed source (by using -freport-bug).
Please include the complete backtrace with any bug report.
See <https://bugs.archlinux.org/> for instructions.
{standard input}: Assembler messages:
{standard input}: Error: open SEH entry at end of file (missing .seh_endproc)

I figured this would be hard to understand and fix and I figured that Debian/Ubuntu was probably well-tested and working so a docker container was a good idea.

Usage is documented in the README but in case you want to see it in action:

$ docker run -v $PWD:/pack nimcrypt ./nimcrypt -f /pack/to-pack.exe -t pe -o /pack/packed.exe -n -s --no-ppid-spoof
                      ___                                           
                   .-'   `'.                                        
                  /         \                                       
                  |         ;                                       
                  |         |           ___.--,                     
         _.._     |0) ~ (0) |    _.---'`__.-( (_.                   
  __.--'`_.. '.__.\    '--. \_.-' ,.--'`     `""`                   
 ( ,.--'`   ',__ /./;   ;, '.__.'`    __                            
 _`) )  .---.__.' / |   |\   \__..--""  ""'--.,_                    
`---' .'.''-._.-'`_./  /\ '.  \ _.-~~~````~~~-._`-.__.'             
      | |  .' _.-' |  |  \  \  '.               `~---`              
       \ \/ .'     \  \   '. '-._)                                  
        \/ /        \  \    `=.__`~-.   Nimcrypt v2               
   jgs  / /\         `) )    / / `"".`\                             
  , _.-'.'\ \        / /    ( (     / /  3-in-1 C#, PE, & Raw Shellcode Loader
   `--~`   ) )    .-'.'      '.'.  | (                              
          (/`    ( (`          ) )  '-;                             
           `      '-;         (-'                                   

[+] NimlineWhispers2 enabled
[+] String encryption disabled
[+] Sandbox checks disabled
[+] Unhooking ntdll.dll disabled
[+] Verbose messages disabled
[+] Syscall name randomization disabled
Hint: used config file '/nim/config/nim.cfg' [Conf]
Hint: used config file '/nim/config/config.nims' [Conf]
.....................................................................................................................................................................................
/stub.nim(13, 8) Warning: imported and not used: 'os' [UnusedImport]
/stub.nim(11, 8) Warning: imported and not used: 'random' [UnusedImport]
/stub.nim(10, 8) Warning: imported and not used: 'strutils' [UnusedImport]
/stub.nim(12, 8) Warning: imported and not used: 'times' [UnusedImport]
CC: nim/lib/std/private/digitsutils.nim
CC: nim/lib/system/assertions.nim
CC: nim/lib/system/formatfloat.nim
CC: nim/lib/system/dollars.nim
CC: nim/lib/system/io.nim
CC: nim/lib/system.nim
CC: root/.nimble/pkgs/winim-3.9.0/winim/inc/winbase.nim
CC: nim/lib/pure/parseutils.nim
CC: nim/lib/pure/unicode.nim
CC: nim/lib/pure/strutils.nim
CC: root/.nimble/pkgs/winim-3.9.0/winim/winstr.nim
CC: root/.nimble/pkgs/ptr_math-0.3.0/ptr_math.nim
CC: root/.nimble/pkgs/nimcrypto-0.5.4/nimcrypto/utils.nim
CC: root/.nimble/pkgs/nimcrypto-0.5.4/nimcrypto/hash.nim
CC: root/.nimble/pkgs/nimcrypto-0.5.4/nimcrypto/sha2.nim
CC: root/.nimble/pkgs/nimcrypto-0.5.4/nimcrypto/rijndael.nim
CC: root/.nimble/pkgs/nimcrypto-0.5.4/nimcrypto/bcmode.nim
CC: nim/lib/pure/dynlib.nim
CC: nim/lib/windows/winlean.nim
CC: nim/lib/pure/times.nim
CC: nim/lib/std/private/win_setenv.nim
CC: nim/lib/pure/os.nim
CC: root/.nimble/pkgs/nimcrypto-0.5.4/nimcrypto/sysrand.nim
CC: nim/lib/pure/base64.nim
CC: nim/lib/pure/strformat.nim
CC: nim/lib/pure/random.nim
CC: stub.nim
Hint:  [Link]
Hint: gc: refc; opt: size; options: -d:release
1264382 lines; 6.620s; 348.664MiB peakmem; proj: /stub.nim; out: /pack/packed.exe [SuccessX]

[+] Stub compiled successfully as /pack/packed.exe

Let me know if you have any questions.

@obilodeau
Copy link
Author

Don't merge this just yet. I realized today that I'm getting issues similar to #4. I'll investigate and advise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant