Skip to content

Latest commit

 

History

History
102 lines (56 loc) · 5.14 KB

File metadata and controls

102 lines (56 loc) · 5.14 KB
graph LR
    addPayloadLine["addPayloadLine"]
    _mangleLine["_mangleLine"]
    _mangleInteger["_mangleInteger"]
    _mangleBinary["_mangleBinary"]
    _insertWhitespaceAndRandChars["_insertWhitespaceAndRandChars"]
    _getMangledInteger["_getMangledInteger"]
    _getWhitespaceAndRandChars["_getWhitespaceAndRandChars"]
    _getRandChars["_getRandChars"]
    addPayloadLine -- "calls" --> _mangleLine
    _mangleLine -- "delegates to" --> _mangleInteger
    _mangleLine -- "delegates to" --> _mangleBinary
    _mangleLine -- "calls" --> _insertWhitespaceAndRandChars
    _mangleInteger -- "delegates to" --> _getMangledInteger
    _mangleBinary -- "utilizes" --> _getMangledInteger
    _mangleBinary -- "uses" --> _getRandChars
    _insertWhitespaceAndRandChars -- "relies on" --> _getWhitespaceAndRandChars
    _getWhitespaceAndRandChars -- "uses" --> _getRandChars
Loading

CodeBoardingDemoContact

Details

The Code Mangling Engine subsystem is primarily defined by the mangler.py file located at /mnt/e/StartUp/Bashfuscator/bashfuscator/core/engine/mangler.py. Its core responsibility is the low-level manipulation of obfuscated Bash code, including binary name mangling, random whitespace insertion, and integer transformation into arithmetic expressions, all aimed at increasing complexity and evading detection.

addPayloadLine

The primary entry point for initiating the obfuscation process for a given line of Bash code and integrating the result into the final obfuscated payload. It acts as the initial interface for the mangling operations.

Related Classes/Methods:

_mangleLine

The central orchestrator responsible for applying various low-level obfuscation techniques to a single line of Bash code. It dispatches the line to specialized mangling functions based on the content.

Related Classes/Methods:

_mangleInteger

Manages the transformation of integer literals found within the Bash script into obfuscated arithmetic expressions or other complex forms, making them harder to analyze.

Related Classes/Methods:

_mangleBinary

Handles the obfuscation of binary names (e.g., ls, cat) within the Bash script, often by replacing them with obfuscated equivalents or expressions to obscure their true purpose.

Related Classes/Methods:

_insertWhitespaceAndRandChars

Manages the injection of random whitespace and arbitrary characters into the Bash code. This increases the code's visual complexity and hinders automated parsing and analysis.

Related Classes/Methods:

_getMangledInteger

Implements the detailed logic for various integer obfuscation methods, including base conversions and recursive expansion, providing the actual obfuscated integer strings.

Related Classes/Methods:

_getWhitespaceAndRandChars

Generates the actual random whitespace and character strings that are injected into the Bash code for obfuscation purposes, ensuring variety and unpredictability.

Related Classes/Methods:

_getRandChars

A utility component responsible for providing random character strings of specified lengths, used across various obfuscation techniques to introduce randomness and unpredictability into the output.

Related Classes/Methods: