|
- 这篇文章介绍了当WordPress开启错误记录以后,根据error_log来发现SQL注入攻击的思路。
* L0 f/ F' S8 t, y S; T' } J8 D5 v) [
吸引Cocoa的是这个博客其实是TrustWave公司下属的一个叫Spiderlab团队的官方博客,貌似比较有意思。例如它提到了Honeypot Alert这个标签里的文章都是分析他们一个Web蜜罐的Apache access_log日志的。
$ N; c' {9 l+ }2 d7 L. y
0 I. h u/ w+ s" p; ^3 n' n简单介绍一下这篇文章吧。& h" d! T0 A- F
% r7 N2 P$ h, \
开启WP错误记录功能! z% H+ _* ^" P5 p- u
只需要修改wp-config.php的如下几行:' X+ y3 x! t# o; l* t" }& _ l% c1 c
5 e+ W1 {; X3 c# ]) ^9 J@ini_set('log_errors','On'); @ini_set('display_errors','Off'); @ini_set('error_log','/home/example.com/logs/php_error.log');SQL 注入扫描( s! x2 Y& A" |' x
1 c% @2 k% g9 K% b7 {[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\'
g/ `( S8 t) A0 m[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--# [9 F- a; O& q6 a$ w
[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--
# n& U1 U2 ^5 k5 D上面的日志就是在暴力猜解表的列数,那个巨大的十六进制值会被解析成null。 5 G! P1 `2 E5 a1 ?& u- B; ]
SQL盲注扫描1 g+ z1 ^( E% ]3 N+ G
攻击者使用了类似"waitfor delay"和"benchmark"这样的函数来盲注。
' t# \/ w+ Z% _
, w( E0 C: J! Z. B( K# `[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\'--8 R$ p- W7 [6 d- u% i" u$ ~
[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)
! d7 ~# o ~7 z% S8 L) R7 YGoogle一下大规模扫描' k/ ]; A3 `* m( M t/ l
: P& R9 u6 Z6 J! m0 t: N" k" H, t( V* Q, j7 K7 R
- |0 v& @, `; O) J4 ^/ {' E
; K; E6 f0 P% K) ?4 N* L
* ]" |' s F( B! Q: y" p ^
8 m$ G, u1 w" r1 e3 W/ t$ ]& m+ \8 } 僵尸网络控制着可能使用被感染主机来识别潜在的目标。下面是该公司的蜜罐捕获到的一个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;
/ v9 x1 i9 H0 t# P! M" y w2 c' e: Y
, Z' S8 M1 }' O: y& K$ v- WCocoa总结:文章比较简单,但是从日志来检测攻击貌似是目前流行的一个方向。3 `' s1 o2 ^% D4 a3 ?
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
|