osCTRL is a cross-platform Go library and agent toolkit for endpoint monitoring, compliance auditing, host containment, and remote-control automation. It provides APIs to interact with OS primitives, inspect system security posture, capture multi-monitor screens, simulate user input, isolate network traffic, and scan software and code inventories.
The table below outlines inventory discovery, security posture checks, and repository scanning across Windows, macOS, and Linux:
| Feature | Windows | macOS (Darwin) | Linux (X11 / Wayland) | Details & Implementation |
|---|---|---|---|---|
| Installed Software | ✅ Full | ✅ Full | ✅ Full | Win: 32/64-bit Registry Uninstall keys (HKLM/HKCU)Mac: /Applications, ~/Applications, & HomebrewLinux: dpkg, rpm, pacman, apk, snap, flatpak |
| Running Processes | ✅ Full | ✅ Full | ✅ Full | Process enumeration (PID, binary path, command line arguments) |
| Hard Drive Encryption | ✅ Full | ✅ Full | ✅ Full | Win: BitLocker (manage-bde)Mac: FileVault ( fdesetup status)Linux: LUKS ( lsblk / dmsetup) |
| Screen Auto-Lock | ✅ Full | ✅ Full | Win: Lock screen idle timeout Mac: sysadminctl / defaultsLinux: GNOME gsettings / X11 screensaver |
|
| Automatic Updates | ✅ Full | ✅ Full | ✅ Full | Win: Windows Update Service (wuauserv)Mac: softwareupdate --scheduleLinux: unattended-upgrades / package timers |
| Code Repository Scanner | ✅ Full | ✅ Full | ✅ Full | Multi-threaded AST/manifest parser for Go, Python, JavaScript/TypeScript, Java, Ruby, and .NET |
The table below outlines incident response containment, process termination, and command execution across Windows, macOS, and Linux:
| Feature | Windows | macOS (Darwin) | Linux (X11 / Wayland) | Details & Implementation |
|---|---|---|---|---|
| Network Isolation | ✅ Full | ✅ Full | ✅ Full | Win: netsh advfirewall firewall rulesMac: pfctl packet filter anchorsLinux: nftables atomic table swap (/etc/nftables.conf) |
| IP Whitelisting | ✅ Full | ✅ Full | ✅ Full | Preserves access to control plane / approved IP addresses during host containment |
| Command Execution | ✅ Full | ✅ Full | ✅ Full | Shell execution via cmd.exe/powershell (Windows), /bin/zsh (macOS), and /bin/bash (Linux) |
| Process Termination | ✅ Full | ✅ Full | ✅ Full | Force-kill processes by PID (taskkill / Win32 TerminateProcess / SIGKILL) |
The table below outlines screen capture, accessibility introspection, and input simulation across Windows, macOS, and Linux:
| Feature | Windows | macOS (Darwin) | Linux (X11) | Linux (Wayland) | Details & Implementation |
|---|---|---|---|---|---|
| Multi-Display Capture | ✅ Full | ✅ Full | ✅ Full | ✅ Full | Win: System.DrawingMac: CoreGraphics Linux: import/scrot + convert (X11) / grim (Wayland) |
| Cursor Position | ✅ Full | ✅ Full | ✅ Full | ❌ Not Supported | Global cursor coordinates are unavailable on Wayland by protocol design |
| UI Element Tree | ✅ Deep Tree | Win: Win32 GetForegroundWindow / GetWindowRectMac: AXUIElement recursive accessibility treeLinux: xdotool + xwininfo + xprop |
|||
| Mouse Move & Click | ✅ Full | ✅ Full | ✅ Full | ❌ Limited | Win: user32.dll (SetCursorPos, mouse_event)Mac: CoreGraphics CGO Linux: xdotool |
| Mouse Drag | ✅ Full | ✅ Full | ✅ Full | ❌ Limited | Drag simulation with Left / Right / Middle buttons |
| Keyboard Typing | ✅ Full | ✅ Full | ✅ Full | ❌ Limited | Win: KEYEVENTF_UNICODEMac: Native CoreGraphics events Linux: xdotool type |
| Keyboard Hotkeys | ✅ Full | ✅ Full | ✅ Full | ❌ Limited | Modifier key combos (Ctrl, Shift, Alt, Win/Cmd) with reverse keyup release |
| System Wait | ✅ Full | ✅ Full | ✅ Full | ✅ Full | Execution delays between action batches |
- Software Inventory:
- Windows: Queries 32-bit and 64-bit Registry paths (
HKLM\Software\Microsoft\Windows\CurrentVersion\UninstallandHKCU). - macOS: Parses system applications (
/Applications,~/Applications) and active Homebrew installations. - Linux: Queries native package managers (
dpkg,rpm,pacman,apk), snaps, and flatpaks.
- Windows: Queries 32-bit and 64-bit Registry paths (
- Security Sensors:
- Disk Encryption: Checks BitLocker status on Windows via
manage-bde, FileVault status on macOS viafdesetup status, and LUKS block devices on Linux vialsblk/dmsetup. - Screen Lock Timeout: Detects screen saver and power idle lock thresholds.
- Auto Updates: Verifies that scheduled automated OS updates are active.
- Disk Encryption: Checks BitLocker status on Windows via
- Universal Code Scanner:
- Multi-threaded scanner identifying project types and extracting package manifests: Go (
go.mod), Python (pyproject.toml,requirements.txt,Pipfile), JS/TS (package.json), Java (pom.xml,build.gradle), Ruby (Gemfile), and .NET (.csproj,.fsproj,.vbproj). - Platform-aware exclusion lists automatically ignore OS noise (
AppData,Program Files,$Recycle.Binon Windows,/System,/Libraryon macOS) and build caches (node_modules,vendor,.venv, Go module cache).
- Multi-threaded scanner identifying project types and extracting package manifests: Go (
- Windows: Adds block rules via
netsh advfirewallfor all inbound/outbound network traffic while creating high-priority exceptions for whitelisted IPs. - macOS: Loads
pfctlrules blocking network traffic outside of whitelisted IP destinations. - Linux: Backs up
/etc/nftables.confand atomically swaps the active table with an isolation ruleset allowing only loopback and whitelisted IPs. Restores previous configuration on un-isolate.
- Screenshots:
- Windows: Captured per screen using
System.Drawing.Graphics.CopyFromScreenvia non-interactive PowerShell. - macOS: Captured per display via
CGDisplayCreateImagewith native cursor overlay. - Linux (X11): Captured via
importorscrot, cropped per display viaconvertusingxrandrgeometry. - Linux (Wayland): Captured per-output via
grim -owithwlr-randr, or single combined capture via GNOME portal.
- Windows: Captured per screen using
- UI Element Tree (
FetchFocusedElement):- Windows: Inspects foreground window via
user32.dll(GetForegroundWindow,GetWindowRect,GetWindowTextW) and resolves executable name viaQueryFullProcessImageName. - macOS: Full deep UI hierarchy traversal via
AXUIElementCopyAttributeValueresolving nested interactive controls, roles, labels, and bounding boxes. - Linux: Inspects active window via
xdotool getactivewindow,xwininfo, andxprop(WM_CLASS), providing window title, dimensions, center click point, and application name.
- Windows: Inspects foreground window via
Supported actions in RemoteControlActionBatch:
| Action | Parameters | Description |
|---|---|---|
mouse.move |
x (int), y (int) |
Moves cursor to target screen coordinates |
mouse.click |
x (int), y (int), button ("left" / "right" / "middle"), delay_ms (int) |
Positions cursor, pauses, and clicks specified button |
mouse.drag |
from_x, from_y, to_x, to_y, button |
Performs mouse drag from origin to destination coordinates |
keyboard.press |
key (int / string), key_name (string) |
Presses and releases an individual key code or key name |
keyboard.type |
text (string) |
Types arbitrary text with Unicode support |
keyboard.hotkey |
keys (list / comma-string) |
Presses modifier keys in sequence and releases in reverse order (e.g. ["ctrl", "c"], ["cmd", "space"]) |
system.wait |
ms (int) |
Pauses execution for the specified duration |
osctrl is designed for clean cross-compilation with zero CGO dependencies required for Linux and Windows targets:
# Windows (amd64)
GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go build ./...
# macOS (arm64 / amd64)
GOOS=darwin go build ./...
# Linux (amd64)
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build ./...