|
- 这篇文章介绍了当WordPress开启错误记录以后,根据error_log来发现SQL注入攻击的思路。
" i% `2 z2 |1 l/ a3 I8 v1 T6 a
2 y0 [6 e5 {! P. G, c! |吸引Cocoa的是这个博客其实是TrustWave公司下属的一个叫Spiderlab团队的官方博客,貌似比较有意思。例如它提到了Honeypot Alert这个标签里的文章都是分析他们一个Web蜜罐的Apache access_log日志的。# Q1 s% U) r' l# d' K' k3 r
2 d! j( C) E1 Y4 l# T+ p) {简单介绍一下这篇文章吧。% ^! ]7 y7 i# q( S+ z
2 E# }3 Q1 Q- ?4 H1 f开启WP错误记录功能
9 k+ {" l0 T( i7 I: j7 m' q( x只需要修改wp-config.php的如下几行:
, A* X: a2 V6 V$ a/ E" [
1 v8 D* D. Y$ h3 a9 ~+ _@ini_set('log_errors','On'); @ini_set('display_errors','Off'); @ini_set('error_log','/home/example.com/logs/php_error.log');SQL 注入扫描
* I" K) m' e% D
& y0 c' n3 i* e" i3 i. Q[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\', C) u1 K. d/ K2 p
[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--& |8 A: @* j! F6 b9 H
[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--
; o E( ]2 t1 f( a& l) V# ?% H5 H上面的日志就是在暴力猜解表的列数,那个巨大的十六进制值会被解析成null。
' O9 {# E1 d% p+ @4 y4 k4 G g fSQL盲注扫描
. X- o( L+ O+ `$ k! e攻击者使用了类似"waitfor delay"和"benchmark"这样的函数来盲注。! O( B) m# y4 L# m3 k
' ^- K0 n% p( R, a
[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\'--
) n- ]3 s7 ~- _7 E& p& ~[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)
! N5 a, ], J- A" qGoogle一下大规模扫描
: E; L# n; G" H$ X% ~2 L/ v
( l, q) C& q) Z- h! I- W& x% v
) m4 u2 n# s: }7 M$ _* P' ^ V7 ~8 v1 A1 A( C4 N' s
8 j! l9 r% R/ v" ~1 e# | w( g$ ]# I
7 e9 e" k* S0 x1 N
僵尸网络控制着可能使用被感染主机来识别潜在的目标。下面是该公司的蜜罐捕获到的一个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;0 `+ |3 f: T2 b6 U3 `5 p1 u# W
% {; N9 E% b8 C& R5 A e
Cocoa总结:文章比较简单,但是从日志来检测攻击貌似是目前流行的一个方向。
9 ?5 r3 h9 J0 h) l$ b |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
|