Skip to content

jeffersoncesarantunes/LinSpec

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

31 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿง LinSpec

Lightweight kernel hardening audit tool for Linux forensic triage and security baseline verification.

Platform-Linux Language-C99 License-MIT Status Tested-on Domain


โ— Etymology & Origin

LinSpec derives from Linux + Inspection (Specification).

The tool was conceptualized as a forensic entry-point, evaluating whether kernel-level protections are correctly enforced before deeper analysis begins.


โ— Overview

LinSpec is a specialized forensic utility designed to audit the security posture of the Linux Kernel in real-time.

It evaluates critical kernel parameters, hardware mitigations, and system-level protection flags to generate a structured security baseline report. It operates as the forensic triage phase, identifying weaknesses before deeper memory analysis.

Core Audit Areas:

  • Memory Protection: ASLR, NX, and DMA restrictions
  • Kernel Hardening: Pointer restrictions, kexec disabled, and dmesg visibility
  • CPU Mitigations: Spectre and Meltdown status
  • Network Stack: BPF JIT hardening and SYN Flood protection

โ— Features

  • Real-time kernel auditing
  • CPU vulnerability detection
  • Forensic Data Export (JSON/CSV)
  • Minimalist terminal UI
  • Pure C99 (no dependencies)
  • PASS / WARN / VULN classification
  • Passive inspection (read-only)
  • Stateless execution

โ— Example Output

[ 01 ]  MEMORY   >  Address Space Layout Randomization     [+] [   PASS   ]
[ 02 ]  KERNEL   >  Kernel Pointer Restriction             [-] [   VULN   ]
[ 03 ]  SYSTEM   >  Yama Ptrace Scope Protection           [+] [   PASS   ]
[ 04 ]  KERNEL   >  Kernel Log Dmesg Restriction           [+] [   PASS   ]
[ 05 ]  NETWORK  >  BPF JIT Compiler Hardening             [!] [   WARN   ]
[ 06 ]  NETWORK  >  TCP SYN Flood Protection (Cookies)     [+] [   PASS   ]
[ 07 ]  SYSTEM   >  Unprivileged User Namespaces           [!] [   WARN   ]

โ— How It Works

LinSpec interfaces directly with:

  • /proc/sys
  • /sys/devices

Audit flow:

  1. Collect kernel security parameters
  2. Normalize and classify values
  3. Compare against a hardened baseline
  4. Assign PASS / WARN / VULN states
  5. Export structured forensic reports

โ— Build and Run

# 1. Clone the repository
git clone https://github.com/jeffersoncesarantunes/LinSpec.git

# 2. Enter the directory
cd LinSpec

# 3. Compile the project
make clean && make

# 4. Run with root privileges for full access
sudo ./linspec

โ— Reports & Integration

After execution, LinSpec generates structured artifacts for external analysis:

  • report.json: Machine-readable data for forensic pipelines
  • report.csv: Tabular format for analysis and documentation

โ— Ecosystem Integration (S.I.R.E.N)

The generated report.json acts as a telemetry layer for the ecosystem:

  • Role: Input source for S.I.R.E.N
  • Capability: Enables adaptive memory acquisition
  • Benefit: Automates forensic capture decisions

โ— The Forensic Ecosystem

LinSpec is the first component of a three-stage forensic workflow:

Tool-LinSpec Tool-SIREN Tool-KScanner


โ— Technical Validation & Evidence

To confirm audit accuracy:

1. Verifying Structured Reports:

column -s, -t < report.csv
cat report.json | grep -A 4 "summary"

2. Verifying Kernel Constraints:

cat /proc/kallsyms | head -n 10
sysctl kernel.unprivileged_userns_clone
sysctl kernel.kexec_load_disabled
cat /proc/cmdline

โ— Project in Action

System Audit Overview 1 - System Audit Overview. Execution of the forensic engine performing baseline triage.

Data Integrity & Reporting 2 - Data Integrity & Reporting. Validation between terminal output and structured reports.

Forensic Kernel Validation 3 - Forensic Kernel Validation. Cross-checking LinSpec results with live kernel state.


โ— Repository Structure

โ”œโ”€โ”€ docs/
โ”‚   โ”œโ”€โ”€ architecture.md
โ”‚   โ”œโ”€โ”€ audit_reference.md
โ”‚   โ”œโ”€โ”€ forensic_methodology.md
โ”‚   โ””โ”€โ”€ threat_model.md
โ”œโ”€โ”€ Imagens/
โ”‚   โ”œโ”€โ”€ linspec1.png
โ”‚   โ”œโ”€โ”€ linspec2.png
โ”‚   โ””โ”€โ”€ linspec3.png
โ”œโ”€โ”€ include/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ checks.h
โ”‚   โ”œโ”€โ”€ main.c
โ”‚   โ”œโ”€โ”€ memory_audit.c
โ”‚   โ””โ”€โ”€ system_audit.c
โ”œโ”€โ”€ report.csv
โ”œโ”€โ”€ report.json
โ”œโ”€โ”€ LICENSE
โ”œโ”€โ”€ Makefile
โ””โ”€โ”€ README.md

โ— Tech Stack

  • Language: C (C99)
  • Data Sources: /proc and /sys
  • Build Tool: GNU Make
  • Target Platforms: Linux Kernel 4.x, 5.x, 6.x

โ— Roadmap

  • High-performance C99 Core Engine
  • Side-channel Vulnerability Detection (Spectre/Meltdown)
  • Brutalist-inspired Terminal UI
  • Structured Output (JSON/CSV Export)
  • Ecosystem Integration (Pre-acquisition Audit for S.I.R.E.N)
  • Automated Remediation (System Hardening)
  • K-Scanner Deep Integration

โ— Documentation

Docs-Architecture Docs-Methodology Docs-Reference Docs-ThreatModel


โ— License

License-MIT

This project is licensed under the MIT License.

About

๐ŸงLightweight forensic kernel hardening audit tool for Linux security baseline verification.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors