This WordPress blog was hacked for few hours on 24th December (nice Christmas present!) from Russia. هذا بلوق WordPress hacked كان لساعات قليلة على 24th كانون الاول / ديسمبر (عيد الميلاد هذا الجميل!) من روسيا. The hacker exploited several WordPress vulnerabilities in administrative scripts to gain full access to the website (as permitted to apache user), including the ability to upload & run scripts, delete any file owned by apache user, view the file and directories etc. This is a full disclosure on the how the site was hacked and how I detected and removed the hack along with few comments on the state of WordPress security. فان WordPress هاكر استغلال مواطن الضعف في العديد من الكتابات الاداريه للحصول على امكانيه الوصول الكامل الى الموقع على شبكة الانترنت (كما يسمح للمستخدم اباتشي) ، بما في ذلك القدرة على تحميل وتشغيل البرامج النصيه ، وحذف اي ملف اباتشي التي يملكها المستخدم ، للاطلاع على الملف والادله وما الى ذلك أ الكشف الكامل على الموقع كيف كان وكيف لي ان hacked اكتشاف وازالة المأجور جنبا الى جنب مع بعض التعليقات على حالة الأمن WordPress. I added a WordPress plugin and made modifications to prevent any such hacking attempts in future using WordPress. وأضاف انني ووردبريس البرنامج المساعد وتعديلات لمنع أي محاولات من هذا القبيل في المستقبل تقطيع باستخدام WordPress. This is a must read for WordPress bloggers. وهذا أمر لا بد منه لقراءة WordPress المدونين.


How the site hacking was detected? كيف تم اكتشاف الموقع تقطيع؟

The website was normal. الموقع الطبيعي. However when I tried to publish or even save a post, it simply showed a blank page. ولكن عندما حاولت ان تنشر او حتى انقاذ ما بعد ، تبين انه مجرد صفحة بيضاء. The post was never published or even saved. الوظيفة ابدا نشر او حتى انقاذهم. I knew something was wrong. كنت اعرف ما كان خاطئا.

My first suspect were couple of plugins which contacted external servers after a publish. اول اثنين من المشتبه فيه الذي ملحقات لخدمة الاتصال الخارجي بعد نشر. I disabled them. انا المعوقين منهم. I also disabled the ping sites as they were sometimes known to cause problems. واود ايضا ان المعاقين بينغ المواقع كما كانت تعرف احيانا ان تسبب مشاكل. None of that helped. غير ان هذا ساعد. I progressively disabled all of the plugins. انا تدريجيا جميع المعوقين من ملحقات. Even with all the plugins disabled, the post wouldn’t publish. وحتى مع جميع ملحقات والمعوقين ، وبعد انتهاء لن تنشر. I was left with only one option. أنا مع ترك خيار واحد.

I decided to trace WordPress code to find out the cause of error. قررت ان تتبع WordPress مدونة لمعرفة سبب الخطأ. I started with the file for post submission - post.php. لقد بدأت مع ملف لمرحلة ما بعد تقديم -- post.php. I found something startling with WordPress code which seriously undermines its security, a flawed design choice but more on it later. لقد وجدت شيئا مع المذهله التي WordPress مدونة يقوض على نحو خطير على امنها ، والمعيب ، وتصميم اكبر على خيار الا انه في وقت لاحق. post.php calls admin.php which calls wp-config.php which in turn calls wp-settings.php. post.php يدعو admin.php الذي يدعو الى رزمه العمل - config.php الذي يستدعي بدوره رزمه العمل - settings.php. wp-settings is an interesting file. رزمه العمل - اعدادات ملف مثير للاهتمام. This file isn’t just about settings. هذا الملف ليس مجرد اعدادات. It loads tons of files, loads and executes the plugins and more. ومن الاحمال طن من الملفات ، الاحمال وتنفذها ملحقات واكثر من ذلك. The problem was, as I originally suspected, in the plugins but which one? المشكلة هي ، وكما قلت في الاصل يشتبه في ملحقات ولكنها واحدة؟ The code which loads the plugins in WordPress is: المدونه التي فان الاحمال في ملحقات WordPress هي :

 if ( get_option('active_plugins') ) {  $current_plugins = get_option('active_plugins');  if ( is_array($current_plugins) ) {   foreach ($current_plugins as $plugin) { if (” != $plugin && file_exists(ABSPATH . PLUGINDIR . ‘/’ . $plugin))     include_once(ABSPATH . PLUGINDIR . ‘/’ . $plugin); }  } } اذا كانت الاجابه ب (get_option ( 'active_plugins')) ($ current_plugins = get_option ( 'active_plugins') ؛ اذا كانت الاجابه ب (is_array ($ current_plugins)) (foreach ($ دولار current_plugins البرنامج المساعد) (اذا ( "! دولار = البرنامج المساعد & & file_exists (abspath. Plugindir. '/'. دولارا البرنامج المساعد)) include_once (abspath. Plugindir. '/'. بلوجن دولار) ؛))) 

The active plugins, as you can see, are loaded directly with include_once. ملحقات النشطه ، كما ترون ، يجري تحميل مباشرة مع include_once. How do I find the plugin which while loading is causing the script to die? كيف اجد اثناء تحميل البرنامج المساعد الذي يتسبب في المخطوطه على حافة الموت؟
I added simple syslog() statements before and after the plugin. واضاف لي بسيطة syslog () البيانات قبل وبعد البرنامج المساعد. However it generated copious output from all the traffic. بيد انه غزير الانتاج المتولده من كل الحركة.
Remember I was debugging on a heavily trafficked live site. تذكر كنت على تصحيح الاخطاء الشديدة للاتجار في العيش في الموقع. So I added a define in post.php which I was checking before doing a syslog. واضاف ا لى ذلك في تحديد post.php التي كنت قبل ان أفعل أي فحص syslog. The debugging code was: وقد تم تصحيح الاخطاء المدونه :
if (” != $plugin && file_exists(ABSPATH . ‘wp-content/plugins/’ . $plugin)) { اذا كانت الاجابه ب ( "! دولار = البرنامج المساعد & & file_exists (abspath.' wp-content/plugins / '. دولارا البرنامج المساعد)) (
if(defined(’TG_ADMIN’)) syslog(LOG_ALERT, “Loading $plugin…”); اذا كانت الاجابه ب (تعريف) 'tg_admin')) syslog (log_alert ، "تحميل البرنامج المساعد دولار…") ؛
include_once(ABSPATH . ‘wp-content/plugins/’ . $plugin); include_once (abspath. 'wp-content/plugins /'. بلوجن دولار) ؛
if(defined(’TG_ADMIN’)) syslog(LOG_ALERT, “Loaded $plugin…”); اذا كانت الاجابه ب (تعريف) 'tg_admin')) syslog (log_alert ، "تحميل البرنامج المساعد دولار…") ؛
} )

