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

Installation via pip on latest Kali Linux #35

Closed
m-1-k-3 opened this issue Apr 29, 2023 · 4 comments
Closed

Installation via pip on latest Kali Linux #35

m-1-k-3 opened this issue Apr 29, 2023 · 4 comments

Comments

@m-1-k-3
Copy link

m-1-k-3 commented Apr 29, 2023

I tried installing stacs via pip in the current Kali docker container (see here). This ended in the following error message:

┌──(root㉿43fc1f01b688)-[/]
└─# pip3 install stacs                                                                                                                                                
Collecting stacs
  Using cached stacs-0.4.15.tar.gz (30 kB)
  Preparing metadata (setup.py) ... done
Requirement already satisfied: click<9.0,>=8.1.0 in /usr/local/lib/python3.11/dist-packages (from stacs) (8.1.3)
Requirement already satisfied: colorama<1.0,>=0.4.0 in /usr/local/lib/python3.11/dist-packages (from stacs) (0.4.6)
Requirement already satisfied: pydantic<2.0,>=1.10.0 in /usr/local/lib/python3.11/dist-packages (from stacs) (1.10.7)
Requirement already satisfied: yara-python<5.0,>=4.2.0 in /usr/local/lib/python3.11/dist-packages (from stacs) (4.3.1)
Requirement already satisfied: zstandard<1.0,>=0.18.0 in /usr/local/lib/python3.11/dist-packages (from stacs) (0.21.0)
Requirement already satisfied: typing-extensions>=4.2.0 in /usr/local/lib/python3.11/dist-packages (from pydantic<2.0,>=1.10.0->stacs) (4.5.0)
Building wheels for collected packages: stacs
  Building wheel for stacs (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [54 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-cpython-311
      creating build/lib.linux-x86_64-cpython-311/stacs
      creating build/lib.linux-x86_64-cpython-311/stacs/scan
      copying stacs/scan/__about__.py -> build/lib.linux-x86_64-cpython-311/stacs/scan
      copying stacs/scan/exceptions.py -> build/lib.linux-x86_64-cpython-311/stacs/scan
      copying stacs/scan/helper.py -> build/lib.linux-x86_64-cpython-311/stacs/scan
      copying stacs/scan/constants.py -> build/lib.linux-x86_64-cpython-311/stacs/scan
      copying stacs/scan/__init__.py -> build/lib.linux-x86_64-cpython-311/stacs/scan
      creating build/lib.linux-x86_64-cpython-311/stacs/scan/model
      copying stacs/scan/model/finding.py -> build/lib.linux-x86_64-cpython-311/stacs/scan/model
      copying stacs/scan/model/ignore_list.py -> build/lib.linux-x86_64-cpython-311/stacs/scan/model
      copying stacs/scan/model/manifest.py -> build/lib.linux-x86_64-cpython-311/stacs/scan/model
      copying stacs/scan/model/pack.py -> build/lib.linux-x86_64-cpython-311/stacs/scan/model
      copying stacs/scan/model/__init__.py -> build/lib.linux-x86_64-cpython-311/stacs/scan/model
      creating build/lib.linux-x86_64-cpython-311/stacs/scan/output
      copying stacs/scan/output/markdown.py -> build/lib.linux-x86_64-cpython-311/stacs/scan/output
      copying stacs/scan/output/pretty.py -> build/lib.linux-x86_64-cpython-311/stacs/scan/output
      copying stacs/scan/output/__init__.py -> build/lib.linux-x86_64-cpython-311/stacs/scan/output
      copying stacs/scan/output/sarif.py -> build/lib.linux-x86_64-cpython-311/stacs/scan/output
      creating build/lib.linux-x86_64-cpython-311/stacs/scan/loader
      copying stacs/scan/loader/filepath.py -> build/lib.linux-x86_64-cpython-311/stacs/scan/loader
      copying stacs/scan/loader/archive.py -> build/lib.linux-x86_64-cpython-311/stacs/scan/loader
      copying stacs/scan/loader/manifest.py -> build/lib.linux-x86_64-cpython-311/stacs/scan/loader
      copying stacs/scan/loader/__init__.py -> build/lib.linux-x86_64-cpython-311/stacs/scan/loader
      creating build/lib.linux-x86_64-cpython-311/stacs/scan/scanner
      copying stacs/scan/scanner/rules.py -> build/lib.linux-x86_64-cpython-311/stacs/scan/scanner
      copying stacs/scan/scanner/__init__.py -> build/lib.linux-x86_64-cpython-311/stacs/scan/scanner
      creating build/lib.linux-x86_64-cpython-311/stacs/scan/filter
      copying stacs/scan/filter/ignore_list.py -> build/lib.linux-x86_64-cpython-311/stacs/scan/filter
      copying stacs/scan/filter/__init__.py -> build/lib.linux-x86_64-cpython-311/stacs/scan/filter
      creating build/lib.linux-x86_64-cpython-311/stacs/scan/entrypoint
      copying stacs/scan/entrypoint/cli.py -> build/lib.linux-x86_64-cpython-311/stacs/scan/entrypoint
      copying stacs/scan/entrypoint/__init__.py -> build/lib.linux-x86_64-cpython-311/stacs/scan/entrypoint
      creating build/lib.linux-x86_64-cpython-311/stacs/scan/loader/format
      copying stacs/scan/loader/format/xar.py -> build/lib.linux-x86_64-cpython-311/stacs/scan/loader/format
      copying stacs/scan/loader/format/__init__.py -> build/lib.linux-x86_64-cpython-311/stacs/scan/loader/format
      copying stacs/scan/loader/format/dmg.py -> build/lib.linux-x86_64-cpython-311/stacs/scan/loader/format
      running build_ext
      building 'stacs.native.archive' extension
      creating build/temp.linux-x86_64-cpython-311
      creating build/temp.linux-x86_64-cpython-311/stacs
      creating build/temp.linux-x86_64-cpython-311/stacs/native
      creating build/temp.linux-x86_64-cpython-311/stacs/native/archive
      creating build/temp.linux-x86_64-cpython-311/stacs/native/archive/src
      x86_64-linux-gnu-gcc -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/usr/local/lib/python3.11/dist-packages/pybind11/include -I/usr/include/python3.11 -c stacs/native/archive/src/archive.cpp -o build/temp.linux-x86_64-cpython-311/stacs/native/archive/src/archive.o -fvisibility=hidden -g0
      stacs/native/archive/src/archive.cpp:9:10: fatal error: archiveentry.cpp: No such file or directory
          9 | #include "archiveentry.cpp"
            |          ^~~~~~~~~~~~~~~~~~
      compilation terminated.
      error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for stacs
  Running setup.py clean for stacs                                                                                                                                                 
Failed to build stacs
Installing collected packages: stacs
  Running setup.py install for stacs ... error
  error: subprocess-exited-with-error
  
  × Running setup.py install for stacs did not run successfully.
  │ exit code: 1
  ╰─> [56 lines of output]
      running install
      /usr/lib/python3/dist-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
        warnings.warn(
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-cpython-311
      creating build/lib.linux-x86_64-cpython-311/stacs
      creating build/lib.linux-x86_64-cpython-311/stacs/scan
      copying stacs/scan/__about__.py -> build/lib.linux-x86_64-cpython-311/stacs/scan
      copying stacs/scan/exceptions.py -> build/lib.linux-x86_64-cpython-311/stacs/scan
      copying stacs/scan/helper.py -> build/lib.linux-x86_64-cpython-311/stacs/scan
      copying stacs/scan/constants.py -> build/lib.linux-x86_64-cpython-311/stacs/scan
      copying stacs/scan/__init__.py -> build/lib.linux-x86_64-cpython-311/stacs/scan
      creating build/lib.linux-x86_64-cpython-311/stacs/scan/model
      copying stacs/scan/model/finding.py -> build/lib.linux-x86_64-cpython-311/stacs/scan/model
      copying stacs/scan/model/ignore_list.py -> build/lib.linux-x86_64-cpython-311/stacs/scan/model
      copying stacs/scan/model/manifest.py -> build/lib.linux-x86_64-cpython-311/stacs/scan/model
      copying stacs/scan/model/pack.py -> build/lib.linux-x86_64-cpython-311/stacs/scan/model
      copying stacs/scan/model/__init__.py -> build/lib.linux-x86_64-cpython-311/stacs/scan/model
      creating build/lib.linux-x86_64-cpython-311/stacs/scan/output
      copying stacs/scan/output/markdown.py -> build/lib.linux-x86_64-cpython-311/stacs/scan/output
      copying stacs/scan/output/pretty.py -> build/lib.linux-x86_64-cpython-311/stacs/scan/output
      copying stacs/scan/output/__init__.py -> build/lib.linux-x86_64-cpython-311/stacs/scan/output
      copying stacs/scan/output/sarif.py -> build/lib.linux-x86_64-cpython-311/stacs/scan/output
      creating build/lib.linux-x86_64-cpython-311/stacs/scan/loader
      copying stacs/scan/loader/filepath.py -> build/lib.linux-x86_64-cpython-311/stacs/scan/loader
      copying stacs/scan/loader/archive.py -> build/lib.linux-x86_64-cpython-311/stacs/scan/loader
      copying stacs/scan/loader/manifest.py -> build/lib.linux-x86_64-cpython-311/stacs/scan/loader
      copying stacs/scan/loader/__init__.py -> build/lib.linux-x86_64-cpython-311/stacs/scan/loader
      creating build/lib.linux-x86_64-cpython-311/stacs/scan/scanner
      copying stacs/scan/scanner/rules.py -> build/lib.linux-x86_64-cpython-311/stacs/scan/scanner
      copying stacs/scan/scanner/__init__.py -> build/lib.linux-x86_64-cpython-311/stacs/scan/scanner
      creating build/lib.linux-x86_64-cpython-311/stacs/scan/filter
      copying stacs/scan/filter/ignore_list.py -> build/lib.linux-x86_64-cpython-311/stacs/scan/filter
      copying stacs/scan/filter/__init__.py -> build/lib.linux-x86_64-cpython-311/stacs/scan/filter
      creating build/lib.linux-x86_64-cpython-311/stacs/scan/entrypoint
      copying stacs/scan/entrypoint/cli.py -> build/lib.linux-x86_64-cpython-311/stacs/scan/entrypoint
      copying stacs/scan/entrypoint/__init__.py -> build/lib.linux-x86_64-cpython-311/stacs/scan/entrypoint
      creating build/lib.linux-x86_64-cpython-311/stacs/scan/loader/format
      copying stacs/scan/loader/format/xar.py -> build/lib.linux-x86_64-cpython-311/stacs/scan/loader/format
      copying stacs/scan/loader/format/__init__.py -> build/lib.linux-x86_64-cpython-311/stacs/scan/loader/format
      copying stacs/scan/loader/format/dmg.py -> build/lib.linux-x86_64-cpython-311/stacs/scan/loader/format
      running build_ext
      building 'stacs.native.archive' extension
      creating build/temp.linux-x86_64-cpython-311
      creating build/temp.linux-x86_64-cpython-311/stacs
      creating build/temp.linux-x86_64-cpython-311/stacs/native
      creating build/temp.linux-x86_64-cpython-311/stacs/native/archive
      creating build/temp.linux-x86_64-cpython-311/stacs/native/archive/src
      x86_64-linux-gnu-gcc -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/usr/local/lib/python3.11/dist-packages/pybind11/include -I/usr/include/python3.11 -c stacs/native/archive/src/archive.cpp -o build/temp.linux-x86_64-cpython-311/stacs/native/archive/src/archive.o -fvisibility=hidden -g0
      stacs/native/archive/src/archive.cpp:9:10: fatal error: archiveentry.cpp: No such file or directory
          9 | #include "archiveentry.cpp"
            |          ^~~~~~~~~~~~~~~~~~
      compilation terminated.
      error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> stacs

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

Tried it also on the latest VM image and got the same error.

@m-1-k-3 m-1-k-3 changed the title Installation on latest Kali docker image Installation on latest Kali Linux Apr 29, 2023
@m-1-k-3 m-1-k-3 changed the title Installation on latest Kali Linux Installation via pip on latest Kali Linux Apr 29, 2023
@darkarnium
Copy link
Contributor

Thanks for raising this one! I'll take a look at what's causing this.

@darkarnium
Copy link
Contributor

First look, it appears that Kali 2023.1 uses Python 3.11 by default - which matches the output provided here. I'll look in to why this fails in this configuration, and update the CI process to build new binary wheels for this configuration.

@darkarnium
Copy link
Contributor

I've just released STACS 0.5.0 which resolves this issue. I've confirmed a build from Git against this branch is working as expected. I've also ensured that the new binary wheels are working on the Kali container from above.

As there doesn't appear to be a binary wheel for yara-python which is compatible with this distribution just yet, you will need libssl-dev to be installed for the build of the Yara Python package. However, as long as that's done, the new version of stacs is pip install-able:

┌──(root㉿0f30788d592c)-[/]
└─# stacs
Usage: stacs [OPTIONS] PATHS...
Try 'stacs --help' for help.

Error: Missing argument 'PATHS...'.

┌──(root㉿0f30788d592c)-[/]
└─# stacs --version
stacs, version 0.5.0

Let me know how you go :)

@m-1-k-3
Copy link
Author

m-1-k-3 commented Apr 29, 2023

Works! Great work as usual, Peter. Thank you very much for your fast fix!

@m-1-k-3 m-1-k-3 closed this as completed Apr 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants