Range of IP:61.20.0.0/16 This is a more serious situation, as the other machines on this VPC may be scanned and hence exposed.
Further assuming the hacker puts in a trojon horse, and LB refuses to pay up, the hacker might attack other machines since he has scanned for other machines.
How do we know if the above will happen? If your machines are using the same ssh public key to connect, there's a very good chance that other machines are also hacked.
Next, the production machines's port 22 is 0.0.0.0/0
, this is EXTREMELY DANGEROUS.
短暫處理方式 Close all port 22 for all EC2 machines that you are using. If you really need to connect, only allow internal IP ( for instance people logged in to LB's internet connection ) to connect.
The following security groups are vulnerable
- sg-03a4b867 ec2-laravel-prd1
- sg-1dbd547a rds-loveboni-166-dev1
- sg-27aff043 ec2-designbible-prd1
- sg-37ac4250 ec2-loveboni-166-dev1
- sg-40c64c27 eb-middleware-dev1
- sg-51b25c36 ec2-express-dev1
- sg-55a66732 ec2-laravel-dev1
- sg-830f2ae7 ec2-loveboni-dev1
- sg-8bcf6cec ec2-designbible-dev1
- sg-93bb52f4 ec2-loveboni-prd1
- sg-9653a4f1 ec2-loveboni-166-stg1
- sg-b48120d3 ec2-express-stg1
- sg-c2adb1a6 ec2-loveboni-166-prd1
- sg-d3bc55b4 ec2-loveboni-adm-stg1
- sg-f2948896 ec2-express-prd1
- sg-f4f13a93 ec2-cakephp3-dev1
- Use command line to scan all machines within the above IP range for trojans. If you are using Ubuntu, there are some open source packages to fix this.
- Rebuild all EC2s under the current VPC. DO NOT use the hacked machinese to rebuild AMIs since it is already hacked.
- change all DB related passwords
- set DB's security such that it only allows internal VPC to connect
- place services in private subet,, while web related services MUST only be accessed by ELB. If you need a springboard to connect, please use private P )
- The springboard machine can be placed in public subnet, but ONLY is only accessible by internal internet connection ( as in LB's corporate internet connection )
- create private subnet
- create public subnet
- in general we should avoid using
0.0.0.0/0
, unless we are SUPER sure that the particular service is external facing. Even if this is public facing service, we should config the security group on top of ELB, and not EC2.
- EVERYONE is to enable 2FA, else it's only a matter of time hacking will happen again.
- EVERYONE is to enable 2FA