How darkdevz/darksward works
This repository is a reference reconstruction of the DarkSword iOS exploit chain, not a general-purpose application. The visible workflow initializes exploit primitives, obtains remote task access, then injects JavaScript into target processes and applies sandbox-related actions. Separate payload and exploit-chain files indicate additional capabilities, but their runtime wiring is not established by the excerpts; those links are omitted. The graph reflects only documented or excerpted relationships, not an assessment of whether the chain works on any particular device.
Main entry points: RemoteCall.js Remote calls · main.js Chain orchestrator · Sandbox.js Sandbox operations · InjectJS.js JavaScript injector
Components 23
Exploit orchestration
- Chain orchestrator
src/main.js - JavaScript injector
src/InjectJS.js - MIG filter bypass
src/MigFilterBypassThread.js - PE stage
pe_stage_1.js - RCE loader
rce_loader.js
Exploit primitives
- Exploit chain
src/libs/Chain/Chain.js - Native access
src/libs/Chain/Native.js - Kernel driver
src/libs/Driver/Driver.js - Device offsets
src/libs/Driver/Offsets.js - Offset tables
src/libs/Driver/OffsetsTable.js
Remote task control
- Remote calls
src/libs/TaskRop/RemoteCall.js - Task and port access
src/libs/TaskRop/Task.js - Exception handling
src/libs/TaskRop/Exception.js - Exception message layout
src/libs/TaskRop/ExceptionMessageStruct.js - Thread state layout
src/libs/TaskRop/ThreadState.js - Mach message layout
src/libs/TaskRop/MachMsgHeaderStruct.js - Virtual memory access
src/libs/TaskRop/VM.js - Sandbox operations
src/libs/TaskRop/Sandbox.js
Injected payloads
- Keychain collection
src/keychain_copier.js - iCloud collection
src/icloud_dumper.js - File collection
src/file_downloader.js - Injection loader
src/loader.js
Other components
- Device operator
Connections 20
- Device operator → Chain orchestrator: starts
- Chain orchestrator → Kernel driver: initializes
src/main.js - Chain orchestrator → Exploit chain: runs exploit
src/main.js - Chain orchestrator → Remote calls: opens launchd task
src/main.js - Chain orchestrator → Sandbox operations: configures
src/main.js - Chain orchestrator → JavaScript injector: injects scripts
src/main.js - Chain orchestrator → MIG filter bypass: starts bypass
src/main.js - JavaScript injector → Remote calls: creates task
src/InjectJS.js - Remote calls → Task and port access: uses task access
src/libs/TaskRop/RemoteCall.js - Remote calls → Exception handling: handles exceptions
src/libs/TaskRop/RemoteCall.js - Remote calls → Exception message layout: reads messages
src/libs/TaskRop/RemoteCall.js - Remote calls → Thread state layout: sets thread state
src/libs/TaskRop/RemoteCall.js - Remote calls → Mach message layout: builds messages
src/libs/TaskRop/RemoteCall.js - Remote calls → Virtual memory access: accesses memory
src/libs/TaskRop/RemoteCall.js - Sandbox operations → Task and port access: uses task access
src/libs/TaskRop/Sandbox.js - Sandbox operations → Remote calls: performs remote calls
src/libs/TaskRop/Sandbox.js - Kernel driver → Device offsets: loads offsets
src/libs/Driver/Driver.js - Device offsets → Offset tables: selects offsets
src/libs/Driver/Offsets.js - PE stage → Exploit chain: supports exploit stage
- RCE loader → Injection loader: may load