Comments (7)
Hello Flangvik,
The issue has been resolved by upgrading python-Dev enviorment. It was set to python-Dev3.5 while the package required python3.6-dev.
from donut.
To fix this, clone the repo, edit the first line of setup.py from this
from setuptools import Extension, setup, sys
To this
from setuptools import Extension, setup
import sys
Then, do
pip3 uninstall donut-shellcode
pip3 install .
pip3 freeze | grep donut-shellcode
from donut.
Thank you Flangvik for your response. the said changes has been applied in donut setup.py file. i am still getting this error.
root@test-virtual-machine:~/donut# pip3 install .
Processing /root/caldera/donut
Building wheels for collected packages: donut-shellcode
Building wheel for donut-shellcode (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /usr/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-x2zk24ek/setup.py'"'"'; file='"'"'/tmp/pip-req-build-x2zk24ek/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-kkzj1j05
cwd: /tmp/pip-req-build-x2zk24ek/
Complete output (20 lines):
running bdist_wheel
running build
running build_ext
building 'donut' extension
creating build
creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/loader
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Iinclude -I/usr/include/python3.6m -c donut.c -o build/temp.linux-x86_64-3.6/donut.o
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Iinclude -I/usr/include/python3.6m -c hash.c -o build/temp.linux-x86_64-3.6/hash.o
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Iinclude -I/usr/include/python3.6m -c encrypt.c -o build/temp.linux-x86_64-3.6/encrypt.o
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Iinclude -I/usr/include/python3.6m -c format.c -o build/temp.linux-x86_64-3.6/format.o
format.c: In function ‘base64_template’:
format.c:58:14: warning: ‘i’ may be used uninitialized in this function [-Wmaybe-uninitialized]
uint32_t i, len, x;
^
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Iinclude -I/usr/include/python3.6m -c loader/clib.c -o build/temp.linux-x86_64-3.6/loader/clib.o
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Iinclude -I/usr/include/python3.6m -c donutmodule.c -o build/temp.linux-x86_64-3.6/donutmodule.o
donutmodule.c:34:20: fatal error: Python.h: No such file or directory
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
ERROR: Failed building wheel for donut-shellcode
from donut.
Based on the error response it still seems you have not applied the changes correctly, import sys is suppose to be on a separate line below
from donut.
Thank you for your response. the said the changes has been applied, now i am getting below error.
=================================================================
ERROR: Command errored out with exit status 1:
command: /usr/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-eu0etpb5/setup.py'"'"'; file='"'"'/tmp/pip-req-build-eu0etpb5/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-dvr7pi5t
cwd: /tmp/pip-req-build-eu0etpb5/
Complete output (6 lines):
Traceback (most recent call last):
File "", line 1, in
File "/tmp/pip-req-build-eu0etpb5/setup.py", line 1
from setuptools import Extension, setup,
^
SyntaxError: trailing comma not allowed without surrounding parentheses
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
from donut.
"trailing comma not allowed without surrounding parentheses"
You have an extra "," after "setup," that needs to be removed.
from from setuptools import Extension, setup,
to from setuptools import Extension, setup
from donut.
Thank your for your quick response.changes applied as suggested, but still getting the error.
from setuptools import Extension, setup
import sys
=======================================================================
pip3 install .
Processing /root/caldera/donut
Building wheels for collected packages: donut-shellcode
Building wheel for donut-shellcode (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /usr/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-p8dj85ur/setup.py'"'"'; file='"'"'/tmp/pip-req-build-p8dj85ur/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-23ee5oph
cwd: /tmp/pip-req-build-p8dj85ur/
Complete output (20 lines):
running bdist_wheel
running build
running build_ext
building 'donut' extension
creating build
creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/loader
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Iinclude -I/usr/include/python3.6m -c donut.c -o build/temp.linux-x86_64-3.6/donut.o
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Iinclude -I/usr/include/python3.6m -c hash.c -o build/temp.linux-x86_64-3.6/hash.o
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Iinclude -I/usr/include/python3.6m -c encrypt.c -o build/temp.linux-x86_64-3.6/encrypt.o
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Iinclude -I/usr/include/python3.6m -c format.c -o build/temp.linux-x86_64-3.6/format.o
format.c: In function ‘base64_template’:
format.c:58:14: warning: ‘i’ may be used uninitialized in this function [-Wmaybe-uninitialized]
uint32_t i, len, x;
^
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Iinclude -I/usr/include/python3.6m -c loader/clib.c -o build/temp.linux-x86_64-3.6/loader/clib.o
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Iinclude -I/usr/include/python3.6m -c donutmodule.c -o build/temp.linux-x86_64-3.6/donutmodule.o
donutmodule.c:34:20: fatal error: Python.h: No such file or directory
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
ERROR: Failed building wheel for donut-shellcode
Running setup.py clean for donut-shellcode
Failed to build donut-shellcode
Installing collected packages: donut-shellcode
Running setup.py install for donut-shellcode ... error
ERROR: Command errored out with exit status 1:
command: /usr/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-p8dj85ur/setup.py'"'"'; file='"'"'/tmp/pip-req-build-p8dj85ur/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/pip-record-e_b50h7m/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.6/donut-shellcode
cwd: /tmp/pip-req-build-p8dj85ur/
Complete output (20 lines):
running install
running build
running build_ext
building 'donut' extension
creating build
creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/loader
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Iinclude -I/usr/include/python3.6m -c donut.c -o build/temp.linux-x86_64-3.6/donut.o
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Iinclude -I/usr/include/python3.6m -c hash.c -o build/temp.linux-x86_64-3.6/hash.o
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Iinclude -I/usr/include/python3.6m -c encrypt.c -o build/temp.linux-x86_64-3.6/encrypt.o
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Iinclude -I/usr/include/python3.6m -c format.c -o build/temp.linux-x86_64-3.6/format.o
format.c: In function ‘base64_template’:
format.c:58:14: warning: ‘i’ may be used uninitialized in this function [-Wmaybe-uninitialized]
uint32_t i, len, x;
^
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Iinclude -I/usr/include/python3.6m -c loader/clib.c -o build/temp.linux-x86_64-3.6/loader/clib.o
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Iinclude -I/usr/include/python3.6m -c donutmodule.c -o build/temp.linux-x86_64-3.6/donutmodule.o
donutmodule.c:34:20: fatal error: Python.h: No such file or directory
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-p8dj85ur/setup.py'"'"'; file='"'"'/tmp/pip-req-build-p8dj85ur/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/pip-record-e_b50h7m/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.6/donut-shellcode Check the logs for full command output.
from donut.
Related Issues (20)
- Not working with CobaltStrike payloads HOT 2
- Support for executables without relocation data HOT 2
- How does work on 32bit
- Huffman in version 1.0
- A generator written in pure Go, supporting Donut v1.0
- Add support for resources HOT 1
- TLS handling referencing the wrong headers
- shellcode gen with error?
- capturing stdout of a donut HOT 1
- Running donut only brings up help menu HOT 4
- Suggestion on encoding the loader HOT 1
- [Feature] - ARM64 support HOT 1
- Rsp adjustment breaks shellcode return HOT 1
- Files with SEH support HOT 2
- Shellcode terminates main thread HOT 1
- Module overloading does not work
- Does donut supports injecting into processes with Dynamic Code Prohibited enabled
- No execution with Akagi64 (UACME) HOT 1
- New Detections on AMSI Patch and Headers
- Problem executing Golang binaries HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from donut.