|
- 这篇文章介绍了当WordPress开启错误记录以后,根据error_log来发现SQL注入攻击的思路。, W" B0 t4 w! L
+ g: L3 w( }, N' ]3 N e# F; i吸引Cocoa的是这个博客其实是TrustWave公司下属的一个叫Spiderlab团队的官方博客,貌似比较有意思。例如它提到了Honeypot Alert这个标签里的文章都是分析他们一个Web蜜罐的Apache access_log日志的。
: l. ?. O6 w" R$ e/ R p
2 k/ }5 ^7 G# Z7 m, M简单介绍一下这篇文章吧。' R* p' Q1 J( H5 _2 ~
# X4 X9 [3 B: K$ X! a
开启WP错误记录功能
* P! Q! X% E j( J只需要修改wp-config.php的如下几行:1 X& ^/ K: G7 X# k9 _0 C
: Q3 I; N& w) ~9 ~@ini_set('log_errors','On'); @ini_set('display_errors','Off'); @ini_set('error_log','/home/example.com/logs/php_error.log');SQL 注入扫描
! @ V7 v5 g: w. T; y7 u% g* I1 \5 [7 `% V0 g t
[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 M' G6 D' l' u! _* g$ C* L[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+ w# ]5 Y: u2 G[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--
/ J, N$ T# F, `上面的日志就是在暴力猜解表的列数,那个巨大的十六进制值会被解析成null。 ; V% S3 p p" o, }
SQL盲注扫描
0 `/ f( T+ i! J0 ?' Y. d4 A7 S/ f攻击者使用了类似"waitfor delay"和"benchmark"这样的函数来盲注。
& a0 T1 {" g1 u
5 B0 ^! E4 H# R& x/ f[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\'--
. S1 y J" ?- f4 `+ z+ b[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)
! H# V4 M/ ], d1 dGoogle一下大规模扫描
" Y/ m2 H3 f2 X* P9 I: G9 b+ |' p4 f6 P
3 A9 f( f: [5 e/ ?; ?
1 I. H G$ e4 u- P
5 r# ]9 d, V* n, I$ ]' t* A; W3 K. e, _1 [2 w: X p- w/ h
2 R% }, U, m6 Q. i
僵尸网络控制着可能使用被感染主机来识别潜在的目标。下面是该公司的蜜罐捕获到的一个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;/ h8 d& d/ w3 [8 v& k0 R
' u' E3 F) q$ C9 L2 FCocoa总结:文章比较简单,但是从日志来检测攻击貌似是目前流行的一个方向。
8 R8 w' m, |5 s |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
|