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

[BUG] Fail to build on Python 3.12 #752

Open
1 task done
D3vil0p3r opened this issue Oct 21, 2024 · 4 comments
Open
1 task done

[BUG] Fail to build on Python 3.12 #752

D3vil0p3r opened this issue Oct 21, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@D3vil0p3r
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Empire Version

5.11.5

Python Version

3.12

Operating System

Arch Linux

Database

MySQL

Current Behavior

When I build Empire from source, during the building, I get the following error:

  gcc -fno-strict-overflow -Wsign-compare -DNDEBUG -g -O3 -Wall -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/build/python/src=/usr/src/debug/python -flto=auto -ffat-lto-objects -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/build/python/src=/usr/src/debug/python -flto=auto -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/build/python/src=/usr/src/debug/python -flto=auto -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/tmp/makepkg/powershell-empire/src=/usr/src/debug/powershell-empire -flto=auto -fPIC -Iinclude -I/tmp/tmpckfgzqgz/.venv/include -I/usr/include/python3.12 -c donutmodule.c -o build/temp.linux-x86_64-cpython-312/donutmodule.o
  donutmodule.c:199:9: error: initialization of ‘PyObject * (*)(PyObject *, PyObject *)’ {aka ‘struct _object * (*)(struct _object *, struct _object *)’} from incompatible pointer type ‘PyObject * (*)(PyObject *, PyObject *, PyObject *)’ {aka ‘struct _object * (*)(struct _object *, struct _object *, struct _object *)’} [-Wincompatible-pointer-types]
    199 |         Donut_Create, // C wrapper function
        |         ^~~~~~~~~~~~
  donutmodule.c:199:9: note: (near initialization for ‘Donut_FunctionsTable[0].ml_meth’)
  error: command '/usr/bin/gcc' failed with exit code 1

This could be related to TheWover/donut#158

Expected Behavior

Building and installing correctly.

Steps To Reproduce

poetry config --local virtualenvs.in-project true
poetry config --local virtualenvs.prefer-active-python true
poetry install --no-root --compile

Anything else?

No response

@D3vil0p3r D3vil0p3r added the bug Something isn't working label Oct 21, 2024
@D3vil0p3r D3vil0p3r changed the title [BUG] Fail to build by Python 3.12 [BUG] Fail to build on Python 3.12 Oct 21, 2024
@D3vil0p3r
Copy link
Author

D3vil0p3r commented Oct 23, 2024

@vinnybod can you please update donut-shellcode in pyproject.toml to 1.1?

@DevinCarpenter
Copy link

@D3vil0p3r Agreed. Needs to be updated. I ran into the same issue with the version of donut-shellcode currently used.
I posted my notes for an easy fix.

Ran into issue installing donut-shellcode
- Installing donut-shellcode (1.0.2): Failed
ChefBuildError
Backend subprocess exited when trying to invoke build_wheel
Need to change the donut version required to be 1.1 in the pyproject.toml. pyproject.toml is located in the root empire directory
# Change this line
donut-shellcode = { version = "^1.0.2", markers = "platform_machine == 'x86_64' or platform_machine == 'amd64'" }
# To this line
donut-shellcode = { version = "^1.1", markers = "platform_machine == 'x86_64' or platform_machine == 'amd64'" }
We will get another error if we run the install script:
pyproject.toml changed significantly since poetry.lock was last generated. Run `poetry lock [--no-update]` to fix the lock file.
This can be fixed by generating the poetry lock file again
poetry lock
now re-run the install script. Success.
./ps-empire install -y

@vinnybod
Copy link

vinnybod commented Nov 8, 2024

Updated donut in 5.11.6

@D3vil0p3r
Copy link
Author

@DevinCarpenter can you confirm everything works correctly now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants