简单的多态引擎

发布于 2024-10-02 13:07:03 字数 243 浏览 1 评论 0原文

我必须编写一个简单的多态引擎。我使用linux(32位),我可以用汇编语言和c语言编写代码。我不知道如何开始。

你能给我一个构建这样一个引擎的架构吗?我的想法是制作一个程序:

  1. 读取文件的代码部分
  2. ,将其加密在缓冲区中,
  3. 在开头留出空间(可能吗?)以添加解密例程,
  4. 在程序的代码部分中写入新的缓冲区。

是这样吗?它是否反映了这种发动机的运行情况?

I have to program a simple polymorphic engine. I use linux (32-bit) and i can code in assembly and c. I don't know how to start.

Can you give me a schema for constructing such an engine? My idea is to make a program that:

  1. read the code section of a file
  2. encrypts it in a buffer,
  3. make space at the beginning (is it possible?) to add the decrypt routine
  4. write the new buffer inside the code section of the program.

Is that right? Does it reflect the operation of such an engine?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

蓝色星空 2024-10-09 13:07:03

基本架构与您所描述的完全不同。通常只有病毒主体被加密,而不是整个代码部分。考虑一种简单的病毒,它要么扩展代码部分,要么为其主体创建一个新代码部分。现在,要使其具有多态性,您必须添加加密并使解密器代码变得非常量,例如:

1)随机插入nop(nopadd reg,0push reg; pop reg 等)

2)更改程序流程(jmp nextclc; jc next 等)

3 ) 使用具有相同算术效果的指令 (add eax, 3 -> add eax, 9; sub eax, 6)

多态意味着它可以有固定数量的编码,因此创建解密器代码的最简单方法是将解密器代码分解为多个块,并为每个块提供多个具有相同长度的编码。

编辑:是的,它是病毒体的一部分。为了使用它,您将所有这些“砖块”放入病毒体内,当另一个文件被感染时,您为其创建一个随机版本的描述符。

The basic schema is quite different from that you've described. Usually only the virus body is encrypted, an not the whole code section. Consider a simple virus that either extends code section, either creates a new one for its body. Now, to make it polymorphic, you have to add encryption and make the decryptor code to be non-constant, eg:

1) insert nops randomly (nop, add reg, 0, push reg; pop reg, etc)

2) change the program flow with ( jmp next, clc; jc next, etc)

3) use instructions with the same arithmetic effect (add eax, 3 -> add eax, 9; sub eax, 6)

Polymorphic means that it could have a fixed number of encodings, so the simpliest way to create one is to break the decryptor code in several blocks, and provide several encoding with the same length for each.

EDIT: Yes, it's a part of the virus body. In order to use it you put all these "bricks" in the virus body, and when another file is infected, you create a random version of the decriptor for it.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文