The result was surprising. وكانت النتيجة مثيرة للدهشه. The first plugin loaded was not even a plugin I knew existed, let alone use it. تحميل البرنامج المساعد الاول لم تكن حتى موجودة البرنامج المساعد وكنت اعرف ، ناهيك عن استخدامها. It was named ro8kbsmawge.txt. سميت ro8kbsmawge.txt. The full path to the plugin was /../../../../../../../../../../../../../../../../../../tmp/ro8kbsmawge.txt كامل الطريق الى البرنامج المساعد كان /../../../../../../../../../../../../../../ ../../../../tmp/ro8kbsmawge.txt
Effectively the file path was /tmp/ro8kbsmawge.txt. على نحو فعال هو مسار الملف / tmp/ro8kbsmawge.txt. A telltale sign of this hacker is the presence of the file ro8kbsmawge.txt in your tmp directory. أ الراوي علامة هاكر هذا هو وجود الملف الخاص بك في ro8kbsmawge.txt tmp الدليل.

I renamed the file and the problem was solved for now. اعادة تسمية الملف الاول والمشكلة تم حلها في الوقت الحاضر. I could publish posts finally. ويمكنني أن نشر الرسائل وأخيرا. However my site was still not secure against future attacks. غير ان موقعي لا يزال غير آمن ضد اى هجمات فى المستقبل. I will detail next at how I secured my site and provide more information on the perpetrator and how the site was hacked in the first place. أنا القادم من التفصيل في كيفية تأمين لي موقعي وتوفر المزيد من المعلومات عن مرتكب الجريمة ، وكيف كان الموقع hacked في المقام الأول.

How the site was hacked using WordPress? كيفية استخدام الموقع hacked WordPress؟

The site exploited a vulnerability in /wp-admin/options.php which allowed it to get the authentication cookies it required to upload the file ro8kbsmawge.txt to my /tmp directory using /wp-admin/inline-uploading.php. الموقع في استغلال ضعف / wp-admin/options.php مما اتاح له الحصول على توثيق الملفات المطلوبة لتحميل الملف ro8kbsmawge.txt الى بلدي / tmp دليل استخدام / wp-admin/inline-uploading.php. It then used /wp-admin/plugins.php to activate the ro8kbsmawge.txt as a plugin while using options-misc along the way. وبعد ذلك تستخدم / wp-admin/plugins.php لتفعيل البرنامج المساعد ro8kbsmawge.txt بوصفها بينما باستخدام خيارات متفرقات - على طول الطريق.

Finally the hacker accessed the site using his magic word piska233 and browsed few directories on my server before retiring for the day. واخيرا فان هاكر الوصول الى الموقع باستخدام كلمة سحريه له piska233 وتصفحها ادلة قليلة على خدمة بلدي قبل تقاعده لهذا اليوم. All of these was done within a span of 3 minutes which leads to the conclusion that a script was used to exploit the holes and orchestrate the hacking. كل هذه تتم في اطار وكان على مدى 3 دقائق ، الامر الذي يؤدي الى استنتاج مفاده ان السيناريو كان يستخدم لاستغلال الثغر والانسجام فان القرصنه.

