Zum Hauptinhalt springen
Intelligence View
⚡ tsecurity.de Intelligence

Code Mutation (Polymorphism)

Before we start it's probably best to explain some things:Signature - A pattern of bytes used by an antivirus to identify malicious executables, this could be…

Beitrag
0
Seite
0
↗ Quelle (malwaretech.com)
CVE & Threat-Kontext · 5 Min. Lesezeit
Quelle: malwaretech.com
Rubrik: Video Analysen
Before we start it's probably best to explain some things:
Signature - A pattern of bytes used by an antivirus to identify malicious executables, this could be a string, parts of a function, or a hash.
Crypting - This is the most common way of evading antivirus detections, it works by encrypting the malicious executable so the antivirus cannot match the malicious code to existing signatures.
Payload - The malicious executable which is encrypted to evade detections, this is attached to the stub in some way (stored as a resource, added after then end of file, appended to a new or existing section).
Stub - A simple program responsible for decrypting the payload and executing it in memory. Due to the payload being encrypted, antiviruses will attempt to generate signatures to match the stub's code, but because the stub is small and simple it can be easily modified to evade existing signatures. 


Polymorphism

Polymorphism is a solution to a problem mainly found with worms/botnet: When an AV adds a new signature that detects the malicious executable, the infected file will be quarantined, leaving the malware running in memory until reboot. If a botmaster is running a botnet with thousands of bots, each time the stub is detected he's likely to lose a few hundred bots, his only choice: To keep updating the bots with a new stub before the previous one is detected (which for large botnets can be every few hours), leaving the hacker with very little free time. A solution to this would be to write malware capable of programmatically generating a unique stub and replacing the old one on execution, resulting in each computer having a different stub; this is know as polymorphism.

there's a few ways to programmatically create unique code that performs the same function as the previous. 

Block Mutation
A lot of assembly instructions can be freely movable, whilst some cannot. An instruction using a relative address (such as a jump or call), when moved will point to a different location, breaking the code; freely movable instructions such as those using absolute addresses or only registers can be moved anywhere.

Block based polymoprphism works by breaking the code down into small blocks, which are then numbered; the number specifies the order in which they execute and the block is either marked as movable or immovable based on its containing instruction. The mutation engine can then reorder, relocate, or separate the movable block; using jumps or similar instructions to link them together so that they execute in the correct order. Junk code (random instructions which are never actually executed) can also be added between blocks to add more entropy and change the executable size.

Register Swapping
It's possible to write the code in such a way that registers can easily be switched out, for instance all occurrences of edx within a function could be replaced with ecx, changing a lot of bytes within the application. The only problem with this approach is there's only a few usable registers, making it easy to exhaust all possible combinations, and it's still possible to generate signatures based on the layout of the instructions. 

Internal Assembler + Intermediate Language
A very effective approach is to embed an assembler within the payload, as well as create an intermediate language (IL) which the polymorphic engine uses to create ASM on the fly. A simple example would be the following IL code.

pmov Reg1, 5
add eax, Reg1

In this example instructions prefixed with p will be mutated at an instruction level, whilst those without a prefix will just be assigned a register and compiled as ASM. The IL engine would then use a seed to randomly generate the p-prefixed instructions by picking an instruction, or group of instructions, to perform the operation, as well as assign a register to Reg1 and Reg2.  

The array of instructions to handle pmov would look something like this: 
  1. push val
    pop reg
  2. mov reg, val
  3. xor reg, reg
  4. add reg, val
Once the engine has picked which instruction it wishes to use, it would then fill in the register and value, then compile it to ASM. Here are some examples of final outputs.

  1. push 5
    pop edx
    add eax, edx
  2. mov ecx, 5
    add eax, ecx
  3. xor ebx, ebx
    add ebx, 5
    add eax, ebx

By using an IL, we avoid having to first disassemble the stub code before mutating it.

Metamorphism

Today advanced metamorphic malware which can efficiently evade signature detection is nearly impossible, but back in the days of DOS / 95 / 98 viruses, it has been achieved multiple times. The idea of metamorphism is to take polymorphism a step further and instead of encrypting the malicious executable and mutating the stub, the entire malicious executable is mutated, including the code required to perform the mutation. 

