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: Analisi video
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)

💬 Discussione della community e commenti

🌐 Entra nella chat principale

Avvia la discussione nel flusso broadcast della Social Chat oppure invia qui sopra un contributo esperto tramite il modulo di integrazione.

🔍 CTI & Forensik

Cyber Threat Intelligence e Forense

Navigatore ATT&CK · Radar IoC · Evidenze Exploit
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%
Introdurre l’egress filtering, istituire il monitoraggio DNS, cercare pattern di beacon C2 nei log di rete.
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
Briefing di sicurezza Gratuito · disdetta in 1 clic

Intelligence Digest — gratuito

Ogni giorno le notizie di sicurezza più importanti · annullabile in qualsiasi momento

Valutazione della community & prova sociale
⭐ Giudizio dei lettori
–
Ø / 5.0
Ancora nessuna valutazione dei lettori
Questo articolo ti è stato utile?
0
Lascia ora la tua valutazione
Valutazione dettagliata (facoltativa)
Contenuto & qualità
Fonte & credibilità
Attualità

Cluster di storie correlate & fonti (IA vettoriale)

6 Cluster
18 fonti
CVE-2026-92730 | LimeSurvey 7.0.14 CSV Import cross site scripting
VulDB Updates 34 min. fa
17 altre fonti
VulDB Updates34 min. faCVE-2026-91775 | LimeSurvey 7.0.14 Administrative Interface cross site scripting VulDB Updates1 h faCVE-2026-129381 | Joomla! Project Joomla Extension up to 5.4.10/6.2.0 Install From Web cross-site request forgery (EUVD-2026-134293) VulDB Updates1 h faCVE-2026-127299 | Joomla! Project Joomla Extension up to 1.6.0/5.4.10/6.0.0/6.2.0 com_newsfeeds name cross site scripting (EUVD-2026-134290) VulDB Updates52 min. faCVE-2026-127300 | Joomla! Project Joomla CMS Extension 4.3.0-5.4.10/6.0.0-6.2.0 com_guidedtours cross site scripting (EUVD-2026-134285) VulDB Updates52 min. faCVE-2026-129389 | Joomla! Project Joomla Extension up to 3.8.3/5.4.10/6.0.0/6.2.0 Wrapper cross site scripting (EUVD-2026-134283) VulDB Updates1 h faCVE-2026-127298 | Joomla! Project Joomla Extension up to 1.6.0/5.4.10/6.0.0/6.2.0 com_contact name cross site scripting (EUVD-2026-134302) VulDB Updates1 h faCVE-2026-129368 | Joomla Extension 1.6.0-5.4.10/6.0.0-6.2.0 Banner cross site scripting (EUVD-2026-134300) VulDB Updates1 h faCVE-2026-127304 | Joomla Extension 3.9.0-5.4.10/6.0.0-6.2.0 Custom Fields showon cross site scripting (EUVD-2026-134299) VulDB Updates1 h faCVE-2026-129365 | Joomla! Project Joomla Extension up to 2.5.10/5.4.10/6.0.0/6.2.0 com_installer cross site scripting (EUVD-2026-134296) VulDB Updates1 h faCVE-2022-4602 | Shoplazza LifeStyle 1.1 Review Flow /admin/api/theme-edit/ Title cross site scripting (EUVD-2022-51934) VulDB Updates1 h faCVE-2022-4601 | Shoplazza LifeStyle 1.1 Shipping/Member Discount/Icon /admin/api/theme-edit/ cross site scripting (EUVD-2022-51933) VulDB Updates1 h faCVE-2022-4605 | flatpress up to 1.2 cross site scripting (EUVD-2022-51937) VulDB Updates1 h faCVE-2022-4604 | wp-english-wp-admin Plugin up to 1.5.1 on WordPress english-wp-admin.php register_endpoints cross-site request forgery (EUVD-2022-51936) VulDB Updates2 h faCVE-2022-4597 | Shoplazza LifeStyle 1.1 Create Product v2_products cross site scripting (EUVD-2022-51929) VulDB Updates2 h faCVE-2022-4600 | Shoplazza LifeStyle 1.1 Product Carousel /admin/api/theme-edit/ Heading/Description cross site scripting (EUVD-2022-51932) VulDB Updates2 h faCVE-2022-4599 | Shoplazza LifeStyle 1.1 Product /admin/api/theme-edit/ Subheading/Heading/Text/Button Text/Label cross site scripting (EUVD-2022-51931) VulDB Updates2 h faCVE-2022-4598 | Shoplazza LifeStyle 1.1 Announcement /admin/api/theme-edit/ Text/Mobile Text cross site scripting (EUVD-2022-51930)
15 fonti
Black Friday motherboard deals: 3 Newegg Z890 and B850 boards I’d actually buy — from $140
Latest from TechRadar 18 min. fa
14 altre fonti
CNET21 giorni faBlack Friday Laptop Deals Are Live: Save Hundreds on Top Models From Apple, Dell, HP and More CNET34 min. faSave $50 on This Lavazza Espresso Machine With a Black Friday Deal Bringing it to Its Lowest Price Ever AppleInsider News20 min. faApple's brand-new M6 iMac is already up to $111 off for Black Friday Latest from TechRadar51 min. faSquare POS Black Friday deals: save up to $291 on three small business systems at Best Buy CNET1 h faBest Buy Is Dropping the Nothing Headphone (a) by $90 for Black Friday Latest from TechRadar1 h faGet a serious creative upgrade with the 4.5-star Alienware Aurora desktop — now with $100 off at Amazon for Black Friday heise online News1 h faBlack-Friday-Deals: PC-Monitore in der Black Week günstig ergattern Latest from TechRadar1 h faDell XPS 13 Black Friday deal: Dell’s MacBook Neo rival drops to $550 AppleInsider News2 h faDisney Plus, Hulu bundle drops to $4.99/mo for 1 year with Black Friday deal CNET1 anno faThe Robot Vacuum That Took Over My Cleaning Routine Is $200 Off for Black Friday CNET5 mesi faThe Proton Pass Plus Password Manager Is Just $1.99 a Month This Black Friday Latest from Windows Central2 h fa4 GEEKOM mini PC deals worth buying this Black Friday eSecurityPlanet3 h faAI-Powered Black Friday Scams Raise Enterprise Security Risks Latest from TechRadar2 h fa'A Thunderbolt 5 docking station with more ports and features than you'll know what to do with': Connect everything with the feature-packed Ugreen Maxidok 17-in-1 Dock on sale for Black Friday
13 fonti
CVE-2026-129373 | Joomla! Project Joomla Extension 1.6.0-5.4.10/6.0.0-6.2.0 Password Reset session expiration (EUVD-2026-134294)
VulDB Updates 1 h fa
12 altre fonti
VulDB Updates1 h faCVE-2026-129385 | Joomla! Project Joomla! Extension 4.0.0-5.4.10/6.0.0-6.2.0 Mail Template information disclosure (EUVD-2026-134295) VulDB Updates1 h faCVE-2026-123210 | Joomla! Project Joomla Extension 4.0.0-5.4.10/6.0.0-6.2.0 com_media input validation (EUVD-2026-134291) VulDB Updates52 min. faCVE-2026-126045 | Joomla! Project Joomla Extension up to 1.6.0/5.4.10/6.0.0/6.2.0 Language Parameter language file inclusion (EUVD-2026-134289) VulDB Updates52 min. faCVE-2026-129387 | Joomla! Project Joomla! CMS Extension 4.0.0-5.4.10/6.0.0-6.2.0 com_menus privileges management (EUVD-2026-134288) VulDB Updates52 min. faCVE-2026-127295 | Joomla! Project Joomla Extension 4.0.0-5.4.10/6.0.0-6.2.0 Webservice Endpoints permission (EUVD-2026-134286) VulDB Updates52 min. faCVE-2026-129383 | Joomla! Project Joomla Extension 6.2.0 SMTP OAuth2 Settings information disclosure (EUVD-2026-134287) VulDB Updates52 min. faCVE-2026-129382 | Joomla! Project Joomla Extension up to 5.4.10/6.2.0 com_media permission (EUVD-2026-134284) VulDB Updates52 min. faCVE-2026-127297 | Joomla! Project Joomla 3.6.0-5.4.10/6.0.0-6.2.0 Formatted Text Logger race condition (EUVD-2026-134282) VulDB Updates52 min. faCVE-2026-127296 | Joomla! Project Joomla CMS Extension 4.0.0-5.4.10/6.0.0-6.2.0 com_config information disclosure (EUVD-2026-134281) VulDB Updates1 h faCVE-2026-129386 | Joomla! Project Joomla Extension 1.6.0-5.4.10/6.0.0-6.2.0 com_contact privileges management (EUVD-2026-134301) VulDB Updates1 h faCVE-2026-129388 | Joomla! Project Joomla! Extension 4.0.0-5.4.10/6.0.0-6.2.0 com_media path traversal (EUVD-2026-134298) VulDB Updates1 h faCVE-2026-123214 | Joomla! Project Joomla Extension 4.0.0-5.4.10/6.0.0-6.2.0 Web Installer missing authentication (EUVD-2026-134297)
💬 Caricamento dei commenti…
Articoli simili
🔍 Verwandte News

Ähnliche Beiträge zu Code Mutation (Polymorphism)

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

Laden...

Caricamento degli articoli ...

Laden...

Caricamento dei video ...

Laden...

Caricamento degli articoli ...

Laden...

Caricamento dei video ...

Laden...

Caricamento degli articoli ...

Laden...

Caricamento dei video ...

Trascina per aggiornare
Widgets & Topics
Loading widgets…
Nächster Beitrag