The full log, except the IP address 217.74.245.85 which was removed for redundancy, of hackers action on my site is: سجل كامل ، ما عدا الملكيه الفكريه معالجة 217.74.245.85 التي تمت ازالة زائدة ، والمتسكعين العمل على موقعي هو :

[24/Dec/2007:07:40:22 -0600] “POST /wp-admin/options.php HTTP/1.0″ 200 1713 “http://blog.taragana.com/wp-admin/options.php” “Opera” [24/dec/2007 : 07:40:22 -0600] "ما بعد / wp-admin/options.php http/1.0" 200 1713 "http://blog.taragana.com/wp-admin/options.php" "أوبرا"
[24/Dec/2007:07:40:24 -0600] “POST /wp-admin/options.php HTTP/1.0″ 302 471 “http://blog.taragana.com/wp-admin/options.php” “Opera” [24/dec/2007 : 07:40:24 -0600] "ما بعد / wp-admin/options.php http/1.0" 302 471 "http://blog.taragana.com/wp-admin/options.php" "أوبرا"
[24/Dec/2007:07:40:26 -0600] “POST /wp-admin/inline-uploading.php?post=-1&action=upload HTTP/1.0″ 200 1645 “http://blog.taragana.com/inline-uploading.php?post=-1&action=upload” “Opera” [24/dec/2007 : 07:40:26 -0600] "ما بعد / wp-admin/inline-uploading.php؟ بعد انتهاء العمل =- 1 & رفع http/1.0 =" 200 1645 "http://blog.taragana.com / انلاين - uploading.php؟ بعد انتهاء العمل =- 1 & = تحميل "" الاوبرا "
[24/Dec/2007:07:40:29 -0600] “POST /wp-admin/inline-uploading.php?post=-1&action=upload HTTP/1.0″ 200 142 “http://blog.taragana.com/inline-uploading.php?post=-1&action=upload” “Opera” [24/dec/2007 : 07:40:29 -0600] "ما بعد / wp-admin/inline-uploading.php؟ بعد انتهاء العمل =- 1 & = رفع http/1.0" 200 142 "http://blog.taragana.com / انلاين - uploading.php؟ بعد انتهاء العمل =- 1 & = تحميل "" الاوبرا "
[24/Dec/2007:07:40:52 -0600] “POST /wp-admin/options.php HTTP/1.0″ 200 1713 “http://blog.taragana.com/wp-admin/options.php” “Opera” [24/dec/2007 : 07:40:52 -0600] "ما بعد / wp-admin/options.php http/1.0" 200 1713 "http://blog.taragana.com/wp-admin/options.php" "أوبرا"
[24/Dec/2007:07:40:54 -0600] “POST /wp-admin/options.php HTTP/1.0″ 302 471 “http://blog.taragana.com/wp-admin/options.php” “Opera” [24/dec/2007 : 07:40:54 -0600] "ما بعد / wp-admin/options.php http/1.0" 302 471 "http://blog.taragana.com/wp-admin/options.php" "أوبرا"
[24/Dec/2007:07:40:57 -0600] “POST /wp-admin/inline-uploading.php?post=-1&action=upload HTTP/1.0″ 200 1645 “http://blog.taragana.com/inline-uploading.php?post=-1&action=upload” “Opera” [24/dec/2007 : 07:40:57 -0600] "ما بعد / wp-admin/inline-uploading.php؟ بعد انتهاء العمل =- 1 & رفع http/1.0 =" 200 1645 "http://blog.taragana.com / انلاين - uploading.php؟ بعد انتهاء العمل =- 1 & = تحميل "" الاوبرا "
[24/Dec/2007:07:41:11 -0600] “GET /wp-admin/options-misc.php HTTP/1.1″ 200 7764 “-” “Opera/9.24 (Windows NT 5.1; U; ru)” [24/dec/2007 : 07:41:11 -0600] "الحصول على / wp-admin/options-misc.php HTTP/1.1" 200 7764 "--" "opera/9.24 (ويندوز NT 5،1 ؛ ش ؛ Ru)"
[24/Dec/2007:07:41:15 -0600] “GET /wp-admin/wp-admin.css?version=2.0.7 HTTP/1.1″ 304 - “http://blog.taragana.com/wp-admin/options-misc.php” “Opera/9.24 (Windows NT 5.1; U; ru)” [24/dec/2007 : 07:41:15 -0600] "الحصول على / wp-admin/wp-admin.css؟ الاصدار 2.0.7 = HTTP/1.1" 304 -- "http://blog.taragana.com/ wp-admin/options-misc.php "" opera/9.24 (ويندوز NT 5،1 ؛ ش ؛ Ru) "
[24/Dec/2007:07:41:15 -0600] “GET /wp-includes/js/fat.js HTTP/1.1″ 304 - “http://blog.taragana.com/wp-admin/options-misc.php” “Opera/9.24 (Windows NT 5.1; U; ru)” [24/dec/2007 : 07:41:15 -0600] "الحصول على / wp-includes/js/fat.js HTTP/1.1" 304 -- "http://blog.taragana.com/wp-admin/options- misc.php "" opera/9.24 (ويندوز NT 5،1 ؛ ش ؛ Ru) "
[24/Dec/2007:07:41:12 -0600] “POST /wp-admin/inline-uploading.php?post=-1&action=upload HTTP/1.0″ 302 - “http://blog.taragana.com/inline-uploading.php?post=-1&action=upload” “Opera” [24/dec/2007 : 07:41:12 -0600] "ما بعد / wp-admin/inline-uploading.php؟ بعد انتهاء العمل =- 1 & رفع http/1.0 =" 302 -- "http://blog.taragana.com / انلاين - uploading.php؟ بعد انتهاء العمل =- 1 & = تحميل "" الاوبرا "
[24/Dec/2007:07:41:21 -0600] “GET /wp-admin/plugins.php?action=activate&plugin=/../../../../../../../../../../../../../../../../../../tmp/ro8kbsmawge.txt&_wpnonce= HTTP/1.1″ 200 1474 “http://blog.taragana.com/wp-admin/plugins.php?action=activate&plugin=/../../../../../../../../../../../../../../../../../../tmp/ro8kbsmawge.txt” “Opera” [24/dec/2007 : 07:41:21 -0600] "الحصول على / wp-admin/plugins.php؟ العمل = & تفعيل البرنامج المساعد =/../../../../../../. ./../../../../../../../../../../../tmp/ro8kbsmawge.txt & _wpnonce = HTTP/1.1 "200 1474" بروتوكول انتقال النص المتشعب : / / blog.taragana.com / رزمه العمل - الادارة / plugins.php؟ العمل = & تفعيل البرنامج المساعد =/../../../../../../../../../.. /../../../../../../../../ tmp/ro8kbsmawge.txt "" الاوبرا "
[24/Dec/2007:07:41:23 -0600] “GET /wp-admin/plugins.php?action=activate&plugin=/../../../../../../../../../../../../../../../../../../tmp/ro8kbsmawge.txt&_wpnonce=7b4c8019bd HTTP/1.1″ 302 - “http://blog.taragana.com/wp-admin/plugins.php?action=activate&plugin=/../../../../../../../../../../../../../../../../../../tmp/ro8kbsmawge.txt” “Opera” [24/dec/2007 : 07:41:23 -0600] "الحصول على / wp-admin/plugins.php؟ العمل = & تفعيل البرنامج المساعد =/../../../../../../. ./../../../../../../../../../../../tmp/ro8kbsmawge.txt & _wpnonce = 7b4c8019bd HTTP/1.1 "302 --" بروتوكول انتقال النص المتشعب : / / blog.taragana.com / رزمه العمل - الادارة / plugins.php؟ العمل = & تفعيل البرنامج المساعد =/../../../../../../../../../. ./../../../../../../../../tmp/ro8kbsmawge.txt "" الاوبرا "
[24/Dec/2007:07:41:30 -0600] “GET /?piska23 HTTP/1.1″ 200 95716 “http://lamer/mwpep/?mode=shell&what=20″ “Opera/9.24 (Windows NT 5.1; U; ru)” [24/dec/2007 : 07:41:30 -0600] "الحصول على /؟ Piska23 HTTP/1.1" 200 95716 "http://lamer/mwpep/؟mode=shell&what=20" "opera/9.24 (ويندوز NT 5،1 ؛ ش ؛ Ru) "
[24/Dec/2007:07:41:36 -0600] “GET /?piska233 HTTP/1.1″ 200 15840 “-” “Opera/9.24 (Windows NT 5.1; U; ru)” [24/dec/2007 : 07:41:36 -0600] "الحصول على /؟ Piska233 HTTP/1.1" 200 15840 "--" "opera/9.24 (ويندوز NT 5،1 ؛ ش ؛ Ru)"
[24/Dec/2007:07:41:44 -0600] “POST /wp-admin/options.php HTTP/1.1″ 302 471 “http://blog.taragana.com/wp-admin/options-misc.php” “Opera/9.24 (Windows NT 5.1; U; ru)” [24/dec/2007 : 07:41:44 -0600] "ما بعد / wp-admin/options.php HTTP/1.1" 302 471 "http://blog.taragana.com/wp-admin/options-misc. بي. اتش. بي "" opera/9.24 (ويندوز NT 5،1 ؛ ش ؛ Ru) "
[24/Dec/2007:07:41:47 -0600] “POST /wp-admin/options.php HTTP/1.1″ 302 471 “http://blog.taragana.com/wp-admin/options-misc.php” “Opera/9.24 (Windows NT 5.1; U; ru)” [24/dec/2007 : 07:41:47 -0600] "ما بعد / wp-admin/options.php HTTP/1.1" 302 471 "http://blog.taragana.com/wp-admin/options-misc. بي. اتش. بي "" opera/9.24 (ويندوز NT 5،1 ؛ ش ؛ Ru) "
[24/Dec/2007:07:41:55 -0600] “GET /?piska233&dira=/tmp HTTP/1.1″ 200 9930 “-” “Opera/9.24 (Windows NT 5.1; U; ru)” [24/dec/2007 : 07:41:55 -0600] "الحصول على /؟ Piska233 & dira = / tmp HTTP/1.1" 200 9930 "--" "opera/9.24 (ويندوز NT 5،1 ؛ ش ؛ Ru)"
[24/Dec/2007:07:41:54 -0600] “GET /wp-admin/options-misc.php?updated=true HTTP/1.1″ 200 7842 “http://blog.taragana.com/wp-admin/options-misc.php” “Opera/9.24 (Windows NT 5.1; U; ru)” [24/dec/2007 : 07:41:54 -0600] "الحصول على / wp-admin/options-misc.php؟ تحديث الحقيقي = HTTP/1.1" 200 7842 "http://blog.taragana.com/wp- الادارة / الخيارات - misc.php "" opera/9.24 (ويندوز NT 5،1 ؛ ش ؛ Ru) "
[24/Dec/2007:07:42:36 -0600] “POST /index.php?piska233&dira=./ HTTP/1.1″ 200 36721 “http://blog.taragana.com/?piska233″ “Opera/9.24 (Windows NT 5.1; U; ru)” [24/dec/2007 : 07:42:36 -0600] "ما بعد / index.php؟ Piska233 & dira =. / HTTP/1.1" 200 36721 "http://blog.taragana.com/؟piska233" "opera/9.24 (ويندوز NT 5،1 ؛ ش ؛ Ru) "
[24/Dec/2007:07:43:23 -0600] “GET /index.php?piska233&dira=./wp-content/plugins/Wysi-Wordpress/themes/advanced/docs/es/images HTTP/1.1″ 200 6506 “-” “Opera/9.24 (Windows NT 5.1; U; ru)” [24/dec/2007 : 07:43:23 -0600] "الحصول على / index.php؟ Piska233 & dira =. / wp-content/plugins/wysi-wordpress/themes/advanced/docs/es/images HTTP/1.1" 200 6506 "--" "opera/9.24 (ويندوز NT 5،1 ؛ ش ؛ Ru)"
[24/Dec/2007:07:43:38 -0600] “GET /wp-content/plugins/Wysi-Wordpress/themes/advanced/docs/es/images HTTP/1.1″ 301 298 “-” “Opera/9.24 (Windows NT 5.1; U; ru)” [24/dec/2007 : 07:43:38 -0600] "الحصول على / wp-content/plugins/wysi-wordpress/themes/advanced/docs/es/images HTTP/1.1" 301 298 "--" "opera/9.24 (ويندوز NT 5،1 ؛ ش ؛ Ru) "
[24/Dec/2007:07:43:40 -0600] “GET /wp-content/plugins/Wysi-Wordpress/themes/advanced/docs/es/images/ HTTP/1.1″ 200 604 “-” “Opera/9.24 (Windows NT 5.1; U; ru)” [24/dec/2007 : 07:43:40 -0600] "الحصول على / wp-content/plugins/wysi-wordpress/themes/advanced/docs/es/images / HTTP/1.1" 200 604 "--" "اوبرا / 9.24 (ويندوز NT 5،1 ؛ ش ؛ Ru) "

