bytecode77 / living-off-the-land

Fileless attack with persistence
https://bytecode77.com/living-off-the-land
BSD 2-Clause "Simplified" License
279 stars 52 forks source link

Compilation error #3

Closed Xienim closed 3 years ago

Xienim commented 3 years ago

my version of visual studio 2019 is giving an error when downloading the project. when I downloaded it by git clone the project gave a compilation error.

bytecode77 commented 3 years ago

Can you be more specific? What was compilation error? Did you set the startup project to "LivingOffTheLand"?

Xienim commented 3 years ago

I don't know if you made it to be compiled in linux. There is no version 4.0 of dotnet on linux. (error code: MSB3644) Thanks for the quick response. your project is very good !!!

Xienim commented 3 years ago

i have a new error, I don't have the dir /Resources/Payload.exe

bytecode77 commented 3 years ago

Actually, I have never tested this in Linux. It's supported for Windows only. Living Off the Land certainly relies on operating system binaries to help spawn a process from registry (or another media) into memory. That's why it's OS specific.

The Payload.exe resource should be copied after the project "Payload" is compiled. If compilation fails, the executable is not copied to /Resources.

Xienim commented 3 years ago

I managed to compile, but I had some warnings and my .exe works, but it doesn't show the payload message. I can install it with living off the land and use the remover to remove it, but it does not create the payload message. which compiler did you use? I used msbuild.exe

bytecode77 commented 3 years ago

I use MSBuild, too and specifically the default Visual Studio 2019 configuration. Did you try both compilation and installation on Windows?

Do the compiled binaries from my website also not work, or just the one you compiled?

If just your binaries do not work, can you try to debug and see at which point it failed? i.e. when does the program stop working - does it write all registry values, does RunPE fail? etc...

Xienim commented 3 years ago

this is the warning that appeared (C4267 warning - conversion from 'size_t' to 'ULONG' ) yes, i am compiling on windows with visual studio 2019

Xienim commented 3 years ago

the program does not give an error, it is able to execute, but it does not open the payload message.

Xienim commented 3 years ago

all executables in the debug folder work, but when I'm going to run LivingOffTheLand from the Build folder, it doesn't show the payload message.

bytecode77 commented 3 years ago

It's difficult to judge without seeing what exactly you're compiling. But you definitely need to use the release build and not the debug build. Debug builds are not only large (~1 MB), but they tend to fail in scenarios including binary dissection, such as RunPE.

Xienim commented 3 years ago

Can I send my build for you to check?

bytecode77 commented 3 years ago

Sure.

Xienim commented 3 years ago

https://mega.nz/folder/vgpQWApS#PM5NviIMHiHfgU4VzISHJA I went up to the mega for you to view before downloading.

Xienim commented 3 years ago

in my $ Build folder, the livingofftheland.exe file that I compiled is 2.11 MB, but your compiled download file is 240 KB.

bytecode77 commented 3 years ago

From the directory structure alone, I can see that you have compiled using Debug configuration. You need to compile with Release configuration. Then you'll have a 240 KB file that actually works.

Xienim commented 3 years ago

can you explain to me how you compiled it in the release version? sorry I'm new to visual studio

Xienim commented 3 years ago

my solution file always fails -> (there was an attempt to compare numerically in "$ (HostOsVersion)", which is evaluated as "" instead of a number, in the condition "$ (HostOsVersion)") i can't git clone the project with my visual studio

bytecode77 commented 3 years ago

You can change to "Release" build here:

image

It seems like there is something wrong with either your Visual Studio, or you maybe changed the solution by accident. Have you tried downloading a "clean copy" again and compile that one? I'm not aware of the HostOsVersion issue, but it seems like you're not alone.

Xienim commented 3 years ago

I recorded my screen for you to see what happens. https://mega.nz/file/S55CmKpT#fWozP_KOIQX4sIFeh7YPH7cc_wC5oq5wqtYDddxeFw4

bytecode77 commented 3 years ago

I see the error messages in the video, but I don't really know how to help you with these, or even whether they are related to the Solution or Visual Studio itself. All advice I can give you is to update Visual Studio and the OS in case you're using a VM that you haven't updated in a while. Also this issue pops up in Google. Maybe some of the advice there could help. It might also be some VS components that you haven't installed, but I can really only guess.

Xienim commented 3 years ago

i think it might be something i haven't installed, can you send me what is needed to compile your project?

bytecode77 commented 3 years ago

I'm sorry, but I can't help you with your Visual Studio setup.