Microsoft GSocket research shows that attackers increasingly use GSocket on hacked Linux web servers. GSocket is an open source remote access tool. Microsoft bases this on data from its own Defender antivirus.
Attackers have other ways to keep access, such as adding SSH keys or setting up a reverse shell. According to Microsoft, these can be found or sinkholed. A sinkhole redirects malicious traffic to a system controlled by defenders.
Microsoft explains that GSocket traffic runs through the GSocket relay network. The attacker does not need to register or host any infrastructure. There is also no attacker IP address or domain for organizations to block. Both sides only use outgoing connections to the relay.
The hacked system needs no inbound listener or public IP address. NAT (network address translation) does not stop the connection, and inbound firewall rules do not see the traffic. Egress filtering and monitoring of outgoing traffic can still catch it.
The script can also rename its own process and place files in memory-backed directories. It can install persistence, a way to survive reboots, through cron, systemd and shell profiles.
Attackers still need access to the Linux web server first. According to Microsoft, they mainly exploit vulnerabilities in web applications, such as PHP web applications and cPanel hosting, followed by Apache.
What can you do when a Linux web server is hacked, or before it happens? Microsoft advises you to patch web applications, restrict outgoing traffic, and check cron entries, systemd units and shell startup files. Because there is no attacker IP address or domain to block, outbound monitoring is where you can still spot this activity.
Read microsoft.com article for more information.