How fadi002/unshackle works
Project Type and Purpose
• Unshackle is an open-source, Linux-based, bootable USB tool designed to bypass Windows and Linux user passwords by injecting payloads and replacing system binaries (e.g., sethc.exe).
• The end goal is a self-contained ISO/USB image that, once booted, presents a simple CLI/GUI menu, lets the user pick the target OS, and executes the necessary removal or injection routines.
File Structure Analysis
• Top-Level Build & Config:
• build.sh → orchestrates ISO creation
• inittab → defines init process (menu loader)
• payload.sh → root-level payload launcher
• version → ISO version tag
• Scripts Directory:
• scripts/common → shared helper functions
• scripts/unshackle_menu → launch menu UI
• scripts/unshackle_options → handle user selections
• Source Directory (src):
• unshackle.py → main Python orchestrator
• removal_util.cpp → C++ binary for Windows file operations
• payload.sh → secondary shell payload (Linux support)
• Other Files:
• sethc.exe → Windows sticky-keys binary to be replaced
• unshackle → built executable or linker script
README Insights
• Confirms Linux and Windows support, simple CLI, plans for GUI, and ISO-based deployment.
• Outlines user flow: burn ISO to USB → boot → choose OS → automatic bypass → reboot → trigger sticky-keys hack (Windows).
a. Main Components
1. Build Pipeline
• build.sh
• Packaging scripts
• ISO/USB artifact
2. Boot Environment
• Syslinux/isolinux loader (configured via inittab)
• Linux kernel + initramfs
3. Runtime Control
• unshackle.py (Python orchestrator)
• scripts/unshackle_menu & unshackle_options (menu UI)
4. Payload Execution
• payload.sh (shell script for Linux target)
• removal_util (compiled C++ for Windows FS operations)
• sethc.exe replacement
5. Target File Systems
• Windows partition (NTFS)
• Linux partition (EXT4, etc.)
6. External Interfaces
• USB device (boot medium)
• Host BIOS/UEFI (boots ISO)
b. Relationships & Data Flow
1. User boots from USB → BIOS/UEFI hands off to isolinux
2. inittab → launches unshackle.py
3. unshackle.py → invokes menu scripts → user picks target OS
4. Based on selection:
• Invoke payload.sh (Linux) or removal_util.exe + payload.sh (Windows)
• Scripts mount target partition, backup & replace binaries
5. On success → unmount → reboot
c. Architectural Patterns & Principles
• Modular scripting: separates menu, options, common logic
• Polyglot orchestrator: Python for high-level logic, shell for file ops, C++ for low-level FS manipulation
• Single responsibility: each component (build, menu, payload, removal) has a distinct role
d. Key Technologies & Libraries
• Python 3 (unshackle.py)
• POSIX shell (bash)
• C++ (removal_util.cpp, compiled with g++)
• Syslinux/isolinux (bootloader)
• GNU coreutils (mount, dd, etc.)