❌

Reading view

There are new articles available, click to refresh the page.

Linux: Zapper – How Hackers Hide Malicious Process

Welcome back, pentesters!

The more experienced a hacker becomes, the harder they are to detect. Beginners are often noisy and leave plenty of traces behind. As they gain experience, they learn to think like defenders and understand how detection actually works.

Today, we’re going to look at a tool that can hide your processes. It’s Zapper. We’ve already seen reports of it being used by hackers to masquerade their long running processes and make them look legitimate.

What is Zapper?

Zapper is a tool created by Hacker’s Choice. Unlike a lot of crude hiding methods, it actually works well. Zapper doesn’t need root privileges to run and it can work even as a static binary, one you can rename too.

how zapper works

Not only can you hide the command line itself, but the environment variables of a process too, along with what’s in /proc/<PID>/environ. The tool doesn’t depend on LD_PRELOAD or libc tricks, it uses ptrace() to manipulate the ELF Auxiliary Vector instead. The performance overhead is tiny, so you won’t even notice it.

Using Zapper

First you need to get the binary. Let’s use the command from the project repository:

bash$ > curl -fL -o zapper https://github.com/hackerschoice/zapper/releases/latest/download/zapper-linux-$(uname -m) && chmod 755 zapper && ./zapper -h
downloading zapper

Defenders often monitor traffic and certain keywords may trigger alerts. So it’s best to rename the tool and then host it on your C2.Β 

bash$ > mv zapper systemd-control
renaming zapper to a system-looking binary name

Here we renamed the binary to systemd-control. On many Linux distros, the actual systemd components live inside /lib/systemd, so placing the renamed file there and changing the timestamps can make it hard to catch, unless someone’s monitoring that directory too. That’s basically why you as a defender can’t rely purely on filename based detection.

The help menu has plenty of examples and shows some creative ways you can use the tool:

bash$ > ./systemd-control -h
zapper help menu

Hackers can hide binaries along with their child processes. They can create hidden tmux sessions to maintain persistence on a server without showing up in normal process listings. They can also leave the program name exposed but strip all the command line options, making the process look generic.

For the demonstration we’ll hide an nmap scan and all its arguments:

bash$ > exec ./systemd-control -f -a '[kworker/2:2-events_power_efficient]' nmap IP -Pn -sV -sC > /dev/shm/scan.txt &
running zapper and trying to detect it

This command makes it look like a kernel worker thread. Most admins would just ignore it. While it’s running, you won’t find it anywhere with ps or any other tool. The scan results were saved in /dev/shm/scan.txt, that proves it worked.

bash$ > ps aux | grep nmap 
# no nmap in ps

bash$ > cat scan.txt
reading the results of the scan

You should try it on a pentest to emulate a realistic threat and see whether defenders can catch it.

Summary

Zapper can help when you need to hide a suspicious long running process. It masquerades them as something legitimate that every admin would just skip past. The commands and arguments can’t be found in /proc either. You don’t need root to work with it, so it’s suitable for a lot of engagements. With all these qualities, it gained popularity fast and has already been seen in DFIR reports on cyberattacks.

If you like Linux and want to advance your skills, consider joining our Advanced Linux for Hackers training.

The post Linux: Zapper – How Hackers Hide Malicious Process first appeared on Hackers Arise.

❌