HavocFramework / Havoc

The Havoc Framework.
https://havocframework.com
GNU General Public License v3.0
6.72k stars 949 forks source link

[Teamserver-Client-Bug] Can't compile exe payload #342

Closed lesleyxyz closed 1 year ago

lesleyxyz commented 1 year ago

Contact Details

me@lesley.co

What happened?

New Ubuntu 22 installation, compiled client & teamserver with success. When I try and create a payload I get the following error

Did You Do a Pull First?

Latest (You performed a pull first)

Did You Try With the Dev Branch?

Yes (You tried using the dev branch but the problem persist)

Relevant log output

[*] starting build
[*] no sleep obfuscation has been specified
[*] stack duplication option ignored
[*] no proxy loading technique specified (using LdrLoadDll)
[*] amsi/etw patching disabled
[*] config size [484 bytes]
[*] compiling source
[-] couldn't compile implant: exit status 1
[-] compile output: In file included from Include/Common/Clr.h:6,
from Include/Demon.h:12,
from Source/Core/Command.c:1:
Include/Demon.h:300:19: error: ?AddMandatoryAce? undeclared here (not in a function)
300 | WIN_FUNC( AddMandatoryAce )
| ^~~~~~~~~~~~~~~
Include/Core/Win32.h:19:32: note: in definition of macro ?WIN_FUNC?
19 | #define WIN_FUNC(x) __typeof__(x) * x;
| ^
In file included from Include/Common/Clr.h:6,
from Include/Demon.h:12,
from Source/Core/Dotnet.c:1:
Include/Demon.h:300:19: error: ?AddMandatoryAce? undeclared here (not in a function)
300 | WIN_FUNC( AddMandatoryAce )
| ^~~~~~~~~~~~~~~
Include/Core/Win32.h:19:32: note: in definition of macro ?WIN_FUNC?
19 | #define WIN_FUNC(x) __typeof__(x) * x;
| ^
In file included from Include/Common/Clr.h:6,
from Include/Demon.h:12,
from Source/Core/Download.c:1:
Include/Demon.h:300:19: error: ?AddMandatoryAce? undeclared here (not in a function)
300 | WIN_FUNC( AddMandatoryAce )
| ^~~~~~~~~~~~~~~
Include/Core/Win32.h:19:32: note: in definition of macro ?WIN_FUNC?
19 | #define WIN_FUNC(x) __typeof__(x) * x;
| ^
In file included from Include/Common/Clr.h:6,
from Include/Demon.h:12,
from Source/Core/HwBpEngine.c:1:
Include/Demon.h:300:19: error: ?AddMandatoryAce? undeclared here (not in a function)
300 | WIN_FUNC( AddMandatoryAce )
| ^~~~~~~~~~~~~~~
Include/Core/Win32.h:19:32: note: in definition of macro ?WIN_FUNC?
19 | #define WIN_FUNC(x) __typeof__(x) * x;
| ^
In file included from Include/Common/Clr.h:6,
from Include/Demon.h:12,
from Source/Core/HwBpExceptions.c:1:
Include/Demon.h:300:19: error: ?AddMandatoryAce? undeclared here (not in a function)
300 | WIN_FUNC( AddMandatoryAce )
| ^~~~~~~~~~~~~~~
Include/Core/Win32.h:19:32: note: in definition of macro ?WIN_FUNC?
19 | #define WIN_FUNC(x) __typeof__(x) * x;
| ^
In file included from Include/Common/Clr.h:6,
from Include/Demon.h:12,
from Source/Core/Jobs.c:1:
Include/Demon.h:300:19: error: ?AddMandatoryAce? undeclared here (not in a function)
300 | WIN_FUNC( AddMandatoryAce )
| ^~~~~~~~~~~~~~~
Include/Core/Win32.h:19:32: note: in definition of macro ?WIN_FUNC?
19 | #define WIN_FUNC(x) __typeof__(x) * x;
| ^
In file included from Include/Common/Clr.h:6,
from Include/Demon.h:12,
from Source/Core/Kerberos.c:2:
Include/Demon.h:300:19: error: ?AddMandatoryAce? undeclared here (not in a function)
300 | WIN_FUNC( AddMandatoryAce )
| ^~~~~~~~~~~~~~~
Include/Core/Win32.h:19:32: note: in definition of macro ?WIN_FUNC?
19 | #define WIN_FUNC(x) __typeof__(x) * x;
| ^
In file included from Include/Common/Clr.h:6,
from Include/Demon.h:12,
from Source/Core/Memory.c:1:
Include/Demon.h:300:19: error: ?AddMandatoryAce? undeclared here (not in a function)
300 | WIN_FUNC( AddMandatoryAce )
| ^~~~~~~~~~~~~~~
Include/Core/Win32.h:19:32: note: in definition of macro ?WIN_FUNC?
19 | #define WIN_FUNC(x) __typeof__(x) * x;
| ^
In file included from Include/Common/Clr.h:6,
from Include/Demon.h:12,
from Source/Core/MiniStd.c:1:
Include/Demon.h:300:19: error: ?AddMandatoryAce? undeclared here (not in a function)
300 | WIN_FUNC( AddMandatoryAce )
| ^~~~~~~~~~~~~~~
Include/Core/Win32.h:19:32: note: in definition of macro ?WIN_FUNC?
19 | #define WIN_FUNC(x) __typeof__(x) * x;
| ^
In file included from Include/Common/Clr.h:6,
from Include/Demon.h:12,
from Include/Core/MiniStd.h:4,
from Source/Core/Package.c:3:
Include/Demon.h:300:19: error: ?AddMandatoryAce? undeclared here (not in a function)
300 | WIN_FUNC( AddMandatoryAce )
| ^~~~~~~~~~~~~~~
Include/Core/Win32.h:19:32: note: in definition of macro ?WIN_FUNC?
19 | #define WIN_FUNC(x) __typeof__(x) * x;
| ^
In file included from Include/Common/Clr.h:6,
from Include/Demon.h:12,
from Source/Core/Parser.c:1:
Include/Demon.h:300:19: error: ?AddMandatoryAce? undeclared here (not in a function)
300 | WIN_FUNC( AddMandatoryAce )
| ^~~~~~~~~~~~~~~
Include/Core/Win32.h:19:32: note: in definition of macro ?WIN_FUNC?
19 | #define WIN_FUNC(x) __typeof__(x) * x;
| ^
In file included from Include/Common/Clr.h:6,
from Include/Demon.h:12,
from Source/Core/Pivot.c:1:
Include/Demon.h:300:19: error: ?AddMandatoryAce? undeclared here (not in a function)
300 | WIN_FUNC( AddMandatoryAce )
| ^~~~~~~~~~~~~~~
Include/Core/Win32.h:19:32: note: in definition of macro ?WIN_FUNC?
19 | #define WIN_FUNC(x) __typeof__(x) * x;
| ^
In file included from Include/Common/Clr.h:6,
from Include/Demon.h:12,
from Source/Core/Runtime.c:1:
Include/Demon.h:300:19: error: ?AddMandatoryAce? undeclared here (not in a function)
300 | WIN_FUNC( AddMandatoryAce )
| ^~~~~~~~~~~~~~~
Include/Core/Win32.h:19:32: note: in definition of macro ?WIN_FUNC?
19 | #define WIN_FUNC(x) __typeof__(x) * x;
| ^
In file included from Include/Common/Clr.h:6,
from Include/Demon.h:12,
from Source/Core/SleepObf.c:1:
Include/Demon.h:300:19: error: ?AddMandatoryAce? undeclared here (not in a function)
300 | WIN_FUNC( AddMandatoryAce )
| ^~~~~~~~~~~~~~~
Include/Core/Win32.h:19:32: note: in definition of macro ?WIN_FUNC?
19 | #define WIN_FUNC(x) __typeof__(x) * x;
| ^
In file included from Include/Common/Clr.h:6,
from Include/Demon.h:12,
from Source/Core/Socket.c:1:
Include/Demon.h:300:19: error: ?AddMandatoryAce? undeclared here (not in a function)
300 | WIN_FUNC( AddMandatoryAce )
| ^~~~~~~~~~~~~~~
Include/Core/Win32.h:19:32: note: in definition of macro ?WIN_FUNC?
19 | #define WIN_FUNC(x) __typeof__(x) * x;
| ^
In file included from Include/Common/Clr.h:6,
from Include/Demon.h:12,
from Include/Core/MiniStd.h:4,
from Source/Core/Spoof.c:2:
Include/Demon.h:300:19: error: ?AddMandatoryAce? undeclared here (not in a function)
300 | WIN_FUNC( AddMandatoryAce )
| ^~~~~~~~~~~~~~~
Include/Core/Win32.h:19:32: note: in definition of macro ?WIN_FUNC?
19 | #define WIN_FUNC(x) __typeof__(x) * x;
| ^
In file included from Include/Common/Clr.h:6,
from Include/Demon.h:12,
from Source/Core/SysNative.c:1:
Include/Demon.h:300:19: error: ?AddMandatoryAce? undeclared here (not in a function)
300 | WIN_FUNC( AddMandatoryAce )
| ^~~~~~~~~~~~~~~
Include/Core/Win32.h:19:32: note: in definition of macro ?WIN_FUNC?
19 | #define WIN_FUNC(x) __typeof__(x) * x;
| ^
In file included from Include/Common/Clr.h:6,
from Include/Demon.h:12,
from Source/Core/Syscalls.c:1:
Include/Demon.h:300:19: error: ?AddMandatoryAce? undeclared here (not in a function)
300 | WIN_FUNC( AddMandatoryAce )
| ^~~~~~~~~~~~~~~
Include/Core/Win32.h:19:32: note: in definition of macro ?WIN_FUNC?
19 | #define WIN_FUNC(x) __typeof__(x) * x;
| ^
In file included from Include/Common/Clr.h:6,
from Include/Demon.h:12,
from Source/Core/Thread.c:1:
Include/Demon.h:300:19: error: ?AddMandatoryAce? undeclared here (not in a function)
300 | WIN_FUNC( AddMandatoryAce )
| ^~~~~~~~~~~~~~~
Include/Core/Win32.h:19:32: note: in definition of macro ?WIN_FUNC?
19 | #define WIN_FUNC(x) __typeof__(x) * x;
| ^
In file included from Include/Common/Clr.h:6,
from Include/Demon.h:12,
from Source/Core/Token.c:1:
Include/Demon.h:300:19: error: ?AddMandatoryAce? undeclared here (not in a function)
300 | WIN_FUNC( AddMandatoryAce )
| ^~~~~~~~~~~~~~~
Include/Core/Win32.h:19:32: note: in definition of macro ?WIN_FUNC?
19 | #define WIN_FUNC(x) __typeof__(x) * x;
| ^
In file included from Include/Common/Clr.h:6,
from Include/Demon.h:12,
from Source/Core/Transport.c:1:
Include/Demon.h:300:19: error: ?AddMandatoryAce? undeclared here (not in a function)
300 | WIN_FUNC( AddMandatoryAce )
| ^~~~~~~~~~~~~~~
Include/Core/Win32.h:19:32: note: in definition of macro ?WIN_FUNC?
19 | #define WIN_FUNC(x) __typeof__(x) * x;
| ^
In file included from Include/Common/Clr.h:6,
from Include/Demon.h:12,
from Source/Core/TransportHttp.c:1:
Include/Demon.h:300:19: error: ?AddMandatoryAce? undeclared here (not in a function)
300 | WIN_FUNC( AddMandatoryAce )
| ^~~~~~~~~~~~~~~
Include/Core/Win32.h:19:32: note: in definition of macro ?WIN_FUNC?
19 | #define WIN_FUNC(x) __typeof__(x) * x;
| ^
In file included from Include/Common/Clr.h:6,
from Include/Demon.h:12,
from Source/Core/TransportSmb.c:1:
Include/Demon.h:300:19: error: ?AddMandatoryAce? undeclared here (not in a function)
300 | WIN_FUNC( AddMandatoryAce )
| ^~~~~~~~~~~~~~~
Include/Core/Win32.h:19:32: note: in definition of macro ?WIN_FUNC?
19 | #define WIN_FUNC(x) __typeof__(x) * x;
| ^
In file included from Include/Common/Clr.h:6,
from Include/Demon.h:12,
from Source/Core/Win32.c:1:
Include/Demon.h:300:19: error: ?AddMandatoryAce? undeclared here (not in a function)
300 | WIN_FUNC( AddMandatoryAce )
| ^~~~~~~~~~~~~~~
Include/Core/Win32.h:19:32: note: in definition of macro ?WIN_FUNC?
19 | #define WIN_FUNC(x) __typeof__(x) * x;
| ^
In file included from Include/Common/Clr.h:6,
from Include/Demon.h:12,
from Include/Core/MiniStd.h:4,
from Source/Crypt/AesCrypt.c:2:
Include/Demon.h:300:19: error: ?AddMandatoryAce? undeclared here (not in a function)
300 | WIN_FUNC( AddMandatoryAce )
| ^~~~~~~~~~~~~~~
Include/Core/Win32.h:19:32: note: in definition of macro ?WIN_FUNC?
19 | #define WIN_FUNC(x) __typeof__(x) * x;
| ^
In file included from Include/Common/Clr.h:6,
from Include/Demon.h:12,
from Source/Inject/Inject.c:1:
Include/Demon.h:300:19: error: ?AddMandatoryAce? undeclared here (not in a function)
300 | WIN_FUNC( AddMandatoryAce )
| ^~~~~~~~~~~~~~~
Include/Core/Win32.h:19:32: note: in definition of macro ?WIN_FUNC?
19 | #define WIN_FUNC(x) __typeof__(x) * x;
| ^
In file included from Include/Common/Clr.h:6,
from Include/Demon.h:12,
from Source/Inject/InjectUtil.c:1:
Include/Demon.h:300:19: error: ?AddMandatoryAce? undeclared here (not in a function)
300 | WIN_FUNC( AddMandatoryAce )
| ^~~~~~~~~~~~~~~
Include/Core/Win32.h:19:32: note: in definition of macro ?WIN_FUNC?
19 | #define WIN_FUNC(x) __typeof__(x) * x;
| ^
In file included from Include/Common/Clr.h:6,
from Include/Demon.h:12,
from Source/Loader/CoffeeLdr.c:2:
Include/Demon.h:300:19: error: ?AddMandatoryAce? undeclared here (not in a function)
300 | WIN_FUNC( AddMandatoryAce )
| ^~~~~~~~~~~~~~~
Include/Core/Win32.h:19:32: note: in definition of macro ?WIN_FUNC?
19 | #define WIN_FUNC(x) __typeof__(x) * x;
| ^
In file included from Include/Common/Clr.h:6,
from Include/Demon.h:12,
from Source/Loader/ObjectApi.c:5:
Include/Demon.h:300:19: error: ?AddMandatoryAce? undeclared here (not in a function)
300 | WIN_FUNC( AddMandatoryAce )
| ^~~~~~~~~~~~~~~
Include/Core/Win32.h:19:32: note: in definition of macro ?WIN_FUNC?
19 | #define WIN_FUNC(x) __typeof__(x) * x;
| ^
In file included from Include/Common/Clr.h:6,
from Include/Demon.h:12,
from Source/Demon.c:1:
Include/Demon.h:300:19: error: ?AddMandatoryAce? undeclared here (not in a function)
300 | WIN_FUNC( AddMandatoryAce )
| ^~~~~~~~~~~~~~~
Include/Core/Win32.h:19:32: note: in definition of macro ?WIN_FUNC?
19 | #define WIN_FUNC(x) __typeof__(x) * x;
| ^
In file included from Include/Common/Clr.h:6,
from Include/Demon.h:12,
from Source/Main/MainExe.c:1:
Include/Demon.h:300:19: error: ?AddMandatoryAce? undeclared here (not in a function)
300 | WIN_FUNC( AddMandatoryAce )
| ^~~~~~~~~~~~~~~
Include/Core/Win32.h:19:32: note: in definition of macro ?WIN_FUNC?
19 | #define WIN_FUNC(x) __typeof__(x) * x;
| ^

