{"id":14991200,"url":"https://github.com/ropfuscator/ropfuscator","last_synced_at":"2025-04-05T03:12:23.663Z","repository":{"id":143268827,"uuid":"428766351","full_name":"ropfuscator/ropfuscator","owner":"ropfuscator","description":"ROPfuscator is a fine-grained code obfuscation framework for C/C++ programs using ROP (return-oriented programming).","archived":false,"fork":false,"pushed_at":"2024-05-08T20:06:11.000Z","size":3970,"stargazers_count":424,"open_issues_count":1,"forks_count":32,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-03-29T02:07:56.255Z","etag":null,"topics":["clang","compiler","conference-paper","conference-talk","llc","llvm","llvm-pass","obfuscation","opaque-predicates","return-oriented-programming","return-to-libc","security"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ropfuscator.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-11-16T18:13:57.000Z","updated_at":"2025-03-23T17:20:12.000Z","dependencies_parsed_at":"2024-05-08T21:26:18.447Z","dependency_job_id":"5f283d30-edc9-4098-9fb5-b3409c95f1db","html_url":"https://github.com/ropfuscator/ropfuscator","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ropfuscator%2Fropfuscator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ropfuscator%2Fropfuscator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ropfuscator%2Fropfuscator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ropfuscator%2Fropfuscator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ropfuscator","download_url":"https://codeload.github.com/ropfuscator/ropfuscator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247280272,"owners_count":20912967,"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":["clang","compiler","conference-paper","conference-talk","llc","llvm","llvm-pass","obfuscation","opaque-predicates","return-oriented-programming","return-to-libc","security"],"created_at":"2024-09-24T14:21:43.882Z","updated_at":"2025-04-05T03:12:23.637Z","avatar_url":"https://github.com/ropfuscator.png","language":"C++","readme":"# Disclaimer\n \nROPfuscator is a research proof of concept and is not intended for production use. The authors do not take any responsibility or liability for the use of the software. Please exercise caution and use at your own risk.\n\n---\n\n# ROPfuscator [![Build](https://github.com/ropfuscator/ropfuscator/actions/workflows/main.yaml/badge.svg)](https://github.com/ropfuscator/ropfuscator/actions/workflows/main.yaml)\n![logo](./docs/logo.png)\n\nROPfuscator is a fine-grained code obfuscation framework for LLVM-supported languages using ROP (return-oriented programming).\nROPfuscator obfuscates a program at the assembly code level by transforming regular instructions into ROP chains, thwarting our natural conception of normal control flow.\nIt is implemented as an extension to LLVM (10.0.1) x86 backend.\n\nFor build, usage and implementation, see individual documents:\n\n- Building ROPfuscator: [build.md](./docs/build.md)\n- Using ROPfuscator to obfuscate programs: [usage.md](./docs/usage.md)\n- Obfuscation algorithm details: [algorithm.md](./docs/algorithm.md)\n- Implementation details: [implementation.md](./docs/implementation.md)\n\n## Research Paper\n\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e\n     \u003cimg src=\"https://github.com/ropfuscator/ropfuscator/assets/6033387/7b6723e4-65d7-49cd-862f-45809be3c867\"\u003e\n     \u003cbr\u003e\n     \u003ca href=\"https://wootconference.org/papers/woot23-paper4.pdf\"\u003eRead the paper here\u003c/a\u003e\n   \u003c/td\u003e\n    \u003ctd\u003e\n     \n    @inproceedings{depasquale2023ropfuscator,\n      title={ROPfuscator: Robust Obfuscation with ROP},\n      author={De Pasquale, Giulio and Nakanishi, Fukutomo and Ferla, Daniele and Cavallaro, Lorenzo},\n      booktitle={2023 IEEE Security and Privacy Workshops (SPW)},\n      pages={1--10},\n      year={2023},\n      organization={IEEE}\n    }\n    \n   \u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n---\n\n## Key Improvements\n\nThis project aims to provide an improved version of ROPfuscator with a strong focus on reproducibility and ease of integration. We have made several key enhancements in this repository, as outlined below.\n\n### Nix Package Manager\n\nROPfuscator now leverages [Nix](https://nixos.org/), a powerful declarative package manager that allows for reliable and reproducible builds. Nix provides several benefits:\n\n- Ensures dependencies and build environments are consistent across systems.\n- Allows for isolated build environments, eliminating conflicts with other installed packages.\n- Supports rollbacks to previous package versions, making it easier to recover from failed updates.\n\nROPfuscator provides a Nix flake exposing ROPfuscator's `stdenv`s and various helper functions used to natively compile Nix derivations, without applying any modification to the build system of the project to be built. \n\n### Evaluation Process\n\nThe evaluation process has been rewritten from scratch, taking full advantage of the Nix package manager. This ensures a more reliable and transparent evaluation, which will be the foundation for future work on ROPfuscator.\n\n### Transparent Obfuscation for Upstream Nix Packages\n\nROPfuscator can now transparently attempt to obfuscate _any_ package present in the upstream Nix package repository, [nixpkgs](https://github.com/NixOS/nixpkgs), without requiring any modifications. This allows Nix users to seamlessly integrate ROPfuscator into their existing workflows and test its capabilities.\n\nROPfuscator can target a single project, obfuscating only the object files pertinent to the project itself, or it can obfuscate the target along with all its dependencies.\n\n---\n\n## Get started\n\n### Using Nix (recommended)\n\n#### Step 0: Install Nix\n\nInstall [Nix](https://nix.dev/tutorials/install-nix) (the package manager) and make sure that its daemon is running.\n\n#### Step 1: Enable Nix to use Flakes\n\nFlakes allow you to specify your code's dependencies in a declarative way and they allow to easily specify inputs and outputs for projects. ROPfuscator exposes different outputs hence we need to enable Nix to use flakes.\n\n[Here](https://wiki.nixos.org/wiki/Flakes) is a step-by-step process on how to enable them.\n\n#### Step 2: Add ROPfuscator cache repository to Nix's channels (optional) \n\nThis step allows leveraging ROPfuscator's cache repository to avoid recompiling the project and all its dependencies from scratch. This step is optional but recommended.\n\nTo enable ROPfuscator's cache, first install `cachix`:\n\n```\nnix-env -iA cachix -f https://cachix.org/api/v1/install\n```\n\nThen, configure `nix.conf` to use the binary cache:\n\n```\ncachix use ropfuscator\n```\n\n#### Step 3: Build and use ROPfuscator\n\nThe final step is to build ROPfuscator. This can be achieved by invoking:\n\n```\nnix build github:ropfuscator/ropfuscator -L\n```\n\nIf you want to drop in a shell configured to use ROPfuscator by default, just invoke:\n\n```\nnix shell github:ropfuscator/ropfuscator\n```\n\nROPfuscator can be used to obfuscate packages that are present in the Nixpkgs repository. Currently, we are using a custom fork because some upstream packages were not properly configured for cross-compilation. Although we have already submitted some of the patches upstream, there is still some work to be done for a seamless experience.\n\nTo get started, follow the first two steps listed above and install Nix. Then, copy `flake-example.nix` into a directory, renaming it to `flake.nix`:\n\n```bash\n mkdir -p ropfuscator-example \u0026\u0026 cd ropfuscator-example\n cp ../flake-example.nix flake.nix\n```\n\nAt this point, you can build the two packages defined in the flake: `hello` and `obfuscatedHello`.\n\nTo build `obfuscatedHello`, use:\n\n```bash\n nix build .#obfuscatedHello -L\n```\n\nSimilarly, to build `hello` run:\n\n```\n nix build .#hello -L\n```\n---\n\n## ROPfuscator Overview\n\n![architecture](./docs/architecture.svg)\n\nWe combine the following obfuscation layers to achieve robust obfuscation against several attacks.\n\n- ROP Transformation\n  - Convert each instruction into one or more ROP gadgets, and translate the entire code to ROP chains.\n- Opaque Predicate Insertion\n  - Translate ROP gadget address(es) and stack pushed values into opaque constants, which are composition of multiple opaque predicates.\n \n## Configurations\n\nROPfuscator can be configured through TOML configuration files. [This repository](https://github.com/ropfuscator/utilities/tree/master/configs) includes the following pre-made configurations:\n\n - **ROP Only**: does not obfuscate gadget addresses, stack values, immediate operands, or branch targets, and does not use opaque predicates.\n - **All Addresses**: obfuscates all gadget addresses and uses opaque predicates for all opaque constants.\n - **Half addresses**: obfuscates 50% of gadget addresses and uses opaque predicates for all opaque constants.\n - **Full**: obfuscates all gadget addresses, stack values, immediate operands, and branch targets, and uses opaque predicates for all opaque constants.\n\nEach configuration can be further customized with the options available in the configuration table in the [README](https://github.com/ropfuscator/utilities/tree/master/configs).\n\n## Limitations\n\n- Linux 32-bit x86 binaries are the only supported target (as of now)\n- For detailed limitations, see [limitation.md](./docs/limitation.md).\n\n## Interested in working on ROPfuscator?\n\nWe encourage collaboration and are open to discussing potential extensions or improvements to the project. If you are interested in contributing, please reach out to us or open an issue.\n\nThank you for your support!\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fropfuscator%2Fropfuscator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fropfuscator%2Fropfuscator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fropfuscator%2Fropfuscator/lists"}