11/12 free views
Library/SDK
Library
Endpoint Security

oshi

by oshi

5.0Kstars
895forks
101watchers
Updated 10 months ago
About

OSHI is a cross-platform Java library that provides native operating system and hardware information without requiring additional native dependencies.

Native Operating System and Hardware Information

Primary Use Case

OSHI is primarily used by developers and security professionals who need to programmatically access detailed system information such as OS version, CPU, memory, disk, and sensor data for endpoint protection, security automation, and log analysis. It enables integration of hardware and OS metrics into Java applications across multiple platforms without complex native setups.

Key Features
  • Cross-platform support for Windows, macOS, Linux (including Android), and UNIX variants
  • Retrieves detailed OS and hardware information including processes, CPU, memory, disks, partitions, devices, and sensors
  • JNA-based implementation requiring no additional native library installations
  • Supports Java 6, 8, and Java 11+ with modular JPMS support
  • Optional integration with jLibreHardwareMonitor for enhanced sensor data on Windows
  • Comprehensive documentation including API, FAQ, changelog, and performance considerations
  • Open source under the MIT License with active community and contribution guidelines

Installation

  • Add 'oshi-core' as a dependency in your project using Maven or Gradle dependency manager
  • For Windows sensor data, optionally add the 'jLibreHardwareMonitor' dependency (licensed under MPL 2.0)
  • For Android, include the JNA AAR artifact and exclude OSHI's transitive JAR dependency
  • Ensure your classpath includes OSHI and its dependencies
  • Refer to the FAQ for troubleshooting common JNA-related errors such as NoClassDefFoundError or NoSuchMethodError

Usage

>_ SystemInfo si = new SystemInfo();

Creates a new instance of the SystemInfo class to access system information.

>_ HardwareAbstractionLayer hal = si.getHardware();

Retrieves the hardware abstraction layer from the SystemInfo instance.

>_ CentralProcessor cpu = hal.getProcessor();

Accesses the CPU information from the hardware abstraction layer.

Security Frameworks
Discovery
Collection
Credential Access
Defense Evasion
Execution
Usage Insights
  • Integrate OSHI into endpoint monitoring tools to enrich telemetry with native OS and hardware data for enhanced anomaly detection.
  • Leverage OSHI in automated security orchestration workflows to dynamically collect system state during incident response.
  • Use OSHI as a lightweight cross-platform agent in purple team exercises to simulate reconnaissance and discovery phases.
  • Combine OSHI data with SIEM solutions to improve context for alerts related to system and hardware anomalies.
  • Develop custom security dashboards using OSHI metrics to provide real-time endpoint health and security posture visibility.

Docs Take 2 Hours. AI Takes 10 Seconds.

Ask anything about oshi. Installation? Config? Troubleshooting? Get answers trained on real docs and GitHub issues—not generic ChatGPT fluff.

3 free chats per tool • Instant responses • No credit card

Security Profile
Red Team60%
Blue Team70%
Purple Team65%
Details
LicenseMIT License
LanguageJava
Open Issues976
Topics
operating-system
hardware-information
java
jna
serialnumbers
cpu-usage
memory-usage
disk-utilization
process-list
system-monitoring