简单判断病毒文件

Today, my girlfriend asked a question. She asked me how to test a software as a suspicious software in linux operating system.I had thought much about it.

With the development of computer, many suspicious software or virus enter into computer world. There is no an accurate concept to describe this software. Maybe they can destroy your operating system or they did nothing.

Now, there are some features to describe them.
    1. Execution. It must be a executable file. No matter what they are, their first action is find a way to make themselves execute with a external motivation. 
    2. Infectiousness. Once your system attacked by them, probably them coped them one hundred copies or more. Then, they can send themselves to the Internet and infect other system.
    3. Hidden. This sort of software is running underground, but they are destructive.

And what our computer seems like after infected by virus ?
    1. The CPU rate always used almost 100%.
    2. The memory totally used by only one process.
    3. Your file deleted and created without yourself.
    4.  There are also other performs like getting your private file and so on.

In fact, many virus are very very hidden which you can't discover them without a anti-virus software. 

Recently, my girlfriend's team developed a code testing system to test the code from student then run the program and get the result returning to the students. Bit there is seriously security problem, which is how should we do if the code itself is a virus code. Once we compiled and run, our system will be attacked.

They develop environment is linux plus gcc.

We all know that linux operating system is very well because of it's micro kernel and good security. The linux's permission is managed very well. The system provides three groups to manage the files. Each group has it's own permission to operate the files.The files can't be executed by other users and groups.

This is a classic example of permission management.
"-rwxrwxrwx", the first three characters "rwx" represent the file owner's permission and the second three character represent the owner's group's permission, then the last three characters represent the other's permission.

This mechanism is very tight! But our program has "x" permission to execute.
We have to describe a mechanism which shows that only root user can execute every commands. That to say that if any software want to execute commands that they can't execute is probably virus.

The other methods to test the program are testing the CPU's used rate and the memory room the program used. If the rate is almost 100%, now that it is not virus, we also must stop it.

We conclude that if a test code try to execute commands it can't executed is probably virus. This is a simply conclude to test the program if it is a virus.

I should continue to explore what a virus is and how defend the virus.
### 使用 WinHex 分析 PE 文件以检测病毒 #### 加载文件 为了使用 WinHex 进行 PE 文件分析,首先需要加载目标文件到 WinHex 中。这可以通过点击菜单中的 "File" -> "Open" 来完成。一旦文件被打开,在左侧会显示十六进制视图而在右侧则会有ASCII表示[^1]。 #### 查看PE头部信息 在WinHex中查看PE文件的关键在于理解并解析其头部结构。对于任何有效的PE文件来说,都会有一个特定标志“MZ”,这是DOS头的一部分;接着大约在偏移量0x3C的位置能找到指向NT头的指针。通过这些特征可以确认所分析的对象确实是一个PE格式的可执行文件[^3]。 #### 寻找异常模式 当怀疑某个PE文件可能携带恶意代码时,应该特别注意以下几个方面: - **导入表**:检查是否存在不寻常或不必要的API调用。例如,如果一个简单的应用程序却尝试访问网络功能,则可能是潜在威胁的一个迹象。 - **导出函数**:观察是否有未记录过的公开函数名或是奇怪的名字组合出现。 - **节区属性**:正常情况下各部分具有固定的权限设置(如`.text`通常是只读)。若有标记为可写入甚至允许执行的数据段,则需进一步调查。 - **资源目录**:留意图标、位图或其他嵌入式对象是否合理存在以及它们的内容性质如何。 以上提到的特点都可以借助于WinHex内置的功能来进行深入探究,比如利用插件辅助识别某些已知类型的payload签名等[^2]。 #### 对比多引擎查杀结果 考虑到单一防毒产品可能存在漏报的情况,建议将疑似感染的目标提交给在线综合型平台做全面筛查。这类服务通常集成了数十种不同品牌的防护机制共同作用,从而提高检出率的同时减少误判概率。 ```python # Python脚本仅作为概念展示,并非实际用于WinHex内运行 def analyze_pe_with_winhex(file_path): with open(file_path, 'rb') as f: content = f.read() # 假设此处有更多逻辑去实现具体分析过程... ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值