{"id":17383757,"url":"https://github.com/stackoverflowexcept1on/shellexec","last_synced_at":"2025-04-15T10:06:49.180Z","repository":{"id":65012121,"uuid":"579002628","full_name":"StackOverflowExcept1on/shellexec","owner":"StackOverflowExcept1on","description":"Executes machine code from a binary file in rwx memory","archived":false,"fork":false,"pushed_at":"2024-09-08T21:28:48.000Z","size":23,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-15T10:06:14.731Z","etag":null,"topics":["linux","reverse-engineering","rust","shellcode-loader","virtual-memory","windows"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/StackOverflowExcept1on.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2022-12-16T12:16:36.000Z","updated_at":"2025-02-02T16:59:22.000Z","dependencies_parsed_at":"2024-09-08T22:44:37.025Z","dependency_job_id":null,"html_url":"https://github.com/StackOverflowExcept1on/shellexec","commit_stats":{"total_commits":8,"total_committers":1,"mean_commits":8.0,"dds":0.0,"last_synced_commit":"1bd4f44fa7f595f84b8214a52616cb86a3d7999c"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StackOverflowExcept1on%2Fshellexec","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StackOverflowExcept1on%2Fshellexec/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StackOverflowExcept1on%2Fshellexec/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StackOverflowExcept1on%2Fshellexec/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/StackOverflowExcept1on","download_url":"https://codeload.github.com/StackOverflowExcept1on/shellexec/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249048738,"owners_count":21204306,"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":["linux","reverse-engineering","rust","shellcode-loader","virtual-memory","windows"],"created_at":"2024-10-16T07:43:41.438Z","updated_at":"2025-04-15T10:06:49.157Z","avatar_url":"https://github.com/StackOverflowExcept1on.png","language":"Rust","readme":"### shellexec\n\n[![Build Status](https://github.com/StackOverflowExcept1on/shellexec/workflows/CI/badge.svg)](https://github.com/StackOverflowExcept1on/shellexec/actions)\n[![Latest Version](https://img.shields.io/crates/v/shellexec.svg)](https://crates.io/crates/shellexec)\n\nCross-platform shellcode executor in rwx memory\n\n```\nUsage: shellexec \u003cbinary\u003e\n\nExecutes shellcode\n\nPositional Arguments:\n  binary            path to binary file\n\nOptions:\n  --help            display usage information\n```\n\n### Implementation\n\n[virtual-memory](https://github.com/StackOverflowExcept1on/shellexec/blob/master/virtual-memory/src/lib.rs) is used to execute shellcode.\nThis helper crates allocates rwx memory using the system functions that is described here:\n\n- Unix\n    - [`mmap(NULL, len, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE | MAP_ANON, -1, 0)`](https://man7.org/linux/man-pages/man2/mmap.2.html)\n    - [`munmap(addr, len)`](https://man7.org/linux/man-pages/man2/munmap.2.html)\n\n- Windows\n    - [`VirtualAlloc(NULL, len, MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE)`](https://learn.microsoft.com/en-us/windows/win32/api/memoryapi/nf-memoryapi-virtualalloc)\n    - [`VirtualFree(addr, 0, MEM_RELEASE)`](https://learn.microsoft.com/en-us/windows/win32/api/memoryapi/nf-memoryapi-virtualfree)\n\nThen the contents of the file are copied into this memory,\nthe address of this memory is converted into a function and called\n\n### Installing from [crates.io](https://crates.io/crates/shellexec)\n\n```\ncargo install shellexec\n```\n\n### Building\n\n```bash\ncargo build --release\n```\n\n### Usage\n\n```bash\n# linux\ncargo run --release -- shellexec/test_input/linux\n\n# windows\ncargo run --release -- shellexec/test_input/windows\n\n# output\nhello from shellcode!\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstackoverflowexcept1on%2Fshellexec","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstackoverflowexcept1on%2Fshellexec","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstackoverflowexcept1on%2Fshellexec/lists"}