r/eBPF • u/AzozzALFiras • 24d ago
I built an open-source Linux agent that learns your server's "normal" and shuts down anything weird
Hey, been chipping away at a side project called Phage and wanted to put it out there.
Short version: it's a small agent for Linux servers. It spends a while just learning how your box normally behaves, and after that it flags and contains stuff that falls outside that normal, without needing a signature for the specific exploit. So it's less "here is a list of known bad things" and more "this service has never spawned a shell before, and it's never become root with no login session behind it, so something is off."
The part I actually care about is what happens next. Most tools just fire an alert and, let's be honest, nobody reads alerts. Phage can actually react: if a process starts dialing out like a reverse shell it cuts its network, and if it looks like a real break-in it freezes the process. All of it is reversible, so a false positive doesn't take anything down. It also refuses to touch your SSH session or systemd, because I locked myself out of a test box once doing exactly that lol.
It's Go + eBPF (the detection runs in the kernel so it stays cheap), ships as one static binary, installs with a single command.
Honest status: it's early. I've thrown real attacks at it on my own server and it holds up, but I wouldn't call it production ready yet. MIT licensed, fully open source.
Repo: https://github.com/AzozzALFiras/Phage
Would really appreciate feedback from anyone who runs Linux servers: what would you actually want something like this to catch or do? And does the whole "assume you'll get breached eventually, just make it survivable" idea click for you, or not?
3
u/PeteSampras_MMO 23d ago
Looks neat. Ive forked it and am adding 3rd party network logs as an option, eg suricata and zeek. It will be able to pull from wazuh/opensearch. I was doing this previously with an agent but deterministic is better.
This stacks nicely with a deterministic risk based analysis i have that scores event types within a certain time period and raises them to a triage alert for AI agent review. Its been really good combo at finding red team and honeypot activity. I dont think ive had a real attacker so I can't validate it actually works against adversaries.
Thanks
1
u/hiveminer 23d ago
I love this initiative. If it is a hit, I think database servers could use something similar but for rate limiting. It amazes me that data exfiltrations continue to happen in 2026 and we don't do anything on the db itself. I know there are paid products but damn, they are all expensive. We are putting too much faith on the midtier layer. We need that last line of defense that says, if you're not pulling this data from the OS, your limit is x records per session.
1
u/TemporaryImplement24 19d ago
I've literally been hoping for something like this. Even just a detection mode made specifically for what happens when you put a vulnerable server on the internet. But seriously this is better. Baselining that doesn't require constant babysitting.
1
u/Lucky_Tomatillo7895 7d ago
awesome built!
0
u/GrogRedLub4242 24d ago
I bet AI-gen text and/or code
-1
u/[deleted] 24d ago
[removed] — view removed comment