查看: 3971|回复: 18
收起左侧

[分享] 【实践过非原创】揭秘U盘免疫Panda USB Vaccine 原理

[复制链接]
star1025
发表于 2009-11-15 14:56:58 | 显示全部楼层 |阅读模式
看了这贴http://bbs.kafan.cn/viewthread.php?tid=592523&extra=&page=1
U盘免疫Panda USB Vaccine 1.0.1.4,,大小828.96KB,,免费


感觉有些话,还是要说说的

俺不搞争议,只说技术

这个原理揭秘,老实说我是无意百度到的,一个网友发在他百度空间了。我顺藤摸瓜找到了最初出处

经过自己的验证,发现Panda USB Vaccine 的免疫原理确实如文中所述
http://www.milw0rm.com/papers/314

http://203.208.39.132/search?q=c ... vMotcgXZoWEIZxtytQQ

--++[Preventing the spread of USB malware]++--


//Author – Robin Bailey
//Date – 05/04/2009
//Email - rbailey.security<0x40>googlemail.com

//Contents
[1] Introduction
[2] The problem
[3] Solution
[4] Conclusion



//Introduction [1]

As the use of memory sticks has become more and more widespread, so malware has
began to use them as a way to spread from machine to machine. While this is a
problem for end users, the real danger is with IT professionals, who might use
the same USB stick in dozens of computers in a single day, will often be logged
in with administrative privileges, and will have access to important machines.
This paper is aimed at those professionals, and how they can mitigate the risk
of passing an infection onto other machines.



//The Problem [2]

Malware uses two main techniques to spread through memory sticks. The first,
and less serious, is infecting executable files on the memory stick, so that
when they are run on another machine, the infection moves with them.

The more common, and more dangerous, is to spread via the `autorun.inf` file,
which Windows automatically executes when the drive is connected, meaning that
no user interaction is needed. Conficker has been getting a lot of attention
recently, and this was one of the methods it used to spread itself, but many
other malicious programs used the same technique.

It is possible to disable the autorun feature from Windows, but this requires
that the client machine has done this, which is not always the case, as most
users will not have the technical knowledge to do this.



//The Solution [3]

Since we cannot rely on the computer to prevent the execution of the
autorun.inf file, we must do this from the memory stick. It is possible to buy
memory sticks with read-only switches, so that they can be locked to prevent
the computer writing to them, but this can cause problems, is easily forgotten,
and doesn't help once the memory stick has been infected.

However, if the memory stick is FAT32, which most are, with the exception of
some of the new 8GB+ drives, we can create a quick fix using a hex editor, and
a basic knowledge of the FAT32 directory table.

First, we create a blank `autorun.inf` file on the memory stick, then open up
the disk in a hex editor. It doesn't matter if you open the physical disk, or
the logical partition, but if the disk has more than one partition, it is
better to do the latter. Make sure that the disk is opened with read/write
permissions, and that you haven't got anything accessing it at the time. HxD
for Windows is a small, portable hex editor, if you don't already have one.



While this can be done to a disk with data on, it is safer to do it to a blank
one, just in case there is a problem. If not, make sure that you have a copy of
any data on the stick, if you don't, the you are liable to any loss of data
that might occur.

Next, run a search in the disk for the string `AUTORUN`, as a non-Unicode text
string. It should find it near the beginning of the disk. The area we are
interested in is as follows.

41 55 54 4F 52 55 4E 20 49 4E 46 20
A  U  T  O  R  U  N     I  N  F   


The first 8 bytes are the filename (with a space at the end, because autorun is
only 7 characters), followed by a 3 bytes file extension (INF), followed by one
byte for the file attributes. It is this final byte that is relevant.

The current value of the byte (0x20) has just the archive bit set. What we want
to do, is to change this byte to 0x40, which sets the device bit, which is
never normally found on a disk. The block will now look like this.

41 55 54 4F 52 55 4E 20 49 4E 46 40
A  U  T  O  R  U  N     I  N  F  @

Once this has been saved to disk, ignoring any warning that this might corrupt
the disk, we then unmount and remount the volume. Now, when you browse to the
disk, the autorun.inf file can be seen, but it cannot be deleted, opened,
edited, overwritten, or have its attributes changed.

When this memory stick is connected to an infected machine, which will try to
create an autorun.inf file on it, it will fail with an error, (Cannot create
file), meaning that this memory stick cannot be infected, and thus cannot pass
an infection on to any other computers.



//Conclusion [4]

As stated before, this is not a guide aimed at end users, it is aimed at IT
professionals, or other power users, who will use the same USB stick on
multiple computers on a day to day basis.

Should this technique become widely used, we will almost certainly see malware
that can bypass it, but until that happens, it can provide a simple but
effective defense against USB spreading malware.


If you have any comments/questions/suggestions send me an email.

# milw0rm.com [2009-04-06]

测试了一下pandaU盘免疫工具,发现他在这个位置是修改为<0x42>,hoho,原理是一样的。
【破坏的话,如果把该标志位修改回<0x20>,则告失效】



[ 本帖最后由 star1025 于 2009-11-15 15:01 编辑 ]
kd142718
发表于 2009-11-15 15:31:22 | 显示全部楼层
早就知道了刚出来,研究过一段时间,不过编程学的不好没有模仿写出东西来
hkt988
发表于 2009-11-15 15:40:32 | 显示全部楼层
不懂啊
1e3e
头像被屏蔽
发表于 2009-11-15 16:38:47 | 显示全部楼层
这个能防住u盘病毒么?
qetuabc
发表于 2009-11-15 16:58:05 | 显示全部楼层
不就是代码么 让我想起了GE的修改内存代码教程
dongsheng01
发表于 2009-11-15 17:21:15 | 显示全部楼层
看不太明白 就是不知道实战效果如何
bbs2811125
发表于 2009-11-15 18:42:55 | 显示全部楼层
实际效果到底如何
kd142718
发表于 2009-11-15 18:56:32 | 显示全部楼层
实际效果没的说,这个类似于产生畸形的文件,没有办法删除,但是你也建立不了Autorun.inf文件。效果很好。
taoyuan237
发表于 2009-11-15 18:58:11 | 显示全部楼层
比畸形文件夹高级一点。
任何东西都可以KILL掉没什么稀奇的
nayo
发表于 2009-11-15 22:31:58 | 显示全部楼层
恩,差不多
老奶奶尚且想将铁棒磨成针
何况这低门槛的安全世界?
当然,这种方法虽然简单,但怎么也算前进波涛中一朵不起眼的小小的浪花了
您需要登录后才可以回帖 登录 | 快速注册

本版积分规则

手机版|杀毒软件|软件论坛| 卡饭论坛

Copyright © KaFan  KaFan.cn All Rights Reserved.

Powered by Discuz! X3.4( 沪ICP备2020031077号-2 ) GMT+8, 2025-3-3 00:25 , Processed in 0.135285 second(s), 16 queries .

卡饭网所发布的一切软件、样本、工具、文章等仅限用于学习和研究,不得将上述内容用于商业或者其他非法用途,否则产生的一切后果自负,本站信息来自网络,版权争议问题与本站无关,您必须在下载后的24小时之内从您的电脑中彻底删除上述信息,如有问题请通过邮件与我们联系。

快速回复 客服 返回顶部 返回列表