# HardeningMeter | Open-Source Python Tool Carefully Designed To Comprehensively Assess The Security Hardening

**URL:** <https://onehack.st/t/hardeningmeter-open-source-python-tool-carefully-designed-to-comprehensively-assess-the-security-hardening/282356>\
**Category:** Tools & Scripts\
**Tags:** tools, hacking, freebies, windows\
**Created:** [May 5, 2024, 7:56pm UTC](https://onehack.st/t/hardeningmeter-open-source-python-tool-carefully-designed-to-comprehensively-assess-the-security-hardening/282356 "2024-05-05T19:56:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Prometheus](https://onehack.st/user_avatar/onehack.st/prometheus/32/34950_2.png) [@Prometheus](https://onehack.st/u/Prometheus)\
**Post date:** [May 5, 2024, 7:56pm UTC](https://onehack.st/t/hardeningmeter-open-source-python-tool-carefully-designed-to-comprehensively-assess-the-security-hardening/282356/1 "2024-05-05T19:56:51Z")

</div>

![image](https://onehack.st/uploads/default/original/3X/e/f/efd8aa5efc76f02ab8371cc7bd05d5ac73d194bb.png)

# **Hardening Meter**

Copyright (c) OfriOuzan (B4MB1)

# Description

HardeningMeter is an open-source Python tool carefully designed to comprehensively assess the security hardening of binaries and systems. Its robust capabilities include thorough checks of various binary exploitation protection mechanisms, including Stack Canary, RELRO, randomizations (ASLR, PIC, PIE), None Exec Stack, Fortify, ASAN, NX bit. This tool is suitable for all types of binaries and provides accurate information about the hardening status of each binary, identifying those that deserve attention and those with robust security measures. Hardening Meter supports all Linux distributions and machine-readable output, the results can be printed to the screen a table format or be exported to a csv. (For more information see Documentation.md file)

# Execute Scanning Example

Scan the ‘/usr/bin’ directory, the ‘/usr/sbin/newusers’ file, the system and export the results to a csv file.

```auto
python3 HardeningMeter.py -f /bin/cp -s

```

[![HardeningMeterOutput](https://private-user-images.githubusercontent.com/104366208/287689170-45ae211d-999d-4f08-a0dc-59cb0d488c63.jpeg?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3Lm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UUs0WkElMkYyMDI0MDUwNSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA1MDVUMTk1NTIyWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZjU5YWVkMTYxZTYyYzVkNDM3ZDBjZjI2MDIzZTI0MjgyOWQxZTA5NzkxZDNlNWY5ZGQyYzZlOTFjZDE1NmM1MyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.rUhMmFt_eJLfA6NW0bkIfFT6-BQI3RjlSFvDxSqXWNY)

# Installation Requirements

Before installing HardeningMeter, make sure your machine has the following:

1. `readelf` and `file` commands
2. python version 3
3. pip
4. tabulate

`pip install tabulate`

# Install HardeningMeter

The very latest developments can be obtained via git.

Clone or download the project files (no compilation nor installation is required)

```auto
git clone https://github.com/OfriOuzan/HardeningMeter

```

# Arguments

## -f --file

Specify the files you want to scan, the argument can get more than one file seperated by spaces.

## -d --directory

Specify the directory you want to scan, the argument retrieves one directory and scan all ELF files recursively.

## -e --external

Specify whether you want to add external checks (False by default).

## -m --show\_missing

Prints according to the order, only those files that are missing security hardening mechanisms and need extra attention.

## -s --system

Specify if you want to scan the system hardening methods.

## -c --csv\_format’

Specify if you want to save the results to csv file (results are printed as a table to stdout by default).

# Results

HardeningMeter’s results are printed as a table and consisted of 3 different states:

- (X) - This state indicates that the binary hardening mechanism is disabled.
- (V) - This state indicates that the binary hardening mechanism is enabled.
- (-) - This state indicates that the binary hardening mechanism is not relevant in this particular case.

# Notes

When the default language on Linux is not English make sure to add “LC\_ALL=C” before calling the script.

## GitHub:

> **[GitHub - OfriOuzan/HardeningMeter: HardeningMeter is an open-source Python tool...](https://github.com/OfriOuzan/HardeningMeter)**
>
> HardeningMeter is an open-source Python tool carefully designed to comprehensively assess the security hardening of binaries and systems.
