Skip to content

fix(parsers): harden BumbleBee, DarkGate, MonsterV2, Remcos, and SparkRAT - #86

Merged
doomedraven merged 9 commits into
mainfrom
fix/bumblebee-arc4-unicode
Oct 13, 2026
Merged

doomedraven merged 9 commits into
mainfrom
fix/bumblebee-arc4-unicode

Conversation

@doomedraven

Copy link
Copy Markdown
Collaborator

Summary

  • BumbleBee: Guard extract_key_data against invalid/empty keys before calling ARC4.new(key), scope single-key RC4 config decryption to elif len(key_match) == 1:, guard missing config_match in extract_config_data, and pass errors="replace" when decoding extracted strings.
  • DarkGate: Use config.get("raw", {}) when mapping fields to top-level keys so extract_config does not raise KeyError: 'raw' when a CODE section contains no 1=Yes/1=No config entries.
  • Remcos: Fix v.decoed() typo (v.decode()) and log pefile.PEFormatError at debug level instead of error on non-PE buffers.
  • SparkRAT: Log missing configuration marker at debug level instead of error.
  • MonsterV2 & Tests: Import ChaCha20_Poly1305 from Cryptodome.Cipher, fix HijackLoader import path in tests_parsers/test_hijackloader.py, and add unit tests in tests/.

Guard RC4 key length (1..256 bytes) before calling ARC4.new(), isolate
multi-match key extraction from single-key RC4 ciphertext decryption,
guard missing config_match in extract_config_data(), and pass
errors="replace" when decoding extracted strings.
Use `from Cryptodome.Cipher import ChaCha20_Poly1305` instead of
`from Crypto.Cipher import ChaCha20_Poly1305` to match the repository's
`pycryptodomex` dependency.
Import `extract_config` from `cape_parsers.CAPE.core.HijackLoader`
instead of `cape_parsers.CAPE.community.HijackLoader`.
- Update `tests_parsers/test_adaptixbeacon.py` to match commit 7318d9c
  (`cryptokey`, `cryptokey_type`, and `user_agent` popped from `raw` to
  top-level output).
- Add `@pytest.mark.skipif(not os.path.exists(...), reason="Missed file")`
  to `tests_parsers/test_axolotlloader.py` and
  `tests_parsers/test_docconnect.py` when test samples are absent from
  `CAPE-TestFiles`.
…dlib tests/

`Main CI Pipeline` executes `uvx pytest`, which runs in an isolated
ephemeral `pytest`-only environment without `pycryptodomex`/`pefile`/`yara`.
Move the `BumbleBee` and `MonsterV2` unit tests from `tests/` into
`tests_parsers/test_bumblebee.py` and `tests_parsers/test_monsterv2.py`
where the `Python package` workflow runs `poetry run python -m pytest tests_parsers`.
- Restore `tests/test_bumblebee_unit.py` and `tests/test_monsterv2_unit.py` in `tests/` and revert `tests_parsers/test_bumblebee.py` and `tests_parsers/test_monsterv2.py` to their sample-based tests.
- In `.github/workflows/reusable-setup.yml`, add `$HOME/.local/bin` to `$GITHUB_PATH`, install the dev test dependencies (`pytest`, `pytest-asyncio`, `pytest-mock`, etc.) into `.venv`, and bump the cache key (`uv-v2`) to invalidate the cached `.venv` that lacked `pytest`.
- In `.github/workflows/python-package-uv.yml`, replace `uvx pytest` (which executes in an isolated ephemeral tool environment without `.venv` packages) with `uv run --no-project pytest`.
@doomedraven
doomedraven merged commit ff92f71 into main Oct 13, 2026
7 checks passed
@doomedraven
doomedraven deleted the fix/bumblebee-arc4-unicode branch October 13, 2026 20:30
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

Successfully merging this pull request may close these issues.

1 participant