Did You Read Over Your Issue First?

winterrdog commented 1 year ago

i am facing the same problem with the dev branch but with an output like this:

[*] Starting build
[*] Use indirect syscalls
[*] Config size [410 bytes]
[*] Compiling source
[-] Couldn't compile implant: chdir Havoc/Teamserver/data/implants/Demon: no such file or directory
[-] Compile output: 
[ERRO] open Havoc/Teamserver/data/implants/Demon/Source/Core: no such file or directory
[ERRO] open Havoc/Teamserver/data/implants/Demon/Source/Crypt: no such file or directory
[ERRO] open Havoc/Teamserver/data/implants/Demon/Source/Inject: no such file or directory
[ERRO] open Havoc/Teamserver/data/implants/Demon/Source/Loader: no such file or directory
[ERRO] open Havoc/Teamserver/data/implants/Demon/Source/Asm: no such file or directory
[ERRO] Couldn't compile implant: chdir Havoc/Teamserver/data/implants/Demon: no such file or directory
Cracked5pider commented 1 year ago

@lesleyxyz change the compile path in your profile to Compiler64 = "data/x86_64-w64-mingw32-cross/bin/x86_64-w64-mingw32-gcc"

@winterrdog you are using an old version of Havoc. this does not look like the newer version (the folder names should be lower case and there should be more verbose output) Be sure that you really git cloned from the official repo.

winterrdog commented 1 year ago

@Cracked5pider, thanks for the response! Let me do that.


EDIT: using the latest dev branch, fixed my problem :handshake:

lesleyxyz commented 1 year ago

Thanks @Cracked5pider this worked indeed.

I was under the impression that using the --default profile uses profiles/havoc.yaotl, but it doesn't. --default uses /usr/bin/x86_64-w64-mingw32-gcc