r/lowlevel • • 11d ago

SysArmor: A lightweight Linux system hardening tool written in pure C and Assembly (zero dependencies)

Hey everyone! I built **SysArmor**, a zero-dependency system hardening and security miffing tool written entirely in pure C and Assembly.

It uses POSIX system calls (like `open` with `O_NOFOLLOW` and `fstat`) to protect critical system paths against symlink attacks, race conditions, and unauthorized modifications across all standard Linux distros (Ubuntu, Debian, Fedora, Arch, etc.).

If you're into low-level systems programming, terminal utilities, or want to check it out, the repository is here:

👉 **https://github.com/error0941/sysarmor**

I’d love to hear your feedback, code reviews, or suggestions!

0 Upvotes

5 comments sorted by

1

u/minektur 11d ago

This .... checks the permissions of 3 files.... and changes it if they're not what expected? skipping the use of libc by making raw syscalls? Thats it?

What is the threat model that you're trying to detect? How does this address that threat?

1

u/Apart_Case4994 10d ago

Evet, çekirdek mantığı şu an kritik dosyaların izin sapmalarını denetleyip düzeltmek ve bunu libc katmanını atlayarak doğrudan x86_64 syscall ile yapmak üzerine kurulu. Tehdit modelim kritik dosyalardaki izin bozulmaları ve kullanıcı alanı libc bağımlılığı/manipülasyonu. Bunun tam bir EDR veya LSM (AppArmor/SELinux) alternatifi olmadığını biliyorum; şu an çekirdek modülü/sertleştirme hattını adım adım büyütüyorum."

2

u/minektur 10d ago

This is pretty much what tripwire and 30 other existing pieces of software do - look for filesystem configurations that are incorrect and report/mitigate/correct.

I'm skeptical that the additional complexity of direct syscalls is worth doing. Any rootkit you have is going to hook the syscalls themselves and not rely on replacing libc, so you're going to get incorrect data from the rootkit anyway. You go to a lot of effort to cover the the case of the attacker having been able to replace libc, but if they can replace libc they can ALSO replace anything else, including your detector.

This is what I was asking about with threat models - "Suppose an attacker were able to replace libc and change permissions on some critical system files - how might we detect and mitigate that?" In which case this isn't enough for any of the real potential threats.

Your project does look like a fun way to learn about system programming, but not much more. If I've missed some nuance in what you're working toward please accept my apologies.

1

u/Apart_Case4994 10d ago

Çok haklısın zaten ciddi değil pek yani geliştirile bilir yani yorumlarda en mantıklı konuşan kişi sensin yorumun için Teşekkür ederim çok sağol

1

u/Apart_Case4994 10d ago

Katılıyorum, şu anki hali daha çok işin mekaniğini öğrenme pratiği. İleride işin içine bütünlük kontrolü veya daha net bir tehdit modeli oturtmaya çalışırım. yorum için sağol.