{"id":16606959,"url":"https://github.com/mrexodia/perfect-dll-proxy","last_synced_at":"2025-04-13T00:45:50.399Z","repository":{"id":229458259,"uuid":"776784230","full_name":"mrexodia/perfect-dll-proxy","owner":"mrexodia","description":"Perfect DLL Proxying using forwards with absolute paths.","archived":false,"fork":false,"pushed_at":"2024-10-09T10:17:00.000Z","size":5,"stargazers_count":264,"open_issues_count":1,"forks_count":26,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-04-13T00:45:47.803Z","etag":null,"topics":["dll-hijacking","redteam-tools","reverse-engineering","security","windows"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsl-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mrexodia.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-03-24T13:38:22.000Z","updated_at":"2025-04-12T14:34:52.000Z","dependencies_parsed_at":"2024-10-26T20:30:18.957Z","dependency_job_id":"e5f01bbc-f0e4-4159-87d3-9e948f9e709d","html_url":"https://github.com/mrexodia/perfect-dll-proxy","commit_stats":null,"previous_names":["mrexodia/perfect-dll-proxy"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrexodia%2Fperfect-dll-proxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrexodia%2Fperfect-dll-proxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrexodia%2Fperfect-dll-proxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrexodia%2Fperfect-dll-proxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mrexodia","download_url":"https://codeload.github.com/mrexodia/perfect-dll-proxy/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248650420,"owners_count":21139672,"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":["dll-hijacking","redteam-tools","reverse-engineering","security","windows"],"created_at":"2024-10-12T01:10:55.381Z","updated_at":"2025-04-13T00:45:50.365Z","avatar_url":"https://github.com/mrexodia.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Perfect DLL Proxy\r\n\r\nA while ago I needed a proxy to perform DLL hijacking, but I did not like how existing solutions generated ASM stubs to deal with the forwarding. It turns out that there is a trick to get forwards to work with an absolute path:\r\n\r\n```cpp\r\n#pragma comment(linker,\r\n\"/EXPORT:CredPackAuthenticationBufferA=\\\\\\\\.\\\\GLOBALROOT\\\\SystemRoot\\\\System32\\\\credui.dll.CredPackAuthenticationBufferA\"\r\n)\r\n```\r\n\r\nSee the references for more information.\r\n\r\nTo automatically generate a DLL that exports everything and loads an arbitrary DLL (without intercepting functions), look at the following project: https://github.com/namazso/dll-proxy-generator\r\n\r\n## Usage\r\n\r\n```sh\r\npython -m pip install pefile\r\npython perfect-dll-proxy.py credui.dll\r\n```\r\n\r\n## References\r\n\r\n- https://nibblestew.blogspot.com/2019/05/\r\n- https://googleprojectzero.blogspot.com/2016/02/the-definitive-guide-on-win32-to-nt.html\r\n- https://learn.microsoft.com/en-us/cpp/build/reference/export-exports-a-function\r\n- https://devblogs.microsoft.com/oldnewthing/20121116-00/?p=6073\r\n- https://medium.com/@lsecqt/weaponizing-dll-hijacking-via-dll-proxying-3983a8249de0\r\n- https://book.hacktricks.xyz/windows-hardening/windows-local-privilege-escalation/dll-hijacking\r\n- https://www.ired.team/offensive-security/persistence/dll-proxying-for-persistence\r\n- https://github.com/Flangvik/SharpDllProxy\r\n- https://github.com/hfiref0x/WinObjEx64\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrexodia%2Fperfect-dll-proxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmrexodia%2Fperfect-dll-proxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrexodia%2Fperfect-dll-proxy/lists"}