Well today one of our client server had worst ddos attack against server main IP. While analyzing i found it is coming from amazon hacked servers. As amazon is offering free ec2 servers for 1 year so some of people don’t care about it after getting it as free. They do not use it and forget it after getting it. These servers are easy to get hacked and then can be used to attack other servers by hackers.
Here is the quick solution for linux centos 7 to deal with these attacks:
1. Access your server from ssh, you can use putty
2. Once you logged in with root access you have to install network monitoring tool, i found Trafshow tool very help full to see what IPs are attacking.
3. Install it with :
yum install trafshow -y
if you get nothing found error, just install epel-release repo by executing following command:
yum install epel-release -y
4. Once you install Trafshow, now you are ready to check incoming requests from IPs. Run following below command:
trafshow -i eth0 tcp
where eth0 is network card, you need to change it with your network interface. if you’re not sure about network interface, run following command:
It will return all the interfaces.
5. Once you run command trafshow -i eht0 tcp it will display all the connections with IPs. Here you can block them by various techniques. One is to add these IPs in config Server Firewall.
6. Here is the list of amazon IPs: