عرض مشاركة واحدة
قديم 25-10-09, 11:09 PM   #1
إداري سابق

 










 

سالم الفريدي غير متواجد حالياً

سالم الفريدي is a glorious beacon of lightسالم الفريدي is a glorious beacon of lightسالم الفريدي is a glorious beacon of lightسالم الفريدي is a glorious beacon of lightسالم الفريدي is a glorious beacon of lightسالم الفريدي is a glorious beacon of lightسالم الفريدي is a glorious beacon of lightسالم الفريدي is a glorious beacon of lightسالم الفريدي is a glorious beacon of lightسالم الفريدي is a glorious beacon of lightسالم الفريدي is a glorious beacon of light

افتراضي [شرح ]الحماية ضد Dos , DDos + تقوية sysctl.conf و host.conf + تركيب جدار csf النا

السلام عليكم ورحمه الله وبركاته


هذا الدرس بحث عنه الكثير

نظراً لما يحدث هذه الايام من هذا النوع من الهجمات

أولا ينصح بتركيب الجدار النارى CSF

يجب ايقاف الbdf لانه يتعارض مع الجدار النارى CSF

ويمكنك ايقافه عن طريق الامر التالى :


كود:
sh disable_apf_bfd.sh
الان نقوم بتركيب الCSF


كود:
cd /root
كود:
rm -fv csf.tgz
wget http://www.configserver.com/free/csf.tgz tar -xzf csf.tgz cd csf sh install.sh
ثم تذهب بعد ذلك الى الWHM

بعدها تذهب الي WHM ثم ConfigServer Security&Firewall

ثم firewall configuration لتعديل اعدادات تشغيل الاسكربت

في الخانه الأولي TESTING = ضع امامها القيمه 0

AUTO_UPDATES = ضع أمامها القيمه 1 ليقوم الأسكربت بالترقيه .

أحفظ الاعدادات بعدها تأكد أن الأسكربت

Firewall Status: Running







♦ تقوية sysctl.conf و host.conf

كود PHP:
cd /etc
كود PHP:

[CENTER]mv sysctl.conf sysctl.conf.css[/CENTER
كود PHP:
pico sysctl.conf 
ضع فيه التالي :

كود PHP:
# Kernel sysctl configuration file for Red Hat Linux 
كود PHP:
[CENTER]#
# For binary values, 0 is disabled, 1 is enabled.  See sysctl(8) and
# sysctl.conf(5) for more details.

# Controls IP packet forwarding
net.ipv4.ip_forward 0

# Controls source route verification
net.ipv4.conf.default.rp_filter 1
net
.ipv4.conf.all.rp_filter 1
net
.ipv4.conf.lo.rp_filter 1
net
.ipv4.conf.eth0.rp_filter 1

# Do not accept source routing
net.ipv4.conf.default.accept_source_route 0
net
.ipv4.conf.all.accept_source_route 0
net
.ipv4.conf.lo.accept_source_route 0
net
.ipv4.conf.eth0.accept_source_route 0

# Disable ICMP Redirect Acceptance
net.ipv4.conf.all.accept_redirects 0
net
.ipv4.conf.lo.accept_redirects 0
net
.ipv4.conf.eth0.accept_redirects 0
net
.ipv4.conf.default.accept_redirects 0

# Enable Log Spoofed Packets, Source Routed Packets, Redirect Packets
net.ipv4.conf.all.log_martians 0
net
.ipv4.conf.lo.log_martians 0
net
.ipv4.conf.eth0.log_martians 0

# Lower retry rates
net.ipv4.tcp_synack_retries 2
net
.ipv4.tcp_syn_retries 3

# Controls the System Request debugging functionality of the kernel
kernel.sysrq 0

# Max File Handlers
fs.file-max 8192
# Disable CTR+ALT+DEL Restart Keys
kernel.ctrl-alt-del 1

# Controls whether core dumps will append the PID to the core filename.
# Useful for debugging multi-threaded applications.
kernel.core_uses_pid 1

# Decrease the time default value for tcp_fin_timeout connection
net.ipv4.tcp_fin_timeout 15

# Decrease the time default value for tcp_keepalive_time connection
net.ipv4.tcp_keepalive_time 1800

# Turn off the tcp_window_scaling
net.ipv4.tcp_window_scaling 0

# Turn off the tcp_sack
net.ipv4.tcp_sack 0

# Turn off the tcp_timestamps
net.ipv4.tcp_timestamps 0

# Enable TCP SYN Cookie Protection
net.ipv4.tcp_syncookies 1

# Enable ignoring broadcasts request
net.ipv4.icmp_echo_ignore_broadcasts 1

# Enable bad error message Protection
net.ipv4.icmp_ignore_bogus_error_responses 1

# Log Spoofed Packets, Source Routed Packets, Redirect Packets
net.ipv4.conf.all.log_martians 1

# Increases the size of the socket queue (effectively, q0).
net.ipv4.tcp_max_syn_backlog 1024

# Increase the tcp-time-wait buckets pool size
net.ipv4.tcp_max_tw_buckets 1440000

# Allowed local port range

net.ipv4.ip_local_port_range 16384 65536[/CENTER
ثم احفظ الملف :

كود PHP:
cd /etc 
كود PHP:

[CENTER]mv host.conf host.conf.css[/CENTER
كود PHP:
pico host.conf 
ضع فيه التالي :

كود PHP:
# Lookup names via DNS first then fall back to /etc/hosts 
كود PHP:
[CENTER]order hosts,bind
# Check for IP address spoofing.
nospoof on
# multiple IP addresses

multi on[/CENTER
هذه الاعدادات سوف تساعد في الحماية ضد هجمات Dos , DDos بالاضافة الى رفع مستوى عمل السيرفر




شرح تركيب mod_dosevasive





اولا ندخل الى الشيل و نطبق الاوامر التالية


كود:
cd /usr/local/src
كود:
wget http://www.nuclearelephant.com/proje..._1.10.1.tar.gz
tar -zxvf mod_evasive_1.10.1.tar.gz cd mod_evasive
لاصحاب الاباتشي نسخة 2.0 x

كود:
/usr/sbin/apxs -cia mod_evasive20.c
و اضافة اللي تحت في ملف httpd.conf

كود:
<IfModule mod_evasive20.c>
كود:
DOSHashTableSize 3097
DOSPageCount 6 DOSSiteCount 100 DOSPageInterval 2 DOSSiteInterval 2 DOSBlockingPeriod 600 </IfModule>
لاصحاب الاباتشي نسخة 1.3 x


كود:
/usr/local/apache/bin/apxs -cia mod_evasive.c
اضافة اللي تحت في ملف httpd.conf

كود:
<IfModule mod_evasive.c>
كود:
DOSHashTableSize 3097
DOSPageCount 6 DOSSiteCount 100 DOSPageInterval 2 DOSSiteInterval 2 DOSBlockingPeriod 600 </IfModule>
و بعدذلك نقول بعمل ريسترت لل httpd وذلك بكتابة الامر التالي :

كود:
/etc/init.d/httpd restart

الشرح من تجميعى فقط


ارجو ان اكون ساهمت فى حل المشكله


سلام عليكم


منقول







التوقيع :
    رد مع اقتباس