بعض الأشياء المتعلقة بالحماية السيرفرات من تغير تصريح ملفات واغلاق بعض الخدمات الغير لازمة للسيرفر :
اعلاق الخدمات الغير ضرورية :
كود PHP:
service cups-config-daemon stop
chkconfig cups-config-daemon off
service iiim stop
chkconfig iiim off
service mDNSResponder stop
chkconfig mDNSResponder off
service nifd stop
chkconfig nifd off
service rpcidmapd stop
chkconfig rpcidmapd off
service bluetooth stop
chkconfig bluetooth off
service anacron stop
chkconfig anacron off
service gpm stop
chkconfig gpm off
service saslauthd stop
chkconfig saslauthd off
service avahi-daemon stop
chkconfig avahi-daemon off
service avahi-dnsconfd stop
chkconfig avahi-dnsconfd off
service hidd stop
service cups stop
chkconfig cups off
service xfs stop
chkconfig xfs off
service atd stop
chkconfig atd off
service nfslock stop
chkconfig nfslock off
service canna stop
chkconfig canna off
service FreeWnn stop
chkconfig FreeWnn off
chkconfig hidd off
service pcscd stop
chkconfig pcscd off
service sbadm stop
chkconfig sbadm off
service webmin stop
chkconfig webmin off
حماية ملفات النظام :
كود PHP:
echo 1 > /proc/sys/net/ipv4/tcp_syncookies
كود PHP:
chmod 750 /usr/bin/rcp
chmod 750 /usr/bin/wget
chmod 750 /usr/bin/lynx
chmod 750 /usr/bin/links
chmod 750 /usr/bin/scp
كود PHP:
chmod 000 /etc/httpd/proxy/
chmod 000 /var/spool/samba/
chmod 000 /var/mail/vbox/
تركيب LES لحماية ملفات النظام :
كود PHP:
cd /usr/src
wget http://www.r-fx.ca/downloads/les-current.tar.gz
tar -zxvf les-current.tar.gz
cd les*
sh install.sh
/usr/local/sbin/les -ea 1
اغلاق المترجمات
كود PHP:
chmod 000 /usr/bin/perlcc
chmod 000 /usr/bin/byacc
chmod 000 /usr/bin/yacc
chmod 000 /usr/bin/bcc
chmod 000 /usr/bin/cc
chmod 000 /usr/bin/gcc
chmod 000 /usr/bin/i386*cc
كود PHP:
/scripts/compilers off
حمايه أوامر الشل من خلال المجلد bin
أفتح الشل و قم بتنفيذ الأوامر التاليه :
كود PHP:
chmod 700 basename
chmod 700 bash
chmod 700 cat
chmod 700 chmod
chmod 700 domainname
chmod 700 more
chmod 700 netstat
chmod 700 passwd
chmod 700 sh
chmod 700 su
chmod 700 touch
chmod 700 kill
chmod 700 ls
chmod 700 vi
بعد ذلك نقوم بتعزيز الحماية ووضع الصلاحيات البيرل في السيرفر للروت
اكتب الأمر التالي :
كود PHP:
chmod 700 /usr/bin/perl
كود PHP:
chown root:root /usr/bin/perl
حماية tmp :
كود PHP:
/scripts/securetmp
ثم افتح
امام كلمة defaults ضع ( noexec,nosuid ) ليصبح السطر هكذا :
كود PHP:
LABEL=/tmp /tmp ext3 defaults,noexec,nosuid
/tmp /var/tmp ext3 defaults,noexec,nosuid,bind,noauto
none /dev/shm tmpfs defaults,noexec,nosuid
ثم احفظ الملف ونفذ هذا الامر :
umount /dev/shm
mount /dev/shm
الحماية ضد spam
نروح على الخيار التالي من whm :
Main >> Service Configuration >> Exim Configuration Editor
ضع تخت هذا السطر :
كود PHP:
#!!# cPanel Exim 4 Config
ضع تحتة :
log_selector = +arguments +subject
احفظ الملف وسوي ريستارت
كود PHP:
service exim restart
service cpanel restart
المفضلات