My laptop was broken into

Resource monitors showing 200% CPU usage but all normal in other monitors

Initially I titled this «My laptop was hacked» but because the way they got in was by guessing a password, so it’s difficult to consider this a hack. Furthermore, what they did was pretty standard stuff, so although they technically broke into my laptop, I feel more like I invited them, they had a couple of beers and left. Either way, it was a back-to-basics experience for me and I want to share it with you.

When a process goes crazy to a point that I can no longer open a terminal for further analysis, I am really glad that I have permanent real-time resource monitors on my screen. This has been a valuable tool multiple times at least to understand what is happening just by peeking and take quicker and better action than if I hadn’t. This screenshot is from Xfce 4.14:

Top bar on my laptop screen. A lot of monitoring in there.
Top bar on my laptop screen. Lots of monitoring in there.

Today was one of those days. Not that the computer was slow, but worse: the CPU monitor was showing this:

Resource monitors showing 200% CPU usage but all normal in other monitors
The top bar shows two virtual cores being fully used, but nothing else.

Two out of four CPU virtual cores were being used to their maximum capacity but the other monitors were fine. I had not left anything running through the night so it was possible that my computer was hacked. But… how?! Follow the story step-by-step so you can follow my train of thought and learn from my mistakes.

I immediately ran top to find out more and I found process 311250, called kswapd0, using 200% CPU.

Leer más

postfix_delivery_search.bash

Este script sirve para buscar en los logs de Postfix 2.9.6 la historia de entrega de los correos que cumplan con el from= y el to= que se indiquen en el primer y segundo argumento del script, respectivamente. #!/bin/bash # Configuration variables REQUIREMENTS=»gawk grep» LOGSOURCES=»/var/log/mail.info.1 /var/log/mail.info» # Check requirements which $REQUIREMENTS > /dev/null 2>&1 || { echo The following … Leer más

alwayslast.bash

Este script permite poner en un archivo las últimas N líneas de una salida. Por ejemplo, ping […] | alwayslast.bash FILE 10 permitiría que FILE tuviera las últimas 10 líneas de la salida de ping. This script allows for a file to have the las N lines of an output. For example, ping […] | alwayslast.bash FILE … Leer más

Caddeus 0.4

I have just released Caddeus 0.4. Caddeus is a prepared GNUmakefile oriented to the strict quality of C programs. It features an optimal test runner, strict C flags by default, automatic Cppcheck, Clang static analyzer and Valgrind usage if installed on the system.