{"id":27559959,"url":"https://github.com/willshiao/node-bash-obfuscate","last_synced_at":"2025-09-19T18:33:14.692Z","repository":{"id":14970637,"uuid":"77374801","full_name":"willshiao/node-bash-obfuscate","owner":"willshiao","description":"A Node.js CLI tool and library to heavily obfuscate bash scripts.","archived":false,"fork":false,"pushed_at":"2024-09-11T09:18:42.000Z","size":139,"stargazers_count":125,"open_issues_count":18,"forks_count":28,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-20T02:57:17.713Z","etag":null,"topics":["bash","hacktoberfest","nodejs","obfuscate"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/willshiao.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":"2016-12-26T09:54:14.000Z","updated_at":"2025-01-15T18:04:07.000Z","dependencies_parsed_at":"2024-06-19T17:36:54.939Z","dependency_job_id":"afd75279-b36b-45a8-921e-5bdada50e686","html_url":"https://github.com/willshiao/node-bash-obfuscate","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/willshiao%2Fnode-bash-obfuscate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willshiao%2Fnode-bash-obfuscate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willshiao%2Fnode-bash-obfuscate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willshiao%2Fnode-bash-obfuscate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/willshiao","download_url":"https://codeload.github.com/willshiao/node-bash-obfuscate/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249841726,"owners_count":21333099,"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":["bash","hacktoberfest","nodejs","obfuscate"],"created_at":"2025-04-20T02:57:22.519Z","updated_at":"2025-09-19T18:33:09.637Z","avatar_url":"https://github.com/willshiao.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# node-bash-obfuscate\n[![npm](https://img.shields.io/npm/l/bash-obfuscate.svg)](https://github.com/willshiao/node-bash-obfuscate/blob/master/LICENSE)\n[![npm](https://img.shields.io/npm/v/bash-obfuscate.svg)](https://www.npmjs.com/package/bash-obfuscate)\n\nA Node.js CLI tool and library to heavily obfuscate bash scripts.\n\n\n## Installation\n\n```\n$ npm install -g bash-obfuscate\n$ bash-obfuscate script.sh -o output.sh\n```\n\n\n## Usage\n\n```\nUsage: bash-obfuscate \u003cinputFilename\u003e [options]\n\nOptions:\n  -o, --out                       Output file\n  -c, --chunk-size, --chunk-size  Chunk size (for variables in obfuscated code)\n                                                                    [default: 4]\n  -r, --randomize                 Randomize variable order\n                                                       [boolean] [default: true]\n```\n\n\n## Example\n\n### Input\n```bash\n#!/usr/bin/env bash\n\nUSR_VAR='I like Node.js!'\n\necho $USR_VAR\nfor (( i = 0; i \u003c 10; i++ )); do\n    echo $i\ndone\necho \"It works!\"\n```\n\n### Output\n```bash\nz=\"\n\";Hz='echo';Gz=''\\''';Lz='for ';Qz='; i+';Ez='Node';Cz=''\\''I l';Uz='done';Jz='R_VA';Az='USR_';Fz='.js!';Nz=' = 0';Bz='VAR=';Kz='R';Rz='+ ))';Wz=' wor';Iz=' $US';Vz=' \"It';Oz='; i ';Sz='; do';Mz='(( i';Tz=' $i';Xz='ks!\"';Pz='\u003c 10';Dz='ike ';\neval \"$Az$Bz$Cz$Dz$Ez$Fz$Gz$z$Hz$Iz$Jz$Kz$z$Lz$Mz$Nz$Oz$Pz$Qz$Rz$Sz$z$Hz$Tz$z$Uz$z$Hz$Vz$Wz$Xz\"\n```\n\n\n## FAQ\n\n### How does it work?\nThis tool divides the bash script into chunks (size specified by the `-c` flag). It then assigns a variable name to each chunk (with the same variable name for identical chunks) and replaces the original script with variable references, essentially scrambling the original script.\n\n### How do I deobfuscate a script?\nAlthough this does not provide a method of automatically deobfuscating a script, it can be fairly easily done manually. To deobfuscate a bash script, you just have to have the script print out the contents of the deobfuscated script instead of having the script execute it.\n\nNo detailed instructions will be provided because the exact details will vary as new obfuscation stages are added to the script.\n\n### What's the point? I can deobfuscate it so easily...\nThe idea is not to provide absolute or even robust protection for your code against someone with a good understanding of bash. Its main purpose is to discourage tampering from someone with little/no understanding of bash.\n\nThe main problem with bash obfuscation is that the code can always be printed out when it is about to be executed, which is also when the code is deobfuscated.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwillshiao%2Fnode-bash-obfuscate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwillshiao%2Fnode-bash-obfuscate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwillshiao%2Fnode-bash-obfuscate/lists"}