|
- 这篇文章介绍了当WordPress开启错误记录以后,根据error_log来发现SQL注入攻击的思路。( g: ^- }& v u* A: m
+ `, U3 Q+ d) u' M6 _5 o吸引Cocoa的是这个博客其实是TrustWave公司下属的一个叫Spiderlab团队的官方博客,貌似比较有意思。例如它提到了Honeypot Alert这个标签里的文章都是分析他们一个Web蜜罐的Apache access_log日志的。" V' y/ R0 h0 e( a% y3 L( J; G; U
9 F, }7 \7 E( T( I5 L2 i! O" }
简单介绍一下这篇文章吧。
5 b& P+ J7 W. }: O- u3 U" K/ H- A" e/ ~: B- a8 k
开启WP错误记录功能- S9 `1 j, d6 A+ D/ x, p8 {8 j( n: W
只需要修改wp-config.php的如下几行:
& u7 p8 ?8 P+ ?. v/ E* s6 g4 K6 \8 C( v8 i
@ini_set('log_errors','On'); @ini_set('display_errors','Off'); @ini_set('error_log','/home/example.com/logs/php_error.log');SQL 注入扫描1 L1 @( B# t. G* z1 ]; |
# z$ d+ I9 X3 Q. Y" Z d/ F" j[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\'
* m. H+ s! n. s X% d[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--
- @3 i/ e+ ]4 N% t/ l, H* x[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--: g- |9 @' }9 Y3 m3 H% h( t
上面的日志就是在暴力猜解表的列数,那个巨大的十六进制值会被解析成null。
# i, ]) ~( g2 k* ^; _) h& K& n& aSQL盲注扫描
. r6 K, ]6 L, R4 V4 `! Q3 Q4 R攻击者使用了类似"waitfor delay"和"benchmark"这样的函数来盲注。
5 s- W. Q# O6 H) r# ?! _
) F. j6 ]$ o/ q& [5 G[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\'--
. s6 A0 v( z, J0 q# R1 W[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)
- I9 @' P8 c2 s& K+ ^/ RGoogle一下大规模扫描5 y: }9 w7 R4 S% D; R" C$ I! M
+ Q: a$ D) k' e4 u/ N! F* [6 @$ d
% P( ~2 ?. V) w+ a
0 g9 A- I D3 o7 b; L0 M, j
) t3 a# N, H$ U$ x S
* n/ {* Z& j$ E# R
# y$ u3 F/ \9 ] 僵尸网络控制着可能使用被感染主机来识别潜在的目标。下面是该公司的蜜罐捕获到的一个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;
! N3 R; H5 L5 T/ S3 R& g0 T 5 S; z r4 G( k3 [
Cocoa总结:文章比较简单,但是从日志来检测攻击貌似是目前流行的一个方向。9 c+ J4 k! ~6 ^
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
|