The good news is that no harm was done. الخبر السار هو ان لا ضرر من فعل.

WordPress security issues & design flaw WordPress المسائل الامنية و التصميم العيب

The basic design flaw is that loading WordPress configuration (required for database access for authentication checks) loads wp-settings which loads tons of other PHP files as well as all the WordPress plugins and any hacks. التصميم الاساسي هو ان العيب تحميل WordPress التكوين (قاعدة البيانات اللازمة لتوثيق وصول الشيكات (رزمه العمل - اعدادات الاحمال الاحمال التي طن من الملفات الاخرى بي. اتش. بى وكذلك جميع ووردبريس ملحقات واي المأجورون. All of these are done even before you have a chance to authenticate the user. وهذه كلها القيام به حتى قبل أن لديك فرصة لتوثيق المستعمل. This is extremely dangerous for administration scripts as it allows a hacker to pass arguments to and execute gazillions of WordPress files which may or may not have proper security checks in place. وهذا امر بالغ الخطوره لادارة المخطوطات لانها تتيح للهاكر أ الحجج لتمرير وتنفيذ gazillions WordPress من الملفات التي قد تكون أو لا تكون سليمة في عمليات التفتيش الامنية. User authentication and entitlement should be done at the very beginning to prevent unauthenticated scripts from proceeding any further. توثيق المستخدم واستحقاق وينبغي ان يتم ذلك في بداية لمنع مخطوطات غير موثق من المضي الى ابعد من ذلك. To do that wp-config must be modified to not include wp-settings. لذلك يجب ان رزمه العمل - اعداد لا يمكن تعديلها لتشمل رزمه العمل - اعدادات. It should be separately included where required, even at the cost of redundancy. وينبغي ان تدرج على حدة ، عند الاقتضاء ، ولو على حساب التكرار. Administration scripts (under wp-admin) requires only wp-config to get the database details to authenticate the user and identify its entitlements. ادارة المخطوطات (في اطار رزمه العمل - الادارة) الا يتطلب رزمه العمل - إعداد قاعدة بيانات للحصول على تفاصيل لتوثيق المستخدم وتحديد والاستحقاقات. After authentication the rest should be loaded. بعد مصادقة بقية ينبغي تحميلها. This flaw was exploited to get the authentication cookie details which was subsequently used. هذا الخلل هو استغلال للحصول على التفاصيل التوثيق الكعكه التي استخدمت فيما بعد. The exact exploit used in this case is hard to find from just server logs. الدقيقة المستخدمة في استغلال هذه الحاله من الصعب العثور على سجلات مركز الخدمة فقط. However it was caused by late authentication problem as described above. بيد انه نجم عن مشكلة التأخر في المصادقه على النحو المبين اعلاه.

There are were known issues with both options.php & upload script, some of which are detailed ومن المعروف ان هناك قضايا مع كل من options.php & تحميل البرنامج النصي ، وبعضها مفصل here هنا .

One of the challenges with WordPress is that security considerations was mostly an afterthought (feel free to disagree) which were latched on as WordPress became more and more popular. وأحد التحديات هو ان WordPress مع الاعتبارات الامنية في معظم الاحيان وجود فيما بعد (لا تتردد في نختلف) التي كانت على النحو مغلق WordPress اصبحت اكثر واكثر شعبية. You have to continuously update your WordPress to keep up with the latest patches. عليك ان تقوم بتحديث WordPress باستمرار لمواكبة آخر البقع.

There are 71 reported security advisories in Secunia (22 reported in 2007) and 9 viruses based on WordPress (one from 2007). وهناك 71 وأفادت البيانات الامنية في secunia (22 المبلغ عنها فى عام 2007) و 9 من الفيروسات على اساس WordPress (واحد من 2007).

Most likely the site was hacked using the cookies authentication vulnerability as detailed على الارجح كان الموقع بإستخدام ملفات تعريف الارتباط hacked ضعف التوثيق على النحو المفصل here هنا .

Several WordPress plugins and themes also have security advisories: ووردبريس ملحقات عدة مواضيع وايضا البيانات الامنية :
- AdSense-Deluxe 0.x (plugin for WordPress) -- AdSense - فاخر 0.x (البرنامج المساعد لWordPress)
- AndyBlue 1.x (theme for WordPress) -- Andyblue 1.x (موضوع WordPress)
- Blix 0.x (theme for WordPress) -- بليكس 0.x (موضوع WordPress)
- Blixed 1.x (theme for WordPress) -- Blixed 1.x (موضوع WordPress)
- BlixKrieg 2.x (theme for WordPress) -- Blixkrieg 2.x (موضوع WordPress)
- Blue Memories 1.x (theme for WordPress) -- ذكريات الازرق 1.x (موضوع WordPress)
- myGallery 1.x (plugin for WordPress) -- Mygallery 1.x (البرنامج المساعد لWordPress)
- PictPress 1.x (plugin for WordPress) -- Pictpress 1.x (البرنامج المساعد لWordPress)
- Pool 1.x (theme for Wordpress) -- بركة 1.x (موضوع WordPress)
- Redoable 1.x (theme for WordPress) -- Redoable 1.x (موضوع WordPress)

You can read all the Secunia advisories on WordPress يمكنك ان تقرأ جميع الانذارات على secunia WordPress here هنا .

Who was the hacker? هاكر من هو؟

The IP address of the user responsible for hacking my site is 217.74.245.85 . الملكيه الفكريه للتصدي للمستخدم مسؤول عن موقعي هو تقطيع 217.74.245.85. The IP address belongs to KUBANGSM-NET: الملكيه الفكريه معالجة ينتمي الى شبكة kubangsm :

 % Information related to '217.74.245.0/24AS29497'  route:          217.74.245.0/24 descr:          KUBANGSM-NET origin:         AS29497 mnt-by:         KUBANGSM-MNT source:         RIPE # Filtered معلومات ذات الصلة ٪.74.245.0/24as29497 الى '217' الطريق : 217.74.245.0/24 descr : kubangsm الصافي - المصدر : as29497 - تيتانوس الامهات والرضع عن طريق ما يلي : - kubangsm تيتانوس الامهات والرضع المصدر : قد حان التنقيه # 

It is owned by: ومن يملكها :

 person:       Volkov Denis address:      61, Gimnazicheskaya str. الشخص : فولكوف دوني العنوان : 61 ، شارع gimnazicheskaya. 350000, Krasnodar, Russia phone:        +7 8612 660126 fax-no:       +7 8612 401505 e-mail:       d.volkov@kuban.mts.ru nic-hdl:      VD370-RIPE source:       RIPE # Filtered 350000 ، كراسنودار ، روسيا هاتف : +7 8612 660126 - فاكس رقم : +7 8612 401505 البريد الالكتروني : @ d.volkov kuban.mts.ru NIC - HDL : vd370 قد حان - المصدر : قد حان التنقيه # 

Their website is موقعهم هو http://www.kuban.mts.ru/ . They appear to be legitimate mobile & internet service provider. ويبدو ان المشروع الجوال & خدمات الانترنت. Most likely their internet service is being abused by the spammer. على الارجح على شبكة الانترنت هو خدمة للاعتداء من قبل spammer. Nevertheless I decided to ومع ذلك فقد قررت أن ban this IP address from accessing my server الملكيه الفكريه معالجة هذا الحظر من الدخول الى اشتراكي في الخادم .

The hacker was most likely using Opera 9.24 browser (almost latest version) on Windows XP (NT 5.1). هاكر فإن الارجح باستخدام متصفح الاوبرا 9،24 (الاصدار الاخير تقريبا) على ويندوز اكس بي (NT 5.1). While user agent can be faked, there is no reason to suspect so in this case. وفي حين أن المستخدم يمكن ان تكون وكيلا faked ، لا يوجد اي سبب يدعو الى الشك حتى في هذه الحاله. The user agent string also shows that he was using the russian language file of Opera. الوكيل الخيط المستعمل ويبين ايضا انه كان استخدام اللغة الروسيه في ملف الاوبرا.

سحر شل زارة الزراعة والثروة الحيوانيه عن طريق الشاشه

Anatomy of the hacking script تشريح للتقطيع النصي

The hacking script is a php script with aa nice comment and TODO line: فإن تقطيع النص هو اا بي. اتش. بى سكريبت مع نيس وtodo خط التعليق :
/*Magic Include Shell by Mag icq 884888*/ / * السحر وتشمل زارة الزراعة والثروة الحيوانيه عن طريق شل ايسيكيو * 884888 /
//TODO: ñëèòü ôàéëî íà ñâîé ôòï (!) / / Todo : ñëèòü ôàéëî íà ñâîé ôòï (!)

Effectively it is a file manager, probably adapted from any of the free php file manager’s on the net. على نحو فعال وهو مدير الملفات ، على الارجح مقتبسة من اي من حرة بي. اتش. بى مدير الملف على الشبكه. It allows you to: انها تسمح لك :

  • Browse directories and files استعرض الادله والملفات
  • Edit files تحرير ملفات
  • Rename files اعادة تسمية الملفات
  • Delete files حذف الملفات
  • zip & unzip files & unzip ملفات الرمز البريدي
  • Upload & download files & directories تحميل الملفات تحميل & & ادلة
  • Execute arbitrary PHP scripts بي. اتش. بى مخطوطات تنفيذ تعسفي
  • Execute arbitrary shell commands تنفيذ اوامر شل التعسفي
  • Provides basic server, system & PHP information ويوفر خادم الاساسية ، ونظام المعلومات & بي. اتش. بى

The bulk of the code is executed when it receives a particular query string to a normal HTTP GET request. الجزء الاكبر من هذا القانون ينفذ عندما تتلقى بصفة خاصة عبارة طلب عادي لطلب الحصول على بروتوكول انتقال النص المتشعب. So while http://blog.taragana.com/ will work as usual, http://blog.taragana.com/?piska233 will open with this magical hidden shell which will expose your entire website to an outside hacker. وفي حين ان ذلك سوف http://blog.taragana.com/ العمل كالمعتاد ، http://blog.taragana.com/؟piska233 سيفتح هذا سحريه خفية مع شركة شل التي سوف تعرض موقعك بالكامل الى خارج هاكر.
Note: There is nothing magical about piska233. ملاحظه : ليس هناك شيء سحري عن piska233. It is a password which was most likely allowed to be chosen and given as input to the original script which injected this trojan horse on my site. وهو كلمة السر التي كانت على الأرجح يسمح ليتم اختيار ونظرا كمدخل الى النص الاصلي الذي حقن حصان طروادة هذا على موقعي.

A trojan which protects itself against worms… أ طروادة التي تحمي نفسها ضد الديدان…

The trojan takes steps to protect itself against worm! فان طروادة تتخذ خطوات لحمايه نفسها ضد الدوده! The code at the end which is always executed is: المدونه في نهاية المنفذة والتي هي دائما هو :

$post_arr=implode('.',$_POST); post_arr دولار = انفجر بعد ('.'،$_) ؛
$get_arr=implode('.',$_GET); get_arr دولار = انفجر الحصول على ('.'،$_) ؛
$cook_arr=implode('.',$_COOKIE); cook_arr دولار = انفجر ('.'،$_كوكي) ؛
$post_arr_key=implode('.',@array_flip($_POST)); post_arr_key دولار = انفجر ('.'،array_flip دولار _post)) ؛
$get_arr_key=implode('.',@array_flip($_GET)); get_arr_key دولار = انفجر ('.'،array_flip ($ _get)) ؛
$cook_arr_key=implode('.',@array_flip($_COOKIE)); cook_arr_key دولار = انفجر ('.'،array_flip دولار _cookie)) ؛
$other_shtuki=@file_get_contents('php://input'); other_shtuki دولار = @ file_get_contents ( 'بى. اتش. بي : / / المدخلات') ؛
$cracktrack = strtolower($post_arr.$get_arr.$cook_arr.$post_arr_key.$get_arr_key.$cook_arr_key.$other_shtuki); cracktrack دولار = strtolower ($ post_arr. get_arr دولار. cook_arr دولار. post_arr_key دولار. get_arr_key دولار. cook_arr_key دولار. other_shtuki دولار) ؛
$wormprotector = array('base64','user_pass','union','select','substring','or id='); $ wormprotector = مصفوفه ( 'قاعدة' ، 'user_pass' ، 'الاتحاد' ، 'اختر' ، 'خيط ثانوي' ، 'او معرف =') ؛
$checkworm = str_replace($wormprotector, '*', $cracktrack); checkworm دولار = str_replace ($ wormprotector ، '*' ، cracktrack دولار) ؛
if ($cracktrack != $checkworm) die(""); اذا كانت الاجابه ب (cracktrack دولار! دولار = checkworm) يموت ("")؛

