This WordPress blog was hacked for few hours on 24th December (nice Christmas present!) from Russia. 몇 시간에 대한 해킹이 wordpress 블로그가 24 일 12 월 (니스의 크리스마스 선물!) 러시아에서합니다. 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 해커가 취약점을 악용 전체 액세스를 관리하는 스크립트를 얻을 웹사이트 (로 허가를 아파치 사용자)를 포함하여 능력을 업로드 및 실행 스크립트, 아파치 사용자가 소유한 파일을 삭제합니다,보기 등이 해당 파일 및 디렉토리 완전 공개를 해킹하는 방법과이 사이트는 해킹을 제거하는 방법을 감지하고 나는 몇 의견과 함께 보안의 상태를 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. 추가했는데, 단순 시스템 로그 () 명령문 이전과 이후에 플러그 접속합니다. 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 추가하는 정의를 수행하기 전에 시스템 로그를 확인하고 있었을합니다. 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')) 시스템 로그 (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')) 시스템 로그 (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. 이 해커는 a 경고 징후 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. 세부 사항은 다음에 나는 어떻게 내 사이트를 확보하고 범인에 대한 더 많은 정보를 제공하고 사이트가 해킹 방법을 처음부터합니다.

How the site was hacked using WordPress? 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 : 7시 40분 22초 -0600] "포스트 / wp-admin/options.php 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 : 7시 40분 24초 -0600] "포스트 / wp-admin/options.php 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 : 7시 40분 26초 -0600] "포스트 / wp-admin/inline-uploading.php? 포스트 =- 1 & 액션 = 업로드 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 : 7시 40분 29초 -0600] "포스트 / wp-admin/inline-uploading.php? 포스트 =- 1 & 액션 = 업로드 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 : 7시 40분 52초 -0600] "포스트 / wp-admin/options.php 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 : 7시 40분 54초 -0600] "포스트 / wp-admin/options.php 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 : 7시 40분 57초 -0600] "포스트 / wp-admin/inline-uploading.php? 포스트 =- 1 & 액션 = 업로드 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 : 7시 41분 11초 -0600] "보기 / wp-admin/options-misc.php되는 HTTP/1.1"200 7764 "-" "opera/9.24 (windows nt 5.1; u; 러)"
[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 : 7시 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 (windows nt 5.1; u; 러) "
[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 : 7시 41분 15초 -0600] "보기 / 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; 러) "
[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 : 7시 41분 12초 -0600] "포스트 / wp-admin/inline-uploading.php? 포스트 =- 1 & 액션 = 업로드 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 : 7시 41분 21초 -0600] "보기 / wp-admin/plugins.php? 액션 = 정품 인증 & 플러그 접속 =/../../../../../../. ./../../../../../../../../../../../tmp/ro8kbsmawge.txt & _wpnonce =되는 HTTP/1.1 "200 1474"http : / / 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 : 7시 41분 23초 -0600] "보기 / wp-admin/plugins.php? 액션 = 정품 인증 & 플러그 접속 =/../../../../../../. _wpnonce = ./../../../../../../../../../../../tmp/ro8kbsmawge.txt & 7b4c8019bd되는 HTTP/1.1 "302 -"http : / / 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 : 7시 41분 30초 -0600] "보기 /? piska23되는 HTTP/1.1"200 95716 "http://lamer/mwpep/?mode=shell&what=20" "opera/9.24 (windows nt 5.1 ; u; 러) "
[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 : 7시 41분 36초 -0600] "보기 /? piska233되는 HTTP/1.1"200 15840 "-" "opera/9.24 (windows nt 5.1; u; 러)"
[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 : 7시 41분 44초 -0600] "포스트 / 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; 러) "
[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 : 7시 41분 47초 -0600] "포스트 / 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; 러) "
[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 : 7시 41분 55초 -0600] "보기 /? piska233 & dira = / tmp되는 HTTP/1.1"200 9930 "-" "opera/9.24 (windows nt 5.1; u; 러)"
[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 : 7시 41분 54초 -0600] "보기 / wp-admin/options-misc.php? 업데이트 = 진정한되는 HTTP/1.1"200 7842 "http://blog.taragana.com/wp- 관리 / 옵션 - misc.php ""opera/9.24 (windows nt 5.1; u; 러) "
[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 : 7시 42분 36초 -0600] "포스트 / index.php? piska233 & dira =. /되는 HTTP/1.1"200 36721 "http://blog.taragana.com/?piska233" "opera/9.24 (windows nt 5.1; u; 러) "
[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 : 7시 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 (windows nt 5.1; u; 러)"
[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 : 7시 43분 38초 -0600] "보기 / wp-content/plugins/wysi-wordpress/themes/advanced/docs/es/images되는 HTTP/1.1"301 298 "-" "opera/9.24 (windows nt 5.1; u; 러) "
[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 : 7시 43분 40초 -0600] "보기 / wp-content/plugins/wysi-wordpress/themes/advanced/docs/es/images /되는 HTTP/1.1"200 604 "-" "오페라 / 9.24 (windows nt 5.1; u; 러) "

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 구성 (인증을위한 데이터베이스 액세스에 필요한 검사) - 설정을로드하는 부하 백린 톤의 다른 php 파일을뿐만 아니라 wordpress 플러그인 및 기타의 모든 hacks합니다. 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이 중 하나의 도전과 보안 고려 사항은 대부분 an 나중 (언제든지 동의하지 않을)을 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 (1에서 2007).

Most likely the site was hacked using the cookies authentication vulnerability as detailed 이 사이트는 쿠키를 사용하는 대부분의 인증 보안 취약점을 해킹 상세한 here 여기에 . 합니다.

Several WordPress plugins and themes also have security advisories: 여러 wordpress 플러그인 및 테마 보안 권고도 :
- AdSense-Deluxe 0.x (plugin for WordPress) - 애드 센스 - 디럭스 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 . the 주소의 사용자 책임을 내 사이트가 해킹 217.74.245.85합니다. The IP address belongs to KUBANGSM-NET: the 주소 소유하여 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 mnt - 의해 : kubangsm - mnt 출처 : 익은 # 필터링 

It is owned by: 이 소유한 :

 person:       Volkov Denis address:      61, Gimnazicheskaya str. 인원 : volkov 드니 주소 : 61, gimnazicheskaya str. 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 8,612 ,660,126 팩스 번호 - 지역 : +7 8,612 ,401,505 이메일 - 메일 : d.volkov @ kuban.mts.ru 네트워크 카드 - 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. 대부분의 자사의 인터넷 서비스가 스팸으로 학대를 당하고합니다. 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. 사용자 에이전트를 조작하는 동안 수 없다 그래서이 경우에는 이유를 의심합니다. 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: 스크립트는 php 스크립트를 침입 aa 좋은 의견과 모든 라인 :
/*Magic Include Shell by Mag icq 884888*/ / * 매직 쉘을 포함 884,888 개의 닉네임 * /
//TODO: ñëèòü ôàéëî íà ñâîé ôòï (!) / / 모두 : ñëèòü ôàéëî íà ñâîé ôòï (!)

Effectively it is a file manager, probably adapted from any of the free php file manager’s on the net. 을 효과적으로 그것은 파일 관리자, 아마 적응부터 중 하나를 무료 php 파일 관리자의 인터넷합니다. It allows you to: 이 옵션을 사용하면 :

  • Browse directories and files 브라 우즈 디렉토리와 파일
  • Edit files 파일 편집
  • Rename files 파일 이름 바꾸기
  • Delete files 파일 삭제
  • zip & unzip files 우편 번호 및 압축 해제 파일을
  • Upload & download files & directories 업로드 & 다운로드 파일 및 디렉토리
  • Execute arbitrary PHP scripts 임의의 php 스크립트를 실행
  • Execute arbitrary shell commands 임의의 쉘 명령어를 실행
  • Provides basic server, system & PHP information 기본적인 서버를 제공, 시스템 & php 정보

The bulk of the code is executed when it receives a particular query string to a normal HTTP GET request. 대량의 코드가 실행될 특정 검색어에 문자열을 받으면 일반적인 http 요청합니다. 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 = implode ('.',$_ 포스트);
$get_arr=implode('.',$_GET); $ get_arr = implode ('.',$_ get);
$cook_arr=implode('.',$_COOKIE); $ ('.',$_ 쿠키를 cook_arr = implode);
$post_arr_key=implode('.',@array_flip($_POST)); $ post_arr_key = implode ('.',@ array_flip ($ _post));
$get_arr_key=implode('.',@array_flip($_GET)); $ get_arr_key = implode ('.',@ array_flip ($ _get));
$cook_arr_key=implode('.',@array_flip($_COOKIE)); $ cook_arr_key = implode ('.',@ array_flip ($ _cookie));
$other_shtuki=@file_get_contents('php://input'); $ other_shtuki = @ file_get_contents ( 'php : / / 입력');
$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 = 배열 ( '64', '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/?base64들이 그랬던 것처럼 http://localhost/wordpress/?select합니다.
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. 1 분 미만이 소요될하고 그것을 수정하는 스크립트를 탐지 면역이되어 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. 을 확보를 단순화하기 wordpress, 나가 만들어 플러그 접속식, 발표되지 곧, 이러한 아이디어와 다른 사람을 활용하는 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. 벌써 내 블로그에 사용하기 시작합니다.