نمایش نتایج: از شماره 1 تا 1 , از مجموع 1

موضوع: معرفی و آموزش نصب مد Mod_evasive (آنتی دیداس)

  1. #1
    عضو دائم allbert آواتار ها
    تاریخ عضویت
    Apr 2011
    محل سکونت
    شمال-تهران
    نوشته ها
    1,166
    تشکر تشکر کرده 
    178
    تشکر تشکر شده 
    1,086
    تشکر شده در
    791 پست

    پیش فرض معرفی و آموزش نصب مد Mod_evasive (آنتی دیداس)

    یکی از راه های مبارزه با حملات DDost استفاده از مد evasive است.این مد درخواست های مربوط به اپاچی را کنترل کرده و ای پی های مشکوم و مهاجم را برای ۱۰ دقیقه مسدود مینمایید . البته مقدار حساسیت برای مانیتورینگ قابل تنظیم و کنترول است .


    آموزش نصب
    در ابتدا پکیج مربوط به httpd-devel را نصب مینماییم :
    # yum install httpd-devel
    سپس فایل مربوط به نصب (mod_evasive_1.10.1.tar.gz ) را دانلود مینماییم :
    #wget http://pkgs.fedoraproject.org/repo/p..._1.10.1.tar.gz

    فایل را از حالت فشرده خارج میکنیم :
    # tar xvzf mod_evasive_1.10.1.tar.gz mod_evasive/
    به دایرکتوری مورد نظر میرویم :
    cd mod_evasive
    فایل های زیر باید در این دایرکتوری مشاهده شوند :


    mod_evasive/.cvsignore ; mod_evasive/LICENSE ; mod_evasive/Makefile.tmpl ; mod_evasive/README ; mod_evasive/mod_evasive.c ; mod_evasive/mod_evasive20.c ; mod_evasive/mod_evasiveNSAPI.c ; mod_evasive/test.pl ; mod_evasive/CHANGELOG
    از قرار داشتن ۲ فایل ReadMe و Changelog اطمینان حاسل نمایید . ( وجود این ۲ فایل بی دلیل نیست . . .)


    برای کامپایل و نصب دستور زیر را وارد نمایید :


    /usr/sbin/apxs -cia /usr/src/mod_evasive/mod_evasive20.c
    بعد از وارد کردن دستور بالا خروجی زیر را مشاهده مینمایید :


    /usr/lib/apr-1/build/libtool –silent –mode=compile gcc -prefer-pic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector –param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -fno-strict-aliasing -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -pthread -I/usr/include/httpd -I/usr/include/apr-1 -I/usr/include/apr-1 -c -o mod_evasive20.lo mod_evasive20.c && touch mod_evasive20.slo
    mod_evasive20.c: In function ‘access_checker’: mod_evasive20.c:212: warning: implicit declaration of function ‘getpid’ mod_evasive20.c:212: warning: format ‘%ld’ expects type ‘long int’, but argument 4 has type ‘int’ mod_evasive20.c:229: warning: ignoring return value of ‘system’, declared with attribute warn_unused_result mod_evasive20.c: In function ‘destroy_hit_list’: mod_evasive20.c:301: warning: control reaches end of non-void function mod_evasive20.c: In function ‘create_hit_list’: mod_evasive20.c:118: warning: control reaches end of non-void function
    /usr/lib/apr-1/build/libtool –silent –mode=link gcc -o mod_evasive20.la -rpath /usr/lib/httpd/modules -module -avoid-version mod_evasive20.lo /usr/lib/httpd/build/instdso.sh SH_LIBTOOL=’/usr/lib/apr-1/build/libtool’ mod_evasive20.la /usr/lib/httpd/modules /usr/lib/apr-1/build/libtool –mode=install cp mod_evasive20.la /usr/lib/httpd/modules/
    cp .libs/mod_evasive20.so /usr/lib/httpd/modules/mod_evasive20.so
    cp .libs/mod_evasive20.lai /usr/lib/httpd/modules/mod_evasive20.la
    cp .libs/mod_evasive20.a /usr/lib/httpd/modules/mod_evasive20.a
    chmod 644 /usr/lib/httpd/modules/mod_evasive20.a
    ranlib /usr/lib/httpd/modules/mod_evasive20.a
    PATH=”$PATH:/sbin” ldconfig -n /usr/lib/httpd/modules
    حق دسترسی را برای این فایل تنظیم مینماییم :


    chmod 755 /usr/lib/httpd/modules/mod_evasive20.so
    و در آخر سرویس آپاچی را ریستارت میکنیم :


    service httpd restart
    برای اطمینان از نصب و پیکربندی صحیح این مد دستور زیر را وارد نمایید :


    grep -i evasive /etc/httpd/conf/httpd.conf
    خروجی :


    LoadModule evasive20_module /usr/lib/httpd/modules/mod_evasive20.so
    با دستور زیر از لود شدن این مد اطمینان حاصل کنید :


    php -r ‘phpinfo();’ | grep -i evasive
    خروجی :


    Loaded Modules | core prefork http_core mod_so mod_auth_basic mod_auth_digest mod_authn_file mod_authn_alias mod_authn_anon mod_authn_dbm mod_authn_default mod_authz_host mod_authz_user mod_authz_owner mod_authz_groupfile mod_authz_dbm mod_authz_default util_ldap mod_authnz_ldap mod_include mod_log_config mod_logio mod_env mod_ext_filter mod_mime_magic mod_expires mod_deflate mod_headers mod_usertrack mod_setenvif mod_mime mod_dav mod_status mod_autoindex mod_info mod_dav_fs mod_vhost_alias mod_negotiation mod_dir mod_actions mod_speling mod_userdir mod_alias mod_rewrite mod_***** mod_*****_balancer mod_*****_ftp mod_*****_http mod_*****_connect mod_cache mod_suexec mod_disk_cache mod_file_cache mod_mem_cache mod_cgi mod_version **mod_evasive20** mod_perl mod_php5 mod_*****_ajp mod_python mod_ssl |

    خب مراحل نصب با موفقیت به پایان رسید و حالا نوبت پیکربندی این مد برای مانیتورینگ و جلوگیری از دسترسی های غیر مجاز است .


    برای پیکربندی یکی از متغیر های زیر را در فایل مربوط به کانفیگ اپاچی (httpd.conf) وارد نمایید :


    <IfModule mod_dosevasive20.c>
    DOSHashTableSize ۳۰۹۷
    DOSPageCount ۶
    DOSSiteCount ۱۰۰
    DOSPageInterval ۲
    DOSSiteInterval ۲
    DOSBlockingPeriod ۶۰۰
    </IfModule>


    یا


    <IfModule mod_dosevasive20.c>
    DOSHashTableSize ۳۰۹۷
    DOSPageCount ۱
    DOSSiteCount ۵۰
    DOSPageInterval ۱
    DOSSiteInterval ۱
    DOSBlockingPeriod ۱۰
    DOSEmailNotify root
    # DOSSystemCommand “su – someuser -c ‘/sbin/… %s …’”
    # DOSLogDir “/var/tmp/doslog”
    #Leave this commented while testing, then uncomment once you are sure the module works
    # DOSWhitelist ۱۲۷٫۰٫۰٫۱
    </IfModule>
    و دوباره اپاچی را ریستارت کنید :


    service httpd restart
    جدول آموزش متغییر های این مد :


    Key
    Description
    DOSHashTableSize The hash table size defines the number of top-level nodes for each child’s hash table. Increasing this number will provide faster performance by decreasing the number of iterations required to get to the record, but consume more memory for table space
    DOSPageCount This is the threshold for the number of requests for the same page (or URI) per page interval. Once the threshold for that interval has been exceeded, the IP address of the client will be added to the blocking list.
    DOSSiteCount This is the threshold for the total number of requests for any object by the same client on the same listener per site interval.
    DOSPageInterval The interval for the page count threshold; defaults to 1 second intervals.
    DOSSiteInterval The interval for the site count threshold; defaults to 1 second intervals.
    DOSBlockingPeriod The blocking period is the amount of time (in seconds) that a client will be blocked for if they are added to the blocking list. During this time, all subsequent requests from the client will result in a 403 (Forbidden) and the timer being reset (e.g. another 10 seconds).
    DOSEmailNotify If this value is set, an email will be sent to the address specified whenever an IP address becomes blacklisted. A locking mechanism using /tmp prevents continuous emails from being sent.
    DOSSystemCommand If this value is set, the system command specified will be executed whenever an IP address becomes blacklisted. This is designed to enable system calls to ip filter or other tools.
    DOSLogDir Choose an alternative temp directory, default is /tmp.

    منبع: http://ponap.com/

    موفق و پیروز باشید
    ▓ مدیریت سازمان یافته و رایگان سرور مجازی و اختصاصی : BergServer.com
    ▓ مرجع آمـوزش های مدیریت سرور و هاستینگ : WikiConfig.ir

  2. تعداد تشکر ها ازallbert به دلیل پست مفید


  3. # ADS




     

اطلاعات موضوع

کاربرانی که در حال مشاهده این موضوع هستند

در حال حاضر 1 کاربر در حال مشاهده این موضوع است. (0 کاربران و 1 مهمان ها)

موضوعات مشابه

  1. مشکل کارنکردن ماژول mod_evasive برروی ساب دامین
    توسط perseplis32 در انجمن سوالات و مشکلات
    پاسخ ها: 4
    آخرين نوشته: November 17th, 2017, 21:39
  2. نصب و پيكربندي mod_evasive
    توسط reeza در انجمن سرور مجازی
    پاسخ ها: 2
    آخرين نوشته: March 10th, 2012, 13:07
  3. mod_evasive
    توسط Deltawhois در انجمن سی پنل CPanel
    پاسخ ها: 5
    آخرين نوشته: April 17th, 2010, 10:08
  4. نصب و پيكربندي mod_evasive
    توسط mehrserver در انجمن مباحث و منابع آموزشی
    پاسخ ها: 7
    آخرين نوشته: July 6th, 2009, 14:37
  5. نصب و پيكربندي mod_evasive
    توسط Soheil Extreme در انجمن مباحث و منابع آموزشی
    پاسخ ها: 4
    آخرين نوشته: February 11th, 2009, 15:19

مجوز های ارسال و ویرایش

  • شما نمیتوانید موضوع جدیدی ارسال کنید
  • شما امکان ارسال پاسخ را ندارید
  • شما نمیتوانید فایل پیوست کنید.
  • شما نمیتوانید پست های خود را ویرایش کنید
  •