TheWover / donut

Generates x86, x64, or AMD64+x86 position-independent shellcode that loads .NET Assemblies, PE files, and other Windows payloads from memory and runs them with parameters
BSD 3-Clause "New" or "Revised" License
3.53k stars 628 forks source link

Seg Fault with mcs compilation #29

Closed asaurusrex closed 4 years ago

asaurusrex commented 4 years ago

Noticed that both python and exe versions seem to segfault when used on an mcs compiled .NET payload

odzhan commented 4 years ago

Have you tried running a debug build of donut? For linux, try "make debug" and then paste the output of donut processing the file here. In the meantime, I'll try compiling a .NET binary to test out here.

asaurusrex commented 4 years ago

Built debug of donut on linux, with the command: ./donut -f test.exe -u http://...

Output below:

[ Donut shellcode generator v0.9.2 [ Copyright (c) 2019 TheWover, Odzhan

DEBUG: donut.c:823:DonutCreate(): Entering. DEBUG: donut.c:825:DonutCreate(): Validating configuration and path of file PDONUT_CONFIG: 0x7ffd866c9f40 DEBUG: donut.c:841:DonutCreate(): Validating instance type 2 DEBUG: donut.c:850:DonutCreate(): Validating URL DEBUG: donut.c:881:DonutCreate(): Validating architecture DEBUG: donut.c:891:DonutCreate(): Validating AMSI/WDLP bypass option DEBUG: donut.c:277:get_file_info(): Entering. DEBUG: donut.c:286:get_file_info(): Checking extension of test.exe DEBUG: donut.c:293:get_file_info(): Extension is ".exe" DEBUG: donut.c:315:get_file_info(): Module is EXE DEBUG: donut.c:327:get_file_info(): test.exe into memory DEBUG: donut.c:222:map_file(): Reading size of file : test.exe DEBUG: donut.c:231:map_file(): Opening test.exe DEBUG: donut.c:241:map_file(): Mapping 302080 bytes for test.exe DEBUG: donut.c:336:get_file_info(): Checking DOS header DEBUG: donut.c:342:get_file_info(): Checking NT header DEBUG: donut.c:348:get_file_info(): Checking IMAGE_DATA_DIRECTORY DEBUG: donut.c:356:get_file_info(): Checking characteristics DEBUG: donut.c:368:get_file_info(): COM Directory found Segmentation fault

asaurusrex commented 4 years ago

Devs helped me figure this one out, updated repo should not have these same issues, at least with compiled Linux exe's - have not tested Windows or python yet