Malware that is required to create a new, unique copy of itself on every propagation is also required to disassemble previously mutated code and regulate size (because instructions can be mutated into multiple instructions, it's important to be able to do the opposite or the executable grows almost exponentially with every mutation). Due to the amount of consideration and effort that would have to go into creating modern metamorphic malware, most programmers opt to use polymorphism instead, as this allows them to generate output from a temporary representation. A simple mistake during disassembling could result in the executable ceasing to work, and it's a lot harder to debug and test metamorphism in large applications. 





Social ReaktionenReagiere als Erste:r — dein Feedback zählt!
Informations-Bewertung:
✏️ Information ergänzen
🛡️ Versioniert via CMS-Revisions-Engine (Freigabe-Queue für Gäste)

💬 Community-Diskussion & Kommentare

🌐 Zum Hauptchat

Starte die Diskussion im Social-Chat Broadcast Stream oder reiche oben über „Information ergänzen“ einen Fachbeitrag ein.

🔍 CTI & Forensik

Cyber Threat Intelligence & Forensik

ATT&CK-Navigator · IoC-Radar · Exploit-Belege
MITRE ATT&CK Matrix Navigator
1 belegte Technik
T1071TA0011 · Command and Control
Application Layer Protocol (C2)
Mitigation: M1031 Network Intrusion Prevention & Egress Filtering
Quelle: Kontext-Klassifikation des Artikeltextes · Konfidenz 80%
Egress-Filtering einführen, DNS-Monitoring aufrichten, Netzwerk-Logs nach C2-Beacon-Mustern durchsuchen.
Command and Control
CTI Threat Relationship Graph
Akteure · Techniken · Beziehungen
3 Knoten · 2 Relationen
CVE / Incident Threat Actor Software MITRE ATT&CK CWE Weakness IoC
Security Briefing Kostenlos · 1-Klick-Abmeldung

Intelligence Digest — kostenlos

Täglich die wichtigsten Security-News · jederzeit abbestellbar

Community Rating & Social Proof
⭐ Leser-Wertung
–
Ø / 5.0
Noch keine Leser-Bewertungen
War dieser Artikel hilfreich?
0
Jetzt Bewertung abgeben
Detail-Bewertung (optional)
Inhalt & Qualität
Quelle & Glaubwürdigkeit
Aktualität

Verwandte Story-Cluster & Quellen (Vektor-KI)

6 Cluster
21 Quellen
CVE-2026-90413 | Linux Kernel up to 7.2.5 IB isert isert_login_recv_done dlength out-of-bounds (Nessus ID 385332)
VulDB Updates vor 38 Min.
20 weitere Quellen
VulDB Updatesvor 38 Min.CVE-2026-90414 | Linux Kernel up to 7.2.5 IB/isert ib_isert.c isert_recv_done byte_len out-of-bounds (Nessus ID 385332) VulDB Updatesvor 38 Min.CVE-2026-98549 | Linux Kernel up to 6.12.111/6.18.54/7.2.8/7.3-rc4 TCP SKB Collapse Logic tcp_write_collapse_fence missing encryption (Nessus ID 385332) VulDB Updatesvor 29 Min.CVE-2026-99618 | Linux Kernel up to 6.12.117/6.18.63/7.3.4/7.4-rc1 nvmet information disclosure VulDB Updatesvor 29 Min.CVE-2026-99627 | Linux Kernel up to 6.12.117/6.18.63/7.3.4/7.4-rc1 amdgpu drm/amdgpu/gfx12 gfx_v12_0_update_spm_vmid memory corruption VulDB Updatesvor 29 Min.CVE-2026-99625 | Linux Kernel up to 6.12.117/6.18.63/7.3.4/7.4-rc1 drm amdgpu drm_sched_job_add_dependency privilege escalation VulDB Updatesvor 29 Min.CVE-2026-99602 | Linux Kernel up to 6.12.117/6.18.63/7.3.4/7.4-rc1 UDF udf_table_new_block allocation of resources VulDB Updatesvor 29 Min.CVE-2026-99603 | Linux Kernel up to 6.12.117/6.18.63/7.3.4/7.4-rc1 mptcp mptcp_pm_nl_create_listen_socket race condition VulDB Updatesvor 29 Min.CVE-2026-99611 | Linux Kernel up to 6.12.117/6.18.63/7.3.4/7.4-rc1 line6 line6_capture_copy buffer overflow VulDB Updatesvor 29 Min.CVE-2026-99592 | Linux Kernel up to 6.18.63/7.3.4/7.4-rc1 x86/mm allocate_global_asid race condition VulDB Updatesvor 29 Min.CVE-2026-99601 | Linux Kernel up to 6.12.117/6.18.63/7.3.4/7.4-rc1 udf udf_table_new_block integer overflow VulDB Updatesvor 29 Min.CVE-2026-99609 | Linux Kernel up to 6.12.117/6.18.63/7.3.4/7.4-rc1 ALSA usx2y_urb_capt_retire out-of-bounds VulDB Updatesvor 1 Std.CVE-2026-99580 | Linux Kernel up to 6.12.117/6.18.63/7.3.4 userfaultfd copy_hugetlb_page_range race condition VulDB Updatesvor 1 Std.CVE-2026-99589 | Linux Kernel up to 6.12.117/6.18.63/7.3.4/7.4-rc1 batman-adv batadv_tt_local_add_existing behavioral workflow VulDB Updatesvor 1 Std.CVE-2026-99591 | Linux Kernel up to 6.12.117/6.18.63/7.3.4/7.4-rc2 iommu/amd __reuse_device_table out-of-bounds VulDB Updatesvor 1 Std.CVE-2026-99590 | Linux Kernel up to 6.12.117/6.18.63/7.3.4 Ceph ceph_fill_inline_data out-of-bounds write VulDB Updatesvor 1 Std.CVE-2026-99583 | Linux Kernel up to 6.12.117/6.18.63/7.3.4 sctp sctp_sock_migrate shkey use after free VulDB Updatesvor 1 Std.CVE-2026-99586 | Linux Kernel up to 7.3.4 iommu/arm-smmu-v3 memory corruption VulDB Updatesvor 1 Std.CVE-2026-99567 | Linux Kernel up to 6.12.117/6.18.63/7.3.4 assoc_array assoc_array_insert_into_terminal_node infinite loop VulDB Updatesvor 1 Std.CVE-2026-99582 | Linux Kernel up to 6.12.117/6.18.63/7.3.4 SCTP sctp_sock_migrate use after free VulDB Updatesvor 1 Std.CVE-2026-99574 | Linux Kernel up to 6.12.117/6.18.63/7.3.4 f2fs build_sit_info out-of-bounds
💬 Kommentare werden geladen…
Ähnliche Beiträge
🔍 Verwandte News

Ähnliche Beiträge zu Code Mutation (Polymorphism)

Thematisch verwandte Begriffe: Code, Mutation, Polymorphism · 6 Treffer

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Zum Aktualisieren ziehen
Widgets & Themen
Widgets werden geladen…
Nächster Beitrag