Just an obvious question.

Was the distro you were using kept up to date with security patches etc.

Most distros have tools for that.

Doing so, along with other sensible measures (see many...