{"id":13630339,"url":"https://github.com/optiv/Mangle","last_synced_at":"2025-04-17T13:32:18.376Z","repository":{"id":37881102,"uuid":"505984181","full_name":"optiv/Mangle","owner":"optiv","description":"Mangle is a tool that manipulates aspects of compiled executables (.exe or DLL) to avoid detection from EDRs","archived":true,"fork":false,"pushed_at":"2023-08-18T17:36:36.000Z","size":32325,"stargazers_count":1187,"open_issues_count":3,"forks_count":158,"subscribers_count":28,"default_branch":"main","last_synced_at":"2025-03-22T13:11:28.762Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/optiv.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2022-06-21T19:50:36.000Z","updated_at":"2025-03-20T07:39:44.000Z","dependencies_parsed_at":"2024-01-14T06:56:46.524Z","dependency_job_id":null,"html_url":"https://github.com/optiv/Mangle","commit_stats":{"total_commits":5,"total_committers":1,"mean_commits":5.0,"dds":0.0,"last_synced_commit":"32bf6837192b58508b614a9f25329560b5da4df4"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/optiv%2FMangle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/optiv%2FMangle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/optiv%2FMangle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/optiv%2FMangle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/optiv","download_url":"https://codeload.github.com/optiv/Mangle/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249344844,"owners_count":21254748,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T22:01:39.321Z","updated_at":"2025-04-17T13:32:18.368Z","avatar_url":"https://github.com/optiv.png","language":"Go","readme":"# THIS REPOSITORY HAS BEEN ARCHIVED\n\nTo view the latest version of Mangle or to submit an issue, reference https://github.com/Tylous/Mangle.\n\n\n# Mangle\n\n\n\n\n\u003cp align=\"center\"\u003e \u003cimg src=Screenshots/logo.png\u003e\n\n\u003cp align=\"center\"\u003e \u003cb\u003eAuthored By Tyl0us\u003c/b\u003e\n\n\n\u003cp align=\"left\"\u003e\u003cb\u003eFeatured at Source Zero Con 2022\u003c/b\u003e\n\nMangle is a tool that manipulates aspects of compiled executables (.exe or DLL). Mangle can remove known Indicators of Compromise (IoC) based strings and replace them with random characters, change the file by inflating the size to avoid EDRs, and can clone code-signing certs from legitimate files. In doing so, Mangle helps loaders evade on-disk and in-memory scanners.\n\n## Contributing\nMangle was developed in Golang.\n\n## Install\n\nThe first step, as always, is to clone the repo. Before you compile Mangle, you'll need to install the dependencies. To install them, run the following commands:\n\n```\ngo get github.com/Binject/debug/pe\n```\n\nThen build it\n\n```\ngo build Mangle.go\n```\n\n## Important \nWhile Mangle is written in Golang, a lot of the features are designed to work on executable files from other languages. At the time of release, the only feature that is Golang specific is the string manipulation part.\n\n## Usage\n\n```\n./mangle -h\n\n\t   _____                        .__\n\t  /     \\ _____    ____    ____ |  |   ____\n\t /  \\ /  \\\\__  \\  /    \\  / ___\\|  | _/ __ \\\n\t/    Y    \\/ __ \\|   |  \\/ /_/  \u003e  |_\\  ___/\n\t\\____|__  (____  /___|  /\\___  /|____/\\___  \u003e\n\t\t\\/     \\/     \\//_____/   \t  \\/\n\t\t\t\t\t(@Tyl0us)\nUsage of ./Mangle:\n  -C string\n        Path to the file containing the certificate you want to clone\n  -I string\n        Path to the orginal file\n  -M    Edit the PE file to strip out Go indicators\n  -O string\n        The new file name\n  -S int\n        How many MBs to increase the file by\n\n```\n## Strings\n\nMangle takes the input executable and looks for known strings that security products look for or alert on. These strings alone are not the sole point of detection. Often, these strings are in conjunction with other data points and pieces of telemetry for detection and prevention. Mangle finds these known strings and replaces the hex values with random ones to remove them. IMPORTANT: Mangle replaces the exact size of the strings it’s manipulating. It doesn’t add any more or any less, as this would create misalignments and instabilities in the file. Mangle does this using the `-M` command-line option.\n\nCurrently, Mangle only does Golang files but as time goes on other languages will be added. If you know of any for other languages, please open an issue ticket and submit them.\n\n\n\u003cp align=\"center\"\u003e\u003cb\u003eBefore\u003c/b\u003e\n\u003cp align=\"center\"\u003e \u003cimg src=Screenshots/Strings_Before.png border=\"2px solid #555\"\u003e\n\n\u003cp align=\"center\"\u003e\u003cb\u003eAfter\u003c/b\u003e\n\u003cp align=\"center\"\u003e \u003cimg src=Screenshots/Strings_After.png border=\"2px solid #555\"\u003e\n\n\n\n\n## Inflate\n\n\nPretty much all EDRs can’t scan both on disk or in memory files beyond a certain size. This simply stems from the fact that large files take longer to review, scan, or monitor. EDRs do not want to impact performance by slowing down the user's productivity. Mangle inflates files by creating a padding of Null bytes (Zeros) at the end of the file. This ensures that nothing inside the file is impacted. To inflate an executable, use the `-S` command-line option along with the number of bytes you want to add to the file. Large payloads are really not an issue anymore with how fast Internet speeds are, that being said, it's not recommended to make a 2 gig file.\n\n\n\nBased on test cases across numerous userland and kernel EDRs, it is recommended to increase the size by either 95-100 megabytes. Because vendors do not check large files, the activity goes unnoticed, resulting in the successful execution of shellcode.\n\n### Example: \n\u003cimg src=\"Screenshots/Demo.gif\"/\u003e\n\n\n\n## Certificate\n\n\nMangle also contains the ability to take the full chain and all attributes from a legitimate code-signing certificate from a file and copy it onto another file. This includes the signing date, counter signatures, and other measurable attributes.\n\nWhile this feature may sound similar to another tool I developed, [Limelighter](https://github.com/Tylous/Limelighter), the major difference between the two is that Limelighter makes a fake certificate based off a domain and signs it with the current date and time, versus using valid attributes where the timestamp is taken from when the original file. This option can use DLL or .exe files to copy using the `-C` command-line option, along with the path to the file you want to copy the certificate from.\n\n\n\u003cp align=\"center\"\u003e \u003cimg src=Screenshots/Cert_Copy.png border=\"2px solid #555\"\u003e\n\n## Credit\n* Special thanks to Jessica of SuperNovasStore for creating the logo.\n* Special thanks to Binject for his [repo](https://github.com/Binject/debug)\n","funding_links":[],"categories":["Go","其他_安全与渗透"],"sub_categories":["网络服务_其他"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foptiv%2FMangle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foptiv%2FMangle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foptiv%2FMangle/lists"}