Azure/Stormspotter

Stormcollector Container?

digitalohm opened this issue · 5 comments

Any chance there is a collector container? Tons of errors attempting to run the collector from various systems

I struggled with this as well, for longer than I want to admit.
Using pipenv ended up solving my errors.
The process I used on Ubuntu WSL
sudo apt install pipenv
cd {directory where sscollector.py is located}
pipenv install .
python3 sscollector.py -h

Good luck!

@jllangley what version of ubuntu on wsl? I just installed a fresh version and:

/Stormspotter$ pipenv install . Traceback (most recent call last): File "/usr/bin/pipenv", line 33, in <module> sys.exit(load_entry_point('pipenv==11.9.0', 'console_scripts', 'pipenv')()) File "/usr/lib/python3/dist-packages/pipenv/vendor/click/core.py", line 722, in __call__ return self.main(*args, **kwargs) File "/usr/lib/python3/dist-packages/pipenv/vendor/click/core.py", line 697, in main rv = self.invoke(ctx) File "/usr/lib/python3/dist-packages/pipenv/vendor/click/core.py", line 1066, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/usr/lib/python3/dist-packages/pipenv/vendor/click/core.py", line 895, in invoke return ctx.invoke(self.callback, **ctx.params) File "/usr/lib/python3/dist-packages/pipenv/vendor/click/core.py", line 535, in invoke return callback(*args, **kwargs) File "/usr/lib/python3/dist-packages/pipenv/cli.py", line 347, in install from .import core File "/usr/lib/python3/dist-packages/pipenv/core.py", line 21, in <module> import requests File "/usr/lib/python3/dist-packages/pipenv/vendor/requests/__init__.py", line 65, in <module> from . import utils File "/usr/lib/python3/dist-packages/pipenv/vendor/requests/utils.py", line 27, in <module> from .cookies import RequestsCookieJar, cookiejar_from_dict File "/usr/lib/python3/dist-packages/pipenv/vendor/requests/cookies.py", line 172, in <module> class RequestsCookieJar(cookielib.CookieJar, collections.MutableMapping): AttributeError: module 'collections' has no attribute 'MutableMapping'

Ive also tried the release as is and its missing the orjson module, so I sudo pip3 install orjson however it never seems to get past that error (ParrotOS and Ubuntu).

If I try running the windows release, I end up with ImportError: DLL load failed while importing win32file: The specified module could not be found.

I got the same error while unzipping the release package.

In MAC OS X, I get the following error....

`stormcollector % python3 -m pip install orjson.orjson
Defaulting to user installation because normal site-packages is not writeable
ERROR: Could not find a version that satisfies the requirement orjson.orjson (from versions: none)
ERROR: No matching distribution found for orjson.orjson
WARNING: You are using pip version 21.2.4; however, version 23.0.1 is available.
You should consider upgrading via the '/Applications/Xcode.app/Contents/Developer/usr/bin/python3 -m pip install --upgrade pip' command.
le0239@CP02391L stormcollector % python3 sscollector.pyz
Traceback (most recent call last):
File "/Users/le0239/Desktop/Exclusions/stormspotter-macOS-latest/stormcollector/sscollector.pyz/_bootstrap/init.py", line 77, in import_string
File "/Users/le0239/.shiv/sscollector_1bd411fc852fa05ca6933bd0138f97de0058d44e99e0a9be2fed2a22d9b3d3f6/site-packages/main.py", line 14, in
from stormcollector.aad import query_aad
File "/Users/le0239/.shiv/sscollector_1bd411fc852fa05ca6933bd0138f97de0058d44e99e0a9be2fed2a22d9b3d3f6/site-packages/stormcollector/aad.py", line 12, in
from .utils import sqlite_writer
File "/Users/le0239/.shiv/sscollector_1bd411fc852fa05ca6933bd0138f97de0058d44e99e0a9be2fed2a22d9b3d3f6/site-packages/stormcollector/utils.py", line 7, in
import orjson
File "/Users/le0239/.shiv/sscollector_1bd411fc852fa05ca6933bd0138f97de0058d44e99e0a9be2fed2a22d9b3d3f6/site-packages/orjson/init.py", line 1, in
from .orjson import *
ModuleNotFoundError: No module named 'orjson.orjson'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/Users/le0239/Desktop/Exclusions/stormspotter-macOS-latest/stormcollector/sscollector.pyz/main.py", line 3, in
File "/Users/le0239/Desktop/Exclusions/stormspotter-macOS-latest/stormcollector/sscollector.pyz/_bootstrap/init.py", line 244, in bootstrap
File "/Users/le0239/Desktop/Exclusions/stormspotter-macOS-latest/stormcollector/sscollector.pyz/_bootstrap/init.py", line 82, in import_string
File "/Users/le0239/Desktop/Exclusions/stormspotter-macOS-latest/stormcollector/sscollector.pyz/_bootstrap/init.py", line 60, in import_string
File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1030, in _gcd_import
File "", line 1007, in _find_and_load
File "", line 986, in _find_and_load_unlocked
File "", line 680, in _load_unlocked
File "", line 850, in exec_module
File "", line 228, in _call_with_frames_removed
File "/Users/le0239/.shiv/sscollector_1bd411fc852fa05ca6933bd0138f97de0058d44e99e0a9be2fed2a22d9b3d3f6/site-packages/main.py", line 14, in
from stormcollector.aad import query_aad
File "/Users/le0239/.shiv/sscollector_1bd411fc852fa05ca6933bd0138f97de0058d44e99e0a9be2fed2a22d9b3d3f6/site-packages/stormcollector/aad.py", line 12, in
from .utils import sqlite_writer
File "/Users/le0239/.shiv/sscollector_1bd411fc852fa05ca6933bd0138f97de0058d44e99e0a9be2fed2a22d9b3d3f6/site-packages/stormcollector/utils.py", line 7, in
import orjson
File "/Users/le0239/.shiv/sscollector_1bd411fc852fa05ca6933bd0138f97de0058d44e99e0a9be2fed2a22d9b3d3f6/site-packages/orjson/init.py", line 1, in
from .orjson import *
ModuleNotFoundError: No module named 'orjson.orjson'`

I installed orjson but same error....

Had this issue using the release package as well, even while using pipenv.
Error message:

Traceback (most recent call last):
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/home/kali/Tools/stormspotter/backend/ssbackend.pyz/__main__.py", line 3, in <module>
  File "/home/kali/Tools/stormspotter/backend/ssbackend.pyz/_bootstrap/__init__.py", line 244, in bootstrap
  File "/home/kali/Tools/stormspotter/backend/ssbackend.pyz/_bootstrap/__init__.py", line 39, in run
  File "/home/kali/.shiv/ssbackend_a97216d28b16ccc6da16ba39605ab827bdc606190eca460e5e0782f32541e180/site-packages/main.py", line 5, in main
    uvicorn.run(
  File "/home/kali/.shiv/ssbackend_a97216d28b16ccc6da16ba39605ab827bdc606190eca460e5e0782f32541e180/site-packages/uvicorn/main.py", line 362, in run
    server.run()
  File "/home/kali/.shiv/ssbackend_a97216d28b16ccc6da16ba39605ab827bdc606190eca460e5e0782f32541e180/site-packages/uvicorn/main.py", line 390, in run
    loop.run_until_complete(self.serve(sockets=sockets))
  File "/usr/lib/python3.10/asyncio/base_events.py", line 646, in run_until_complete
    return future.result()
  File "/home/kali/.shiv/ssbackend_a97216d28b16ccc6da16ba39605ab827bdc606190eca460e5e0782f32541e180/site-packages/uvicorn/main.py", line 397, in serve
    config.load()
  File "/home/kali/.shiv/ssbackend_a97216d28b16ccc6da16ba39605ab827bdc606190eca460e5e0782f32541e180/site-packages/uvicorn/config.py", line 278, in load
    self.loaded_app = import_from_string(self.app)
  File "/home/kali/.shiv/ssbackend_a97216d28b16ccc6da16ba39605ab827bdc606190eca460e5e0782f32541e180/site-packages/uvicorn/importer.py", line 23, in import_from_string
    raise exc from None
  File "/home/kali/.shiv/ssbackend_a97216d28b16ccc6da16ba39605ab827bdc606190eca460e5e0782f32541e180/site-packages/uvicorn/importer.py", line 20, in import_from_string
    module = importlib.import_module(module_str)
  File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/home/kali/.shiv/ssbackend_a97216d28b16ccc6da16ba39605ab827bdc606190eca460e5e0782f32541e180/site-packages/backend/main.py", line 9, in <module>
    from backend.parser import SSProcessor
  File "/home/kali/.shiv/ssbackend_a97216d28b16ccc6da16ba39605ab827bdc606190eca460e5e0782f32541e180/site-packages/backend/parser.py", line 11, in <module>
    import orjson
  File "/home/kali/.shiv/ssbackend_a97216d28b16ccc6da16ba39605ab827bdc606190eca460e5e0782f32541e180/site-packages/orjson/__init__.py", line 1, in <module>
    from .orjson import *
ModuleNotFoundError: No module named 'orjson.orjson'

Looks like it may have been caused by a typo in .shiv/ss<filename>/site-packages/orjson/__init__.py that should probably be from orjson import * instead of the current from .orjson import *. I removed the . in front of the orjson in both backend and frontend files, pip install orjson just in case (probably not necessary), and re-ran python3 ssbackend.pyz -h and it looks like it worked. Hopefully this helps someone in the future.