{"id":20563722,"url":"https://github.com/trustedsec/elfloader","last_synced_at":"2025-04-10T02:21:25.736Z","repository":{"id":37759752,"uuid":"485918263","full_name":"trustedsec/ELFLoader","owner":"trustedsec","description":null,"archived":false,"fork":false,"pushed_at":"2022-05-16T17:48:40.000Z","size":43,"stargazers_count":267,"open_issues_count":1,"forks_count":45,"subscribers_count":11,"default_branch":"main","last_synced_at":"2025-04-02T18:53:50.207Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/trustedsec.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-04-26T19:18:20.000Z","updated_at":"2025-04-01T21:06:23.000Z","dependencies_parsed_at":"2022-08-08T21:31:12.519Z","dependency_job_id":null,"html_url":"https://github.com/trustedsec/ELFLoader","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trustedsec%2FELFLoader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trustedsec%2FELFLoader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trustedsec%2FELFLoader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trustedsec%2FELFLoader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/trustedsec","download_url":"https://codeload.github.com/trustedsec/ELFLoader/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248143112,"owners_count":21054709,"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-11-16T04:20:28.258Z","updated_at":"2025-04-10T02:21:25.713Z","avatar_url":"https://github.com/trustedsec.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ELFLoader\n\nThis is a ELF object in memory loader/runner. The goal is to create a single \nelf loader that can be used to run follow on capabilities across all x86_64 and x86 nix operating systems.\n\n## How it works\nThe way this loader works is that it has all the code needed to build and load\nan ELF object for the OS its been compiled for, anything that gets sent to it\nthat isn't an elf file, isn't for the right arch, or if it links to something \nthat can't be resolved it ends up exiting out without attempting to run.\n\n## Resolving Symbols\nA key difference between the COFFLoader and this is that it uses the standard\ndefinitions from the OS's libc instead of having to redefine every function used.\n\n## Project Layout\n\n``` sh\n.\n├── includes\n│   ├── beacon_api.h\n│   ├── beacon_compatibility.h\n│   ├── debug.h\n│   ├── ELFLoader.h\n│   └── minimal_elf.h\n├── Makefile\n├── README.md\n├── SA\n│   └── src\n│       ├── cat.c\n│       ├── chmod.c\n│       ├── env.c\n│       ├── find.c\n│       ├── grep.c\n│       ├── id.c\n│       ├── ifconfig.c\n│       ├── pwd.c\n│       ├── tasklist.c\n│       ├── uname.c\n│       ├── walk.c\n│       └── whoami.c\n├── Scripts\n│   └── beacon_generate.py\n├── src\n│   ├── beacon_compatibility.c\n│   └── ELFLoader.c\n└── testobjects\n    ├── getuid.c\n    ├── test2.c\n    ├── test2_duplicatetext.c\n    └── test.c\n\n6 directories, 26 files\n```\n\n## Examples \n\n### Example of find.o\nGenerate to cat the files found, replacement for `find /etc/ -iname *release -exec cat {} \\;`\nor `cat /etc/*release*`\n\n```\nBeacon\u003ereset\nBeacon\u003eaddString /etc\nBeacon\u003eaddString release\nBeacon\u003eaddString\nBeacon\u003eaddint 1\nBeacon\u003eaddint 1\nBeacon\u003eaddint 1\nBeacon\u003egenerate\nb'26000000050000002f657463000800000072656c65617365000100000000010000000100000001000000'\n```\n\n```\n./ELFLoader.out ./SA/src/find.o 26000000050000002f657463000800000072656c65617365000100000000010000000100000001000000\n```\n\n### Example of grep.o\nGenerate to list all files with rwx memory permissions in /proc.\n\n```\nBeacon\u003ereset\nBeacon\u003eaddString /proc\nBeacon\u003eaddString rwx\nBeacon\u003eaddString maps\nBeacon\u003eaddint 1\nBeacon\u003eaddint 0\nBeacon\u003eaddint 0\nBeacon\u003egenerate\nb'27000000060000002f70726f63000400000072777800050000006d61707300010000000000000000000000'\n```\n\n```\n./ELFLoader.out ./SA/src/grep.o 27000000060000002f70726f63000400000072777800050000006d61707300010000000000000000000000\n```\n\n### Example of chmod\nGenerate the arguments for `chmod 777 /tmp/test.sh`.\n\n```\nBeacon\u003ereset\nBeacon\u003eaddString 777\nBeacon\u003eaddString /tmp/test.sh\nBeacon\u003egenerate\nb'1900000004000000373737000d0000002f746d702f746573742e736800'\n```\n\n```\n./ELFLoader.out ./SA/src/chmod.o 1900000004000000373737000d0000002f746d702f746573742e736800\n```\n\n### Example of uname\nThis is the generic example that doesn't take any arguments.\n\n```\n./ELFLoader.out SA/src/uname.o\n```\n\n### Runner and Library Example\n\n```\nmake x86_64so\nmake x86_64runner\nLD_LIBRARY_PATH=. ./runner.out ./SA/src/env.o\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrustedsec%2Felfloader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftrustedsec%2Felfloader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrustedsec%2Felfloader/lists"}