56

I wrote a dead simple file canary tool that will install an eBPF program that drops all outgoing packets if a canary is touched. I wrote this in response to the current trend of supply chain attacks that try to harvest credentials

you are viewing a single comment's thread
view the rest of the comments
[-] BetterDev@programming.dev 2 points 4 days ago

This is really cool. I appreciate you sharing it. I'm currently building out my homelab to try out various softwares and scenarios, and one of the things I'm worried about is malicious software sneaking in, and compromising my LAN.

In the case that something does, this essentiallyy provides a tripwire which leaves all the evidence intact while stopping the bleed (unless it has a VM escape, but that's another story).

In any case, this is very useful and I'm really glad you made it. Thanks!

[-] lemmyuser@programming.dev 5 points 4 days ago* (last edited 4 days ago)

Yes you can -send-sigstop to SIGSTOP the process and then do whatever you'd like on your -on-touched-exe such as attach via ptrace, dump all memory, etc. My current one will send a notification and dump the memory of the offending process.

Definitely pay attention to the warning about running this on a server. With a KVM attached in a home lab you should be able to easily recover I guess. I think you could also set yourself up a little UDP service to SIGUSR1 the daemon since incoming packets are not dropped, but I haven't tested that.

[Note: intelligent malware can handle the SIGSTOP fairly easily. You could try to move the process to a new cgroup and then freeze the cgroup, as well, but there is a lot to consider here obviously]

[-] MonkderVierte@lemmy.zip 2 points 4 days ago

This should definitely not be run on a server unless you really know what you're doing. You will lose all connectivity and you will never be able to get it back by normal means!

[-] BetterDev@programming.dev 3 points 4 days ago

Uh yeah, that's the whole idea. I can always just bring it offline and mount the root as a separate disk to a different VM to investigate.

[-] BetterDev@programming.dev 1 points 4 days ago

Or even just log in via serial console, but that's not a capability I have coded in yet.

[-] BetterDev@programming.dev 2 points 4 days ago

I guess what I'm saying is I match the "really know what you're doing" criteria.

this post was submitted on 25 Jun 2026
56 points (98.3% liked)

Linux

14131 readers
548 users here now

A community for everything relating to the GNU/Linux operating system (except the memes!)

Also, check out:

Original icon base courtesy of lewing@isc.tamu.edu and The GIMP

founded 3 years ago
MODERATORS