{"id":14637777,"url":"https://github.com/berryalen02/PECracker","last_synced_at":"2025-09-07T05:32:59.531Z","repository":{"id":252718255,"uuid":"841235983","full_name":"berryalen02/PECracker","owner":"berryalen02","description":"针对PE文件的分离的攻防对抗工具，红队、研究者的好帮手。目前支持文件头伪装、证书区段感染。A no-kill confrontation tool for the separation of PE files, a good helper for red teams and researchers. Currently, file header spoofing and certificate segment infection are supported.","archived":false,"fork":false,"pushed_at":"2024-08-20T00:49:37.000Z","size":9419,"stargazers_count":242,"open_issues_count":0,"forks_count":26,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-01-02T10:37:38.229Z","etag":null,"topics":["opsec","opsectoolkit","security"],"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/berryalen02.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":"2024-08-12T01:56:19.000Z","updated_at":"2024-12-18T02:33:44.000Z","dependencies_parsed_at":"2025-01-02T10:35:00.732Z","dependency_job_id":"57ab28df-6e2e-4de6-a09c-932609fcf0f7","html_url":"https://github.com/berryalen02/PECracker","commit_stats":null,"previous_names":["berryalen02/peheaderreplacer","berryalen02/pecracker"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/berryalen02/PECracker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/berryalen02%2FPECracker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/berryalen02%2FPECracker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/berryalen02%2FPECracker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/berryalen02%2FPECracker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/berryalen02","download_url":"https://codeload.github.com/berryalen02/PECracker/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/berryalen02%2FPECracker/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273997193,"owners_count":25204496,"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","status":"online","status_checked_at":"2025-09-07T02:00:09.463Z","response_time":67,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["opsec","opsectoolkit","security"],"created_at":"2024-09-10T02:01:15.690Z","updated_at":"2025-09-07T05:32:58.780Z","avatar_url":"https://github.com/berryalen02.png","language":"Go","funding_links":[],"categories":["Go","红队\u0026渗透测试"],"sub_categories":[],"readme":"# 前言\n\n项目的定位：红队人员的PE对抗辅助工具，具体的对抗思路，就仰仗各位大佬的脑洞了。也欢迎提issue，丰富工具功能。\n\n(为了更好的免杀性能，后续会酌情开源)\n\n对于PE头的一些变形技术都比较老了，这次的学习与实践主要是某APT样本用了这保持签名有效的技术，并且支持shellcode的隐藏与识别，可以深挖的花样会很多。\n\n利用哈希校验漏洞感染文件同时不影响签名有效性的POC，在21年就已经披露了，公开利用主要是[SigFlip](https://github.com/med0x2e/SigFlip)\n这个项目。老POC是一体化的loader，我实现了分离的PE修改工具，定制化程度更高，用起来更方便。后续会持续更新深度的攻防对抗。\n\n后续希望把对于PE文件的利用手法都整合到项目中，因此将项目命名为PECracker。\n\n# 使用方法\n\n感染文件后的效果：签名正常的文件拥有一切原有功能，携带恶意的数据。恶意数据不会执行，需要自己编写loader提取以执行。(以后更新，最近忙)\n\n目前实现了文件头伪装(暴力不优雅版)和证书区段数据嵌入，后续继续更新\n\n```\n.\\PECracker.exe\n (\n )\\ )      (                   )\n(()/((     )\\  (      )     ( /(   (  (\n /(_))\\  (((_) )(  ( /(  (  )\\()) ))\\ )(\n(_))((_) )\\___(()\\ )(_)) )\\((_)\\ /((_|()\\\n| _ \\ __((/ __|((_|(_)_ ((_) |(_|_))  ((_)\n|  _/ _| | (__| '_/ _` / _|| / // -_)| '_|\n|_| |___| \\___|_| \\__,_\\__||_\\_\\\\___||_|\n\nwritten by https://github.com/berryalen02/PECracker\nUsage:\n  PECracker.exe [command]\n\nAvailable Commands:\n  crack       文件头证书区段感染\n  help        Help about any command\n  replace     文件头替换伪装\n\nFlags:\n  -h, --help   help for PECracker.exe\n```\n\n文件头替换\n\n```\nPECracker.exe replace extract [PE file] [output] [flags]\nPECracker.exe replace import [HeaderFile] [target] [flags]\n```\n\n证书区段数据嵌入\n\n```\nPECracker.exe crack inject [PeFile] [output] [ShellcodeFile] [flags]\n```\n\n自定义标注数据\n\n```\n.\\PECracker.exe crack inject QQMusic.exe test.exe calc.bin --embedData 0xdeadbeefdeadbeef --embedSize 8\n (\n )\\ )      (                   )\n(()/((     )\\  (      )     ( /(   (  (\n /(_))\\  (((_) )(  ( /(  (  )\\()) ))\\ )(\n(_))((_) )\\___(()\\ )(_)) )\\((_)\\ /((_|()\\\n| _ \\ __((/ __|((_|(_)_ ((_) |(_|_))  ((_)\n|  _/ _| | (__| '_/ _` / _|| / // -_)| '_|\n|_| |___| \\___|_| \\__,_\\__||_\\_\\\\___||_|\n\nwritten by https://github.com/berryalen02/PECracker\n[*] size of shellcode: 276\n[*] PE文件修改成功\n```\n\n# TODO\n\n- [x] 文件头伪装(暴力替换不优雅版)\n- [x] 证书区段数据嵌入\n  - [x] 自定义标注数据内容、长度\n- [ ] 节表段空闲空间数据隐藏\n- [ ] patch(以及自动化的探索与对抗)\n- [ ] .......\n\n# 效果\n\n以下测试均采用最简单的msf生成的calc.bin，无混淆\n\n![](./images/PECracker1.gif)\n感染PE文件后不影响执行\n![](./images/PECracker2.gif)\n360和wdf无检出\n![](./images/PECracker6.png)\n传了几个沙箱\n![](./images/PECracker3.png)\n![](./images/PECracker4.png)\n![](./images/PECracker5.png)\n\n# Star History\n\n\u003ca href=\"https://star-history.com/#berryalen02/PECracker\u0026Date\"\u003e\n \u003cpicture\u003e\n   \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://api.star-history.com/svg?repos=berryalen02/PECracker\u0026type=Date\u0026theme=dark\" /\u003e\n   \u003csource media=\"(prefers-color-scheme: light)\" srcset=\"https://api.star-history.com/svg?repos=berryalen02/PECracker\u0026type=Date\" /\u003e\n   \u003cimg alt=\"Star History Chart\" src=\"https://api.star-history.com/svg?repos=berryalen02/PECracker\u0026type=Date\" /\u003e\n \u003c/picture\u003e\n\u003c/a\u003e\n\n# 免责声明\n\n本文所涉及的任何技术、信息或工具，仅供学习和参考之用。请勿利用本文提供的信息从事任何违法活动或不当行为。任何因使用本文所提供的信息或工具而导致的损失、后果或不良影响，均由使用者个人承担责任，与本文作者无关。作者不对任何因使用本文信息或工具而产生的损失或后果承担任何责任。使用本文所提供的信息或工具即视为同意本免责声明，并承诺遵守相关法律法规和道德规范。\n\n# 参考\n\nhttps://github.com/med0x2e/SigFlip\n\nhttps://mp.weixin.qq.com/s/htc8ZTbQ23kq3TEMlkqSfA\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fberryalen02%2FPECracker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fberryalen02%2FPECracker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fberryalen02%2FPECracker/lists"}