It checks for certain keywords (in $wormprotector array) within GET, POST & COOKIE data. انها شيكات لبعض الكلمات الرئيسية ($ wormprotector في المصفوفه) في الحصول ، بعد انتهاء & كعكه البيانات. When they are present it simply aborts. عندما يحبط هذا ببساطة. This is one of the means to detect the current version of the script. هذا هو أحد وسائل للكشف عن النسخه الحالية من البرنامج النصي. This is also the reason why it failed to submit a post. وهذا أيضا هو السبب في انها لم تقدم بعد. An url such as this would also die - http://localhost/wordpress/?select as would http://localhost/wordpress/?base64. وجود موقع مثل هذا من شأنه ايضا ان يموت -- http://localhost/wordpress/؟select ما من شأنه ان http://localhost/wordpress/؟base64.
However there is nothing to be happy about. ولكن ليس هناك شيء عن ان تكون سعيدة. It will take less than a minute to modify the script and make it immune to detection in WordPress. سوف يستغرق أقل من دقيقة لتعديل النص وجعله في مأمن من الكشف WordPress.

How to protect your WordPress site from hacking? كيفية حمايه WordPress الموقع الخاص بك من القرصنه؟

You can protect your administration scripts (scripts under wp-admin), where most attacks originate including this one, by restricting access to your admin scripts to specific IP address or IP address range. يمكنك حمايه ادارتكم ومخطوطات (مخطوطات في اطار رزمه العمل - الادارة) ، حيث تنشأ معظم الهجمات بما في ذلك هذه واحدة ، عن طريق تقييد حق الدخول الى حسابك في ادارة برمجيه محددة لمعالجة الملكيه الفكريه او الملكيه الفكريه معالجة طائفة. You can also add a basic authentication on top of WordPress by using your httpd.conf file or .htaccess. يمكنك ايضا اضافة اساسي على توثيق اعلى WordPress الخاصة بك أو باستخدامها او ملف httpd.conf. Htaccess. This adds a layer of security which any hacker will have to overcome before he gets to your WordPress vulnerabilities. وهذا يضيف طبقة من الامن والتي سيكون لها اي هاكر للتغلب علي قبل ان يحصل على نقاط الضعف الخاصة بك WordPress.

WordPress should be upgraded as regularly as possible. WordPress كما ينبغي رفع مستوى بانتظام قدر الامكان. However that is easier said than done. بيد ان هذا هو أسهل من القيام به. Normally I prefer to wait a few versions before the new versions stabilize. عادة انني افضل ان انتظر بضع نسخ قبل تثبيت النسخ الجديدة.

WordPress security vulnerabilities affects every one of us, WordPress based bloggers. WordPress الامن مواطن الضعف يؤثر على كل واحد منا ، على اساس من المدونين WordPress. While I was fully aware of the possibilities and even thought of writing a plugin to address these issues before, I decided to wait (and address more urgent issues or so I thought) relying on the law of probability to protect my sites; after all there are several million WordPress blogs out there, how much chance of being targeted by a hacker? بينما كنت على علم تام من الامكانيات والفكر وحتى كتابة البرنامج المساعد لمعالجة هذه القضايا من قبل ، فقد قررت ان انتظر) ومعالجة قضايا اكثر الحاحا او حتى فكرت) بالاعتماد على قانون بلدي احتمال لحمايه المواقع ؛ على كل حال هناك هي عدة ملايين من بلوق WordPress الى هناك ، وكم فرصة ان تكون مستهدفة من قبل هاكر؟ Well, as it turns out, I was wrong. وايضا ، كما تبين ، كنت على خطأ.
To simplify securing WordPress, I have created a plugin, to be released soon, which leverages these ideas and more to secure your WordPress installations. تأمين لتبسيط الكلمات) لقد أوجد البرنامج المساعد ، على ان يكون قريبا ، الذي leverages هذه الافكار واكثر لتأمين المنشآت الخاصة بك WordPress. It works with your .htaccess but it also works even when .htaccess facility is not available. وهي تعمل مع الخاصة بك. Htaccess فحسب ، بل وحتى عندما تعمل. Htaccess مرفق غير متاح. I have already started using it on my blogs. لقد بدأت فعلا باستخدام بلادي على بلوق.