|
|
- 这篇文章介绍了当WordPress开启错误记录以后,根据error_log来发现SQL注入攻击的思路。5 J* r. Y4 T! `4 I. E8 `! q6 ]
5 o+ P; o+ o- [9 n6 L) Z
吸引Cocoa的是这个博客其实是TrustWave公司下属的一个叫Spiderlab团队的官方博客,貌似比较有意思。例如它提到了Honeypot Alert这个标签里的文章都是分析他们一个Web蜜罐的Apache access_log日志的。
% z* f0 Y3 o# `1 X: ]1 C8 q3 [/ k( B( F5 e" V) O& y- g
简单介绍一下这篇文章吧。) W( ~. v, ^: K" Z5 |/ t! r D# `
! K0 ~6 o1 ^! L开启WP错误记录功能6 E- y# F6 H$ C4 ?) D6 E
只需要修改wp-config.php的如下几行:; l) i- f; s$ c7 J! [, w/ l% S
3 H! X+ b: h: ~( h2 N, n3 N9 Q@ini_set('log_errors','On'); @ini_set('display_errors','Off'); @ini_set('error_log','/home/example.com/logs/php_error.log');SQL 注入扫描
% a {2 ?$ t5 Z/ f U3 V; E$ w
; U ^4 K0 H: M( t. S[07-Dec-2012 02:40:49] WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE id = -1\'' at line 1 for query SELECT text, author_id, date FROM WHERE id = -1\'
4 D+ }( Y9 `' B- e2 Q2 Q" \[07-Dec-2012 02:40:50] WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE id = 999999.9 UNION ALL SELECT 0x31303235343830303536--' at line 1 for query SELECT text, author_id, date FROM WHERE id = 999999.9 UNION ALL SELECT 0x31303235343830303536--
( J' @4 n5 w0 U$ Z7 @, b8 ^[07-Dec-2012 02:40:53] WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE id = 999999.9 UNION ALL SELECT 0x31303235343830303536,0x313032353438303035' at line 1 for query SELECT text, author_id, date FROM WHERE id = 999999.9 UNION ALL SELECT 0x31303235343830303536,0x31303235343830303536--
/ U; m1 o! r% w) u: R0 N上面的日志就是在暴力猜解表的列数,那个巨大的十六进制值会被解析成null。 2 r% ]! o! I# Q% O
SQL盲注扫描
5 u- T! Q5 S3 F$ u6 _攻击者使用了类似"waitfor delay"和"benchmark"这样的函数来盲注。
5 d! k$ e/ S+ _5 M9 a/ a' k$ u( U& Z% k2 C
[07-Dec-2012 02:43:21] WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE id = -1; if (1=1) waitfor delay \'00:00:05\'--' at line 1 for query SELECT text, author_id, date FROM WHERE id = -1; if (1=1) waitfor delay \'00:00:05\'--
% ?+ y; f' i0 |! G[07-Dec-2012 02:43:27] WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE id = -1 and if(1=1,BENCHMARK(8623333,MD5(0x41)),0)' at line 1 for query SELECT text, author_id, date FROM WHERE id = -1 and if(1=1,BENCHMARK(8623333,MD5(0x41)),0)
$ B0 ]; t+ [8 x# V8 R0 {& I4 S: |Google一下大规模扫描
( z1 X" K9 v2 V/ r! x5 P7 D) c
" a& l+ L+ \- R
; ^ x) g/ V8 Q& J( O, q( g! ~6 M * P% T T% E! N* Y, V) j
: k$ I" b7 A: v! b5 S$ u
& x- g4 O4 p: Y* B4 O7 \ F- D1 J" h) e4 S2 {
僵尸网络控制着可能使用被感染主机来识别潜在的目标。下面是该公司的蜜罐捕获到的一个RFI(远程文件包含)攻击代码里的片段: - sub google() { my @list; my $key = $_[0]; for (my $i=0; $i<=400; $i+=10){ my $search = ("http://www.google.com/search?q=".&key($key)."&num=100&filter=0&start=".$i); my $res = &search_engine_query($search); while ($res =~ m/<a href="\"?http:\/\/([^">\"]*)\//g) { if ($1 !~ /google/){ my $link = $1; my @grep = &links($link); push(@list,@grep); } } } return @list;; Q5 S% O" r4 Y* |. n
8 X3 l, r7 n5 p) W& k5 ~Cocoa总结:文章比较简单,但是从日志来检测攻击貌似是目前流行的一个方向。
% y- j" I7 C/ X* {8 A |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
|