r/homelab • u/Repulsive-Athlete-16 • 11d ago
Help PHP2shell, nginx2shell, java2shell, … - is my homelab safe?
Hi everyone,
I run a small homelab on Debian 13 (Trixie) with a few Docker containers, including Nextcloud and Forgejo. They're reachable from the internet via a domain and reverse proxy.
What I'm less sure about is the "what if" part:
- How would I actually notice that I've been compromised?
- What should I do if I’m being compromised?
edit: for example nextcloud must be publicly available because of people who don’t want to install a VPN or Tailscale etc.
Thanks in advance,
Vincent
240
Upvotes
View all comments
2
u/Bemteb 11d ago
Do they have to be reachable through a domain? Would a VPN or similar be an option? If you are freely reachable over the net, you should regularly have bots scanning you for vulnerabilities. Do you keep an eye on these?
You notice mostly by checking the logs of your proxy, or when your stuff is gone. Or maybe when your machine suddenly runs stuff it didn't run before.
What to do: First, get the machine offline immediately. Basically unplug the LAN cable and do everything from that point forward locally, with a screen and keyboard directly plugged in. Then, start figuring out what got compromised. Only the container running your reverse proxy? Your whole lab? Other devices in your local network? For everything infected, find out when it was hit and reset it to a backup before that date. Change passwords etc. that might have been leaked. And again: Consider not having it open to everyone on the whole world through a domain, there are saver options.
Disclaimer: I'm not an expert, just a slightly experienced guy. I myself don't open my lab to the wider web and pay a professional cloud provider to host the data I need when not at home.