Many users offer remote access to their office for staff via permitting them to connect directly to the server over the RDP protocol via a port forward on port 3389 direct to a server or workstation. This is a major open door for which hackers can try brute force attacks on your systems and cause not only potential breach of your systems but also stability issues while they try to get in. Recent reports on respected site Bleeping Computer have shown that there are literally millions of systems waiting to be hacked with port 3389 wide open. I know that I’ve helped a number of resellers recover from issues such as this one documented back in May 2017 where hackers used the resellers admin account to compromise the server. Yes – I was able to determine after the fact that it was the resellers account that was used as there are logs left behind to support that. Oh – it gets worse too. Another article from the same site shows that if you are not subject to ransomware as part of the attack, the hackers might well sell access to YOUR server so that others might use it to conduct nefarious activities. $6 is all they charge for a valid account on YOUR server. $6 can get them anonymity to do what they please, and blame it on YOU.
Are you scared yet? You should be.
What can you do to fix this issue? Firstly – close port 3389 at your router. Implement another remote access solution such as RD Gateway. RD Gateway provides for higher levels of security as it permits you to implement higher levels of control over who can gain access to which systems in your network. It also gives better control by funneling all users through the one gateway and therefore permits you to see who is accessing which servers or workstations in your network. The RD Gateway provides a two stage access which is seamless to the users. The user needs to know not only their username and password, but also the name of the server they wish to access. Only then will the RD Gateway Policies permit them through the gateway and onto the server. Port 3389 does NOT need to be exposed on the Internet for this to work.
What if I use a different port for RDP access? Hackers are smart enough to recognise an RDP port regardless of what port number it is on. Changing the port from 3389 to say 3390 won’t stop them – they still win. Therefore changing it is NOT going to help, it will delay them by all of 2 milliseconds as they scan for the next port. No. Close the port. Use a different remote access method.
What if I use strong passwords? Strong passwords should be used regardless of RDP or not. Strong passwords will slow them down, but will not stop them. They simply try for longer before they get in.
If you are not already planning to implement RD Gateway by this point then you need to be prepared to hand over control of your server to the hackers. I’m serious about this as it’s not a matter of IF you will be hacked, but WHEN it will happen. As an experiment I placed a 2 servers behind a firewall. On the same IP, I permitted RDP to go to one server, whilst allowing RD Gateway to go to the other server. Both servers had strong passwords for their accounts. Within 1 hour of doing so, the RDP exposed sever was being hammered on port 3389 by potential hackers. 1 hour. The second server remains a month later still without an attempt to gain remote access to it.
Implement better remote access for your clients today, or be faced with the cleanup of their hacked server. It’s simple really.
Steve Christenberry says
excellant recomendation…..
Wayne Small says
Thanks Steve – I’m constantly dismayed with people leaving this wide open and putting clients at risk. Certainly there are times to make it available, but lock it down to specific source IPs, which is far better than wide open. 🙂
Matthew says
#!/bin/bash
# Continuously monitor the xrdp log file for incoming connections
sudo tail -f /var/log/xrdp.log | while read line
do
# Extract the IP address and port from the captured string
ip_port=$(echo $line | grep -oE “([0-9]{1,3}\.){3}[0-9]{1,3} port [0-9]+”)
# Exclude the IP addresses ip-you-can-trust:
if [ “$ip_port” != “” ] && [ “$ip_port” != “ip-you-can-trust port 3389” ] && [ “$ip_port” != “ip-you-can-trust port 3389” ] && [ “$ip_port” != “ip-you-can-trust port 3389″ ]; then
# Drop the connection using tcpkill
sudo tcpkill -9 host $(echo $ip_port | cut -d ” ” -f 1) port $(echo $ip_port | cut -d ” ” -f 3) >/dev/null 2>&1
# Ban the IP range using ufw
sudo ufw deny from $(echo $ip_port | cut -d ” ” -f 1)/16
# Print the ban message including the IP address and port
echo “Banned IP address: $(echo $ip_port | cut -d ” ” -f 1), port: $(echo $ip_port | cut -d ” ” -f 3)”
fi
done
xrdp solved.