|
|
- 这篇文章介绍了当WordPress开启错误记录以后,根据error_log来发现SQL注入攻击的思路。% Y/ i6 D X( |2 e A3 |- Q
, \" S* t/ m: l9 m7 Z
吸引Cocoa的是这个博客其实是TrustWave公司下属的一个叫Spiderlab团队的官方博客,貌似比较有意思。例如它提到了Honeypot Alert这个标签里的文章都是分析他们一个Web蜜罐的Apache access_log日志的。
5 [! a' h8 i, j) o) F1 Q- G, W7 b1 ]6 O
简单介绍一下这篇文章吧。
+ d+ l$ T S+ s+ J g/ E0 x& j+ k" D `. X9 |5 q
开启WP错误记录功能/ i' a. b& T7 Y A+ o0 l. k
只需要修改wp-config.php的如下几行:
0 L n1 l1 z9 @
, K1 J* S. x q) V* K@ini_set('log_errors','On'); @ini_set('display_errors','Off'); @ini_set('error_log','/home/example.com/logs/php_error.log');SQL 注入扫描
# t% v# [9 `9 @% O) J1 Y
/ k1 F- j3 w4 a+ v! a" y V x[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\') ]2 \, f# v7 v* z# Y& a' B7 f' a
[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--
* D* H s+ K$ ?% A9 |[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--$ S! h$ L- e3 o' S$ ]
上面的日志就是在暴力猜解表的列数,那个巨大的十六进制值会被解析成null。
* q. e- y2 r. t! L8 h3 ~- j. KSQL盲注扫描5 l& y7 d# S7 m. F* B5 T8 M
攻击者使用了类似"waitfor delay"和"benchmark"这样的函数来盲注。/ F7 ?% M3 M; ^" P/ ~
; |- h. j* }" X) u[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\'--: x9 v& T$ ]3 _) [' ?/ 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/ S. U& ?. Y) ~% ]
Google一下大规模扫描! w, K7 v' @) f$ i* _
* Y+ i6 q: [3 q% r l$ s8 G' [* i
) K7 Z; d3 H9 F" I( J) v# r+ A5 M5 M/ v; t
4 [& q' i6 E; K" Q( a
; l% `$ Z6 }# x3 P# p) 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;
( D5 r+ g. ]7 x# [6 D9 t* x2 Z2 q
\/ b1 Y! O6 L# [) L- ~; d$ F% UCocoa总结:文章比较简单,但是从日志来检测攻击貌似是目前流行的一个方向。
+ O2 v8 s$ K4 c; | |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
|