linnou
11-02-2013, بتوقيت غرينيتش 02:25 AM
بسم الله الرحمان الرحيم
السلام عليكم ورحمة الله وبركاتة
تم اعداد وتجهيز الشرح طريقة من قبل
# Sl4tr00t - r0x - Th3 Pentester - 0x0 T34m #
=============================================
بعد اعداد السيرفر SERVER من الامور البدائية نتابع الشرح طريقة كامل لحماية السيرفر SERVER باذن الله ..
سنبدا باعاده بناء الاباتشي عبر سكربت بلطريقة الصحيحة.
رمز Code:
wget http://dolphin4h.com/ssh/DL-apache.sh sh DL-apache.sh
http://im36.gulfup.com/KSVXO.png
زي مانشوف الصوره y انتر وننتظر لين مايخلص اعاده بناء الاباتشي ..
=============================================
نركب جدار ناري الـ CSF
لمعرفة عمل هاذا الجدار من هنآ
رمز Code:
http://configserver.com/
الان نركب الجدار بهاذي الخطوات ..
رمز Code:
wget http://www.dolphin4h.com/ssh/csf.sh chmod +x csf.sh sh csf.sh
جيد جدا بعد تركيب install جدار الـ CSF نركب LES لحماية ملفات النظام
اتبع التالي
رمز Code:
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
تم تركيب install LES جيد جدا نركب الان ELS للحماية من الروت كيت واشياء اخرى ..
يمكنكم القراء عنة هنآ
رمز Code:
http://servermonkeys.com
تمام نركبة..
رمز Code:
wget --output-document=installer.sh http://servermonkeys.com/projects/els/installer.sh; chmod +x installer.sh; sh installer.sh
تمام الان نمنع الروت كيت .. ننفذ
رمز Code:
els --chkrootkit
ونفحص السيرفر SERVER من الروت كيتس
رمز Code:
els --chkrootkitcron
الان ننفذ
رمز PHP:
<code style="white-space:nowrap"> <code> els --rkhuntercron
</code> </code>
و
رمز Code:
els --chmodfiles
و
رمز Code:
els --disabletelnet
و
رمز Code:
els --securepartitions
=============================================
حمايه الـ PHP وهي آهم شيء في آلسيرفر SERVER
نحرر الملف ..
رمز Code:
pico /usr/local/lib/php.ini
في بدايه الملف نضع ..
رمز Code:
reveal_php 0
http://im38.gulfup.com/xv3T0.png
نبحث عن السيف مود ونحوله من Off الى On
رمز Code:
safe_mode
زي ماهو موضح في الصوره
http://im39.gulfup.com/cLuSo.png
زي ماهو موضح نسوي حسب الاعدادات لكل قيمة
رمز Code:
allow_url_fopen = off
&
رمز Code:
expose_php = off
&
رمز Code:
enable_dl = off
&
رمز Code:
register_globals = off
&
رمز Code:
display_errors = Off
&
رمز Code:
max_execution_time = 3600
تمام الان نضع دوال ممنوعة نبحث عن disable_functions
ونضع هاذي الدوال جنب =
رمز Code:
dl,escapeshellarg,escapeshellcmd,exec,passthru,pro c_close,proc_get_status,proc_nice,proc_open,proc_t erminate,shell_exec,system,pcntl_exec,getrusage,ch own,chgrp,closelog,openlog,syslog,define_syslog_va riables,php_ini_scanned_files,php_ini_loaded_file, ini_get_all,get_cfg_var,getservbyname,getservbypor t
كما هو موضح في الصوره
http://im34.gulfup.com/raLoZ.png
=============================================
بحمد الله تم الانتهاء من حمايه الـ PHP الان نضبط الصلاحيات نفذ :
رمز Code:
chmod 700 /usr/bin/perl chown root:root /usr/bin/perl chmod 700 /bin/dmesg chmod 700 /bin/mount chmod 700 /bin/rpm chmod 700 /usr/bin/write chmod 700 /usr/bin/talk chmod 700 /usr/bin/ipcrm chmod 700 /usr/bin/ipcs chmod 700 /usr/bin/free chmod 700 /usr/bin/locate chmod 700 /usr/bin/wall chmod 700 /usr/bin/finger chmod 700 /sbin/arp chmod 700 /sbin/ifconfig chmod 700 /usr/sbin/repquota chmod 700 /usr/sbin/tcpdump chmod 700 /usr/bin/wget chmod 700 /usr/bin/lynx chmod 700 /usr/lib/bcc/bcc-cc1 chmod 700 /usr/bin/perlcc chmod 700 /usr/bin/bcc chmod 700 /usr/bin/cc chmod 700 /usr/bin/gcc chmod 700 /usr/bin/who chmod 700 /usr/bin/w chmod 711 / chmod 711 /home chmod 711 /etc chmod 711 /var chmod 711 /usr/etc chmod 711 /usr/local/etc chmod 711 /var/log chmod 711 /sbin chmod 711 /usr/sbin chmod 711 /usr/local/sbin chattr +i /usr/bin/cmp chattr +i /usr/bin/diff chattr +i /usr/bin/diff3 chattr +i /usr/bin/sdiff chattr +i /usr/bin/find chattr +i /usr/bin/xargs chattr +i /usr/bin/eu-addr2line chattr +i /usr/bin/eu-ar chattr +i /usr/bin/eu-elfcmp chattr +i /usr/bin/eu-elflint chattr +i /usr/bin/eu-findtextrel chattr +i /usr/bin/eu-make-debug-archive chattr +i /usr/bin/eu-nm chattr +i /usr/bin/eu-objdump chattr +i /usr/bin/eu-ranlib chattr +i /usr/bin/eu-readelf chattr +i /usr/bin/eu-size chattr +i /usr/bin/eu-strings chattr +i /usr/bin/eu-strip chattr +i /usr/bin/eu-unstrip chattr +i /usr/bin/eu-ranlib chattr +i /usr/bin/eu-addr2line chattr +i /usr/bin/eu-ar chattr +i /usr/bin/eu-elfcmp chattr +i /usr/bin/eu-elflint chattr +i /usr/bin/eu-findtextrel chattr +i /usr/bin/eu-make-debug-archive chattr +i /usr/bin/eu-nm chattr +i /usr/bin/eu-objdump chattr +i /usr/bin/eu-ranlib chattr +i /usr/bin/eu-readelf chattr +i /usr/bin/eu-size chattr +i /usr/bin/eu-strings chattr +i /usr/bin/eu-strip chattr +i /usr/bin/eu-unstrip chattr +i /usr/bin/eu-ranlib chattr +i /usr/bin/dig chattr +i /usr/bin/host chattr +i /usr/bin/nslookup chattr +i /usr/bin/nsupdate chattr +i /bin/ping chattr +i /bin/ping6 chattr +i /bin/tracepath chattr +i /bin/tracepath6 chattr +i /sbin/arping chattr +i /sbin/ifenslave chattr +i /sbin/rdisc chattr +i /usr/sbin/arping chattr +i /usr/sbin/clockdiff chattr +i /usr/sbin/ping6 chattr +i /usr/sbin/tracepath chattr +i /usr/sbin/tracepath6 chattr +i /usr/bin/compress-dummy chattr +i /usr/bin/mail-files chattr +i /usr/bin/mailshar chattr +i /usr/bin/remsync chattr +i /usr/bin/shar chattr +i /usr/bin/unshar chattr +i /usr/bin/uudecode chattr +i /usr/bin/uuencode chattr +i /usr/bin/chage chattr +i /usr/bin/faillog chattr +i /usr/bin/gpasswd chattr +i /usr/bin/lastlog chattr +i /usr/bin/newgrp chattr +i /usr/bin/sg chattr +i /usr/sbin/adduser chattr +i /usr/sbin/chpasswd chattr +i /usr/sbin/groupadd chattr +i /usr/sbin/groupdel chattr +i /usr/sbin/groupmod chattr +i /usr/sbin/grpck chattr +i /usr/sbin/grpconv chattr +i /usr/sbin/grpunconv chattr +i /usr/sbin/newusers chattr +i /usr/sbin/pwck chattr +i /usr/sbin/pwconv chattr +i /usr/sbin/pwunconv chattr +i /usr/sbin/useradd chattr +i /usr/sbin/userdel chattr +i /usr/sbin/usermod chattr +i /usr/bin/addr2line chattr +i /usr/bin/ar chattr +i /usr/bin/as chattr +i /usr/bin/c++filt chattr +i /usr/bin/gprof chattr +i /usr/bin/ld chattr +i /usr/bin/nm chattr +i /usr/bin/objcopy chattr +i /usr/bin/objdump chattr +i /usr/bin/ranlib chattr +i /usr/bin/readelf chattr +i /usr/bin/size chattr +i /usr/bin/strings chattr +i /usr/bin/strip chattr +i /usr/lib/libbfd-2.17.50.0.6-14.el5.so chattr +i /usr/lib/libopcodes-2.17.50.0.6-14.el5.so chattr +i /usr/bin/ranlib chattr +i /usr/lib/libbfd-2.17.50.0.6-14.el5.so chattr +i /usr/lib/libopcodes-2.17.50.0.6-14.el5.so chattr +i /bin/doexec chattr +i /bin/ipcalc chattr +i /bin/usleep chattr +i /sbin/consoletype chattr +i /sbin/fstab-decode chattr +i /sbin/genhostid chattr +i /sbin/getkey chattr +i /sbin/ifdown chattr +i /sbin/ifup chattr +i /sbin/initlog chattr +i /sbin/netreport chattr +i /sbin/ppp-watch chattr +i /sbin/service chattr +i /sbin/setsysfont chattr +i /usr/sbin/sys-unconfig chattr +i /usr/sbin/usernetctl chattr +i /lib/udev/rename_device chattr +i /sbin/grubby chattr +i /sbin/installkernel chattr +i /sbin/mkinitrd chattr +i /sbin/new-kernel-pkg chattr +i /lib/bdevid/ata.so chattr +i /lib/bdevid/scsi.so chattr +i /lib/bdevid/usb.so chattr +i /usr/lib/libbdevid.so.5.1.19.6 chmod 644 /etc/profile chattr +i /etc/profile chmod 644 /etc/bashrc chattr +i /etc/bashrc chmod 644 /etc/csh
=============================================
بعد ضبط التصاريح ننتقل الى المرحلة التاليه وهي منع تشغيل البيرل في السيرفر SERVER + والحماية من السيملنك طريقة ( انس عاطف ) الله يعطية العافية..
ننفذ
رمز Code:
cd /usr/local/apache/conf
ننشىء
رمز Code:
nano 0x0.conf
ضع بلملف هاذا المحتوى
رمز Code:
<Directory "/"> Options -Indexes -ExecCGI -FollowSymLinks -Includes IncludesNOEXEC Indexes -MultiViews SymLinksIfOwnerMatch AllowOverride AuthConfig Indexes Limit FileInfo Options=IncludesNOEXEC,Indexes,Includes,MultiViews ,SymLinksIfOwnerMatch </Directory>
ومن ثم ctrl x واحفظ الملف..
نفتح كونفق الاباتشي
رمز Code:
nano /usr/local/apache/conf/httpd.conf
ونبحث عن
رمز Code:
<Directory "/"> Options AllowOverride All </Directory>
ونحذفها كاملة الحين نحط هاذا الانكلود بلملف
رمز Code:
Include "/usr/local/apache/conf/0x0.conf"
زي ماتشوفون في الصوره
http://im41.gulfup.com/ZlgUC.png
نبحث عن
رمز Code:
<Directory "/usr/local/apache/htdocs">
نحذف الكلام كامل ونستبدلة بـ
رمز Code:
<Directory "/usr/local/apache/htdocs"> Options Includes Indexes SymLinksIfOwnerMatch AllowOverride None Order Deny,Allow Deny from all
رمز Code:
</Directory>
نبحث عن
رمز Code:
<Directory "/usr/local/apache/cgi-bin">
نبدلة بـ
رمز Code:
<Directory "/usr/local/apache/cgi-bin"> AllowOverride None Options None Order allow,deny Deny from all
رمز Code:
</Directory>
احفظ الملف وسوي رستارت للباتشي
رمز Code:
service httpd restart
لو حد حاول يسحب الكونفق ( اختصار )
بالامر هاذا
رمز Code:
ln -s /home/user/public_html/config.php config.txt
النتيجة Forbidden واذا رفع htaccess يجية خطاء Internal Server Error حتة البيرل نفس الحاجة.
=============================================
الان نركب PHPSuHosin
رمز Code:
/scripts/phpextensionmgr install PHPSuHosin
ونحرر ملف الـ PHP
رمز Code:
pico /usr/local/lib/php.ini
ونحط هذا في بداية الملف
رمز Code:
suhosin.executor.func.blacklist =dl,system,passthru,exec,popen,proc_close,proc_get _status,proc_nice,proc_open,proc_terminate,****l_e xec,escape,****lcmd,pclose,pfsockopen,chgrp,debugg er_off,debugger_on,leak,listen,define_syslog_varia bles,ftp_exec,posix_uname,posix_getpwuid,get_curre nt_user,getmyuid,getmygid,apache_child_terminate,p osix_kill,posix_mkfifo,posix_setpgid,posix_setsid, posix_setuid,pfsockopen,chgrp,debugger_off,debugge r_on,leak,listen,define_syslog_variables,ftp_exec, posix_uname,posix_getpwuid,get_current_user,getmyu id,getmygid,apache_child_terminate,posix_kill,posi x_mkfifo,posix_setpgid,posix_setsid,posix_setuid,e scape****larg,getservbyport,getservbyname,my****le xec,escape****larg,symlink,****l_exec,exec,proc_cl ose,proc_open,popen,system,dl,passthru,escape****l arg,escape****lcmd,posix_getgid,posix_getgrgid,dl, exec,pclose,proc_nice,proc_terminate,proc_get_stat us,pfsockopen,leak,apache_child_terminate,posix_ki ll,posix_mkfifo,posix_setpgid,posix_setsid,posix_s etuid,hypot,pg_host,pos,posix_access,posix_getcwd, posix_getservbyname,my****lexec,getpid,posix_getsi d,posix_getuid,posix_isatty,posix_kill,posix_mknod ,posix_setgid,posix_setsid,posix_setuid,posix_time s,posix_uname,ps_fill,posix_getpwuid,global,ini_re store,bzopen,bzread,bzwrite,apache_get_modules,apa che_get_version,phpversionphpinfo,php_ini_scanned_ files,get_current_user,error_log,disk_total_space, diskfreespace,leak,imap_list,hypo,filedump,gethost byname,safe_mode,getmygid,php_uname,apache_getenv, apache_setenv,bzread,bzwrite,posix_access,bzopen,p hpini,dos_conv,get_current_user,get_cwd,error_log, cmd,e_name,vdir,get_dir,only_read
تحميك من الشلات المشفرة والغير المشفرة بعض الشلات ..
وبنفس الوقت نرقع ثغره SUPHP
رمز Code:
pico /home/cpeasyapache/src/suphp.conf
ونبحث عن
application/x-httpd-php5=/usr/local/lib;
ونعدلها لتصبح كتالي
application/x-httpd-php5=/usr/local/lib
ونعدل القيم التاليه :
رمز Code:
; Security options allow_file_group_writeable=true allow_file_others_writeable=false allow_directory_group_writeable=true allow_directory_others_writeable=false check_vhost_docroot=true userdir_overrides_usergroup=false full_php_process_display=true
والان نحرر ملف
رمز Code:
pico /etc/httpd/conf/php.conf
نبحث عن
رمز Code:
suPHP_Engine on
نضع تحتة
رمز Code:
SuPHP_ConfigPath /usr/local/lib/php.ini
=============================================
حمايه معلومات الاباتشي ..
نحرر
رمز Code:
pico /etc/httpd/conf/httpd.conf
نبحث عن
رمز Code:
ServerSignature on
نحولها الى ..
رمز Code:
ServerSignature off
وتحتة نضع هاذا السطر ..
رمز Code:
ServerTokens ProductOnly
نحفظ الملف ونعمل رستارت
رمز Code:
/etc/rc.d/init.d/httpd restart
=============================================
حمايه الـ Kernel وتزيف معلوماتها ..
ننفذ
رمز Code:
mv /bin/uname /bin/uname2
من ثم
رمز Code:
nano /bin/uname
نضع المحتوى
رمز Code:
#!/bin/bash echo "Linux server.h4x0rz.net SECURED-KERNEL BY 0x0 Team"
وننفذ في الشل الان uname -a
نشوف في الصوره
http://im34.gulfup.com/4CytW.png
=============================================
تركيب install DoS Deflate للحمايه من الدوس اتاك ..
نفذ التالي لتركيب install البرنامج ..
رمز Code:
wget http://www.inetbase.com/scripts/ddos/install.sh chmod 0700 install.sh ./install.sh
=============================================
تركيب install Apache Booster لتسريع الاباتشي ومفيد جدا خاصة في هجمات الدوس اتاك ..
رمز PHP:
<code style="white-space:nowrap"> <code> wget http://prajith.in/downloads/apachebooster.tar.gz
tar -zxf apachebooster-v1.3.tar.gz
cd apachebooster
sh install.sh
</code> </code>
صوره من خاصية السكربت ..
http://im39.gulfup.com/zQBgv.png
=============================================
والى هنا تم الانتهاء من الشرح طريقة .. نشكر جميع الاعضاء ..
وسيتم اعداد دروس فيديو لهاذا الشرح طريقة للمبتدئين وباذن الله سيتم تجهيزها قريبا ..
بتوفيق للجميع
Notice :P
Special Greets To :
lORD OF WAR
https://fbcdn-sphotos-d-a.akamaihd.net/hphotos-ak-ash4/482113_236967293114455_1193518507_n.png (http://www.dzbatna.com)
©المشاركات المنشورة تعبر عن وجهة نظر صاحبها فقط، ولا تُعبّر بأي شكل من الأشكال عن وجهة نظر إدارة المنتدى (http://www.dzbatna.com)©
السلام عليكم ورحمة الله وبركاتة
تم اعداد وتجهيز الشرح طريقة من قبل
# Sl4tr00t - r0x - Th3 Pentester - 0x0 T34m #
=============================================
بعد اعداد السيرفر SERVER من الامور البدائية نتابع الشرح طريقة كامل لحماية السيرفر SERVER باذن الله ..
سنبدا باعاده بناء الاباتشي عبر سكربت بلطريقة الصحيحة.
رمز Code:
wget http://dolphin4h.com/ssh/DL-apache.sh sh DL-apache.sh
http://im36.gulfup.com/KSVXO.png
زي مانشوف الصوره y انتر وننتظر لين مايخلص اعاده بناء الاباتشي ..
=============================================
نركب جدار ناري الـ CSF
لمعرفة عمل هاذا الجدار من هنآ
رمز Code:
http://configserver.com/
الان نركب الجدار بهاذي الخطوات ..
رمز Code:
wget http://www.dolphin4h.com/ssh/csf.sh chmod +x csf.sh sh csf.sh
جيد جدا بعد تركيب install جدار الـ CSF نركب LES لحماية ملفات النظام
اتبع التالي
رمز Code:
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
تم تركيب install LES جيد جدا نركب الان ELS للحماية من الروت كيت واشياء اخرى ..
يمكنكم القراء عنة هنآ
رمز Code:
http://servermonkeys.com
تمام نركبة..
رمز Code:
wget --output-document=installer.sh http://servermonkeys.com/projects/els/installer.sh; chmod +x installer.sh; sh installer.sh
تمام الان نمنع الروت كيت .. ننفذ
رمز Code:
els --chkrootkit
ونفحص السيرفر SERVER من الروت كيتس
رمز Code:
els --chkrootkitcron
الان ننفذ
رمز PHP:
<code style="white-space:nowrap"> <code> els --rkhuntercron
</code> </code>
و
رمز Code:
els --chmodfiles
و
رمز Code:
els --disabletelnet
و
رمز Code:
els --securepartitions
=============================================
حمايه الـ PHP وهي آهم شيء في آلسيرفر SERVER
نحرر الملف ..
رمز Code:
pico /usr/local/lib/php.ini
في بدايه الملف نضع ..
رمز Code:
reveal_php 0
http://im38.gulfup.com/xv3T0.png
نبحث عن السيف مود ونحوله من Off الى On
رمز Code:
safe_mode
زي ماهو موضح في الصوره
http://im39.gulfup.com/cLuSo.png
زي ماهو موضح نسوي حسب الاعدادات لكل قيمة
رمز Code:
allow_url_fopen = off
&
رمز Code:
expose_php = off
&
رمز Code:
enable_dl = off
&
رمز Code:
register_globals = off
&
رمز Code:
display_errors = Off
&
رمز Code:
max_execution_time = 3600
تمام الان نضع دوال ممنوعة نبحث عن disable_functions
ونضع هاذي الدوال جنب =
رمز Code:
dl,escapeshellarg,escapeshellcmd,exec,passthru,pro c_close,proc_get_status,proc_nice,proc_open,proc_t erminate,shell_exec,system,pcntl_exec,getrusage,ch own,chgrp,closelog,openlog,syslog,define_syslog_va riables,php_ini_scanned_files,php_ini_loaded_file, ini_get_all,get_cfg_var,getservbyname,getservbypor t
كما هو موضح في الصوره
http://im34.gulfup.com/raLoZ.png
=============================================
بحمد الله تم الانتهاء من حمايه الـ PHP الان نضبط الصلاحيات نفذ :
رمز Code:
chmod 700 /usr/bin/perl chown root:root /usr/bin/perl chmod 700 /bin/dmesg chmod 700 /bin/mount chmod 700 /bin/rpm chmod 700 /usr/bin/write chmod 700 /usr/bin/talk chmod 700 /usr/bin/ipcrm chmod 700 /usr/bin/ipcs chmod 700 /usr/bin/free chmod 700 /usr/bin/locate chmod 700 /usr/bin/wall chmod 700 /usr/bin/finger chmod 700 /sbin/arp chmod 700 /sbin/ifconfig chmod 700 /usr/sbin/repquota chmod 700 /usr/sbin/tcpdump chmod 700 /usr/bin/wget chmod 700 /usr/bin/lynx chmod 700 /usr/lib/bcc/bcc-cc1 chmod 700 /usr/bin/perlcc chmod 700 /usr/bin/bcc chmod 700 /usr/bin/cc chmod 700 /usr/bin/gcc chmod 700 /usr/bin/who chmod 700 /usr/bin/w chmod 711 / chmod 711 /home chmod 711 /etc chmod 711 /var chmod 711 /usr/etc chmod 711 /usr/local/etc chmod 711 /var/log chmod 711 /sbin chmod 711 /usr/sbin chmod 711 /usr/local/sbin chattr +i /usr/bin/cmp chattr +i /usr/bin/diff chattr +i /usr/bin/diff3 chattr +i /usr/bin/sdiff chattr +i /usr/bin/find chattr +i /usr/bin/xargs chattr +i /usr/bin/eu-addr2line chattr +i /usr/bin/eu-ar chattr +i /usr/bin/eu-elfcmp chattr +i /usr/bin/eu-elflint chattr +i /usr/bin/eu-findtextrel chattr +i /usr/bin/eu-make-debug-archive chattr +i /usr/bin/eu-nm chattr +i /usr/bin/eu-objdump chattr +i /usr/bin/eu-ranlib chattr +i /usr/bin/eu-readelf chattr +i /usr/bin/eu-size chattr +i /usr/bin/eu-strings chattr +i /usr/bin/eu-strip chattr +i /usr/bin/eu-unstrip chattr +i /usr/bin/eu-ranlib chattr +i /usr/bin/eu-addr2line chattr +i /usr/bin/eu-ar chattr +i /usr/bin/eu-elfcmp chattr +i /usr/bin/eu-elflint chattr +i /usr/bin/eu-findtextrel chattr +i /usr/bin/eu-make-debug-archive chattr +i /usr/bin/eu-nm chattr +i /usr/bin/eu-objdump chattr +i /usr/bin/eu-ranlib chattr +i /usr/bin/eu-readelf chattr +i /usr/bin/eu-size chattr +i /usr/bin/eu-strings chattr +i /usr/bin/eu-strip chattr +i /usr/bin/eu-unstrip chattr +i /usr/bin/eu-ranlib chattr +i /usr/bin/dig chattr +i /usr/bin/host chattr +i /usr/bin/nslookup chattr +i /usr/bin/nsupdate chattr +i /bin/ping chattr +i /bin/ping6 chattr +i /bin/tracepath chattr +i /bin/tracepath6 chattr +i /sbin/arping chattr +i /sbin/ifenslave chattr +i /sbin/rdisc chattr +i /usr/sbin/arping chattr +i /usr/sbin/clockdiff chattr +i /usr/sbin/ping6 chattr +i /usr/sbin/tracepath chattr +i /usr/sbin/tracepath6 chattr +i /usr/bin/compress-dummy chattr +i /usr/bin/mail-files chattr +i /usr/bin/mailshar chattr +i /usr/bin/remsync chattr +i /usr/bin/shar chattr +i /usr/bin/unshar chattr +i /usr/bin/uudecode chattr +i /usr/bin/uuencode chattr +i /usr/bin/chage chattr +i /usr/bin/faillog chattr +i /usr/bin/gpasswd chattr +i /usr/bin/lastlog chattr +i /usr/bin/newgrp chattr +i /usr/bin/sg chattr +i /usr/sbin/adduser chattr +i /usr/sbin/chpasswd chattr +i /usr/sbin/groupadd chattr +i /usr/sbin/groupdel chattr +i /usr/sbin/groupmod chattr +i /usr/sbin/grpck chattr +i /usr/sbin/grpconv chattr +i /usr/sbin/grpunconv chattr +i /usr/sbin/newusers chattr +i /usr/sbin/pwck chattr +i /usr/sbin/pwconv chattr +i /usr/sbin/pwunconv chattr +i /usr/sbin/useradd chattr +i /usr/sbin/userdel chattr +i /usr/sbin/usermod chattr +i /usr/bin/addr2line chattr +i /usr/bin/ar chattr +i /usr/bin/as chattr +i /usr/bin/c++filt chattr +i /usr/bin/gprof chattr +i /usr/bin/ld chattr +i /usr/bin/nm chattr +i /usr/bin/objcopy chattr +i /usr/bin/objdump chattr +i /usr/bin/ranlib chattr +i /usr/bin/readelf chattr +i /usr/bin/size chattr +i /usr/bin/strings chattr +i /usr/bin/strip chattr +i /usr/lib/libbfd-2.17.50.0.6-14.el5.so chattr +i /usr/lib/libopcodes-2.17.50.0.6-14.el5.so chattr +i /usr/bin/ranlib chattr +i /usr/lib/libbfd-2.17.50.0.6-14.el5.so chattr +i /usr/lib/libopcodes-2.17.50.0.6-14.el5.so chattr +i /bin/doexec chattr +i /bin/ipcalc chattr +i /bin/usleep chattr +i /sbin/consoletype chattr +i /sbin/fstab-decode chattr +i /sbin/genhostid chattr +i /sbin/getkey chattr +i /sbin/ifdown chattr +i /sbin/ifup chattr +i /sbin/initlog chattr +i /sbin/netreport chattr +i /sbin/ppp-watch chattr +i /sbin/service chattr +i /sbin/setsysfont chattr +i /usr/sbin/sys-unconfig chattr +i /usr/sbin/usernetctl chattr +i /lib/udev/rename_device chattr +i /sbin/grubby chattr +i /sbin/installkernel chattr +i /sbin/mkinitrd chattr +i /sbin/new-kernel-pkg chattr +i /lib/bdevid/ata.so chattr +i /lib/bdevid/scsi.so chattr +i /lib/bdevid/usb.so chattr +i /usr/lib/libbdevid.so.5.1.19.6 chmod 644 /etc/profile chattr +i /etc/profile chmod 644 /etc/bashrc chattr +i /etc/bashrc chmod 644 /etc/csh
=============================================
بعد ضبط التصاريح ننتقل الى المرحلة التاليه وهي منع تشغيل البيرل في السيرفر SERVER + والحماية من السيملنك طريقة ( انس عاطف ) الله يعطية العافية..
ننفذ
رمز Code:
cd /usr/local/apache/conf
ننشىء
رمز Code:
nano 0x0.conf
ضع بلملف هاذا المحتوى
رمز Code:
<Directory "/"> Options -Indexes -ExecCGI -FollowSymLinks -Includes IncludesNOEXEC Indexes -MultiViews SymLinksIfOwnerMatch AllowOverride AuthConfig Indexes Limit FileInfo Options=IncludesNOEXEC,Indexes,Includes,MultiViews ,SymLinksIfOwnerMatch </Directory>
ومن ثم ctrl x واحفظ الملف..
نفتح كونفق الاباتشي
رمز Code:
nano /usr/local/apache/conf/httpd.conf
ونبحث عن
رمز Code:
<Directory "/"> Options AllowOverride All </Directory>
ونحذفها كاملة الحين نحط هاذا الانكلود بلملف
رمز Code:
Include "/usr/local/apache/conf/0x0.conf"
زي ماتشوفون في الصوره
http://im41.gulfup.com/ZlgUC.png
نبحث عن
رمز Code:
<Directory "/usr/local/apache/htdocs">
نحذف الكلام كامل ونستبدلة بـ
رمز Code:
<Directory "/usr/local/apache/htdocs"> Options Includes Indexes SymLinksIfOwnerMatch AllowOverride None Order Deny,Allow Deny from all
رمز Code:
</Directory>
نبحث عن
رمز Code:
<Directory "/usr/local/apache/cgi-bin">
نبدلة بـ
رمز Code:
<Directory "/usr/local/apache/cgi-bin"> AllowOverride None Options None Order allow,deny Deny from all
رمز Code:
</Directory>
احفظ الملف وسوي رستارت للباتشي
رمز Code:
service httpd restart
لو حد حاول يسحب الكونفق ( اختصار )
بالامر هاذا
رمز Code:
ln -s /home/user/public_html/config.php config.txt
النتيجة Forbidden واذا رفع htaccess يجية خطاء Internal Server Error حتة البيرل نفس الحاجة.
=============================================
الان نركب PHPSuHosin
رمز Code:
/scripts/phpextensionmgr install PHPSuHosin
ونحرر ملف الـ PHP
رمز Code:
pico /usr/local/lib/php.ini
ونحط هذا في بداية الملف
رمز Code:
suhosin.executor.func.blacklist =dl,system,passthru,exec,popen,proc_close,proc_get _status,proc_nice,proc_open,proc_terminate,****l_e xec,escape,****lcmd,pclose,pfsockopen,chgrp,debugg er_off,debugger_on,leak,listen,define_syslog_varia bles,ftp_exec,posix_uname,posix_getpwuid,get_curre nt_user,getmyuid,getmygid,apache_child_terminate,p osix_kill,posix_mkfifo,posix_setpgid,posix_setsid, posix_setuid,pfsockopen,chgrp,debugger_off,debugge r_on,leak,listen,define_syslog_variables,ftp_exec, posix_uname,posix_getpwuid,get_current_user,getmyu id,getmygid,apache_child_terminate,posix_kill,posi x_mkfifo,posix_setpgid,posix_setsid,posix_setuid,e scape****larg,getservbyport,getservbyname,my****le xec,escape****larg,symlink,****l_exec,exec,proc_cl ose,proc_open,popen,system,dl,passthru,escape****l arg,escape****lcmd,posix_getgid,posix_getgrgid,dl, exec,pclose,proc_nice,proc_terminate,proc_get_stat us,pfsockopen,leak,apache_child_terminate,posix_ki ll,posix_mkfifo,posix_setpgid,posix_setsid,posix_s etuid,hypot,pg_host,pos,posix_access,posix_getcwd, posix_getservbyname,my****lexec,getpid,posix_getsi d,posix_getuid,posix_isatty,posix_kill,posix_mknod ,posix_setgid,posix_setsid,posix_setuid,posix_time s,posix_uname,ps_fill,posix_getpwuid,global,ini_re store,bzopen,bzread,bzwrite,apache_get_modules,apa che_get_version,phpversionphpinfo,php_ini_scanned_ files,get_current_user,error_log,disk_total_space, diskfreespace,leak,imap_list,hypo,filedump,gethost byname,safe_mode,getmygid,php_uname,apache_getenv, apache_setenv,bzread,bzwrite,posix_access,bzopen,p hpini,dos_conv,get_current_user,get_cwd,error_log, cmd,e_name,vdir,get_dir,only_read
تحميك من الشلات المشفرة والغير المشفرة بعض الشلات ..
وبنفس الوقت نرقع ثغره SUPHP
رمز Code:
pico /home/cpeasyapache/src/suphp.conf
ونبحث عن
application/x-httpd-php5=/usr/local/lib;
ونعدلها لتصبح كتالي
application/x-httpd-php5=/usr/local/lib
ونعدل القيم التاليه :
رمز Code:
; Security options allow_file_group_writeable=true allow_file_others_writeable=false allow_directory_group_writeable=true allow_directory_others_writeable=false check_vhost_docroot=true userdir_overrides_usergroup=false full_php_process_display=true
والان نحرر ملف
رمز Code:
pico /etc/httpd/conf/php.conf
نبحث عن
رمز Code:
suPHP_Engine on
نضع تحتة
رمز Code:
SuPHP_ConfigPath /usr/local/lib/php.ini
=============================================
حمايه معلومات الاباتشي ..
نحرر
رمز Code:
pico /etc/httpd/conf/httpd.conf
نبحث عن
رمز Code:
ServerSignature on
نحولها الى ..
رمز Code:
ServerSignature off
وتحتة نضع هاذا السطر ..
رمز Code:
ServerTokens ProductOnly
نحفظ الملف ونعمل رستارت
رمز Code:
/etc/rc.d/init.d/httpd restart
=============================================
حمايه الـ Kernel وتزيف معلوماتها ..
ننفذ
رمز Code:
mv /bin/uname /bin/uname2
من ثم
رمز Code:
nano /bin/uname
نضع المحتوى
رمز Code:
#!/bin/bash echo "Linux server.h4x0rz.net SECURED-KERNEL BY 0x0 Team"
وننفذ في الشل الان uname -a
نشوف في الصوره
http://im34.gulfup.com/4CytW.png
=============================================
تركيب install DoS Deflate للحمايه من الدوس اتاك ..
نفذ التالي لتركيب install البرنامج ..
رمز Code:
wget http://www.inetbase.com/scripts/ddos/install.sh chmod 0700 install.sh ./install.sh
=============================================
تركيب install Apache Booster لتسريع الاباتشي ومفيد جدا خاصة في هجمات الدوس اتاك ..
رمز PHP:
<code style="white-space:nowrap"> <code> wget http://prajith.in/downloads/apachebooster.tar.gz
tar -zxf apachebooster-v1.3.tar.gz
cd apachebooster
sh install.sh
</code> </code>
صوره من خاصية السكربت ..
http://im39.gulfup.com/zQBgv.png
=============================================
والى هنا تم الانتهاء من الشرح طريقة .. نشكر جميع الاعضاء ..
وسيتم اعداد دروس فيديو لهاذا الشرح طريقة للمبتدئين وباذن الله سيتم تجهيزها قريبا ..
بتوفيق للجميع
Notice :P
Special Greets To :
lORD OF WAR
https://fbcdn-sphotos-d-a.akamaihd.net/hphotos-ak-ash4/482113_236967293114455_1193518507_n.png (http://www.dzbatna.com)
©المشاركات المنشورة تعبر عن وجهة نظر صاحبها فقط، ولا تُعبّر بأي شكل من الأشكال عن وجهة نظر إدارة المنتدى (http://www.dzbatna.com)©