{"id":28236606,"url":"https://github.com/tester1010101/get-rules-groups","last_synced_at":"2026-04-29T00:07:50.209Z","repository":{"id":290244493,"uuid":"443205548","full_name":"tester1010101/Get-Rules-Groups","owner":"tester1010101","description":":snowflake: Firewall Groups \u0026 Rules Dumper — Converts \"Allow\" rules to applicable commands, for Windows (PowerShell) :open_umbrella:","archived":false,"fork":false,"pushed_at":"2022-12-28T21:15:01.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-19T00:16:29.817Z","etag":null,"topics":["11","advanced","converter","dump","export","firewall","group","groups","multiple","rules","single","windows"],"latest_commit_sha":null,"homepage":"","language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tester1010101.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null}},"created_at":"2021-12-30T23:21:24.000Z","updated_at":"2023-05-12T17:06:32.000Z","dependencies_parsed_at":"2025-04-27T19:57:26.590Z","dependency_job_id":null,"html_url":"https://github.com/tester1010101/Get-Rules-Groups","commit_stats":null,"previous_names":["tester1010101/get-rules-groups"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tester1010101%2FGet-Rules-Groups","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tester1010101%2FGet-Rules-Groups/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tester1010101%2FGet-Rules-Groups/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tester1010101%2FGet-Rules-Groups/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tester1010101","download_url":"https://codeload.github.com/tester1010101/Get-Rules-Groups/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tester1010101%2FGet-Rules-Groups/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":258136942,"owners_count":22655573,"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":["11","advanced","converter","dump","export","firewall","group","groups","multiple","rules","single","windows"],"created_at":"2025-05-19T00:15:36.136Z","updated_at":"2026-04-29T00:07:50.183Z","avatar_url":"https://github.com/tester1010101.png","language":"PowerShell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Get-Rules \u0026 Groups (v1.2) :recycle: :beginner:\n* :diamond_shape_with_a_dot_inside: Dumps ALL (\"Allow\") **Firewall Rules** from Windows Defender Firewall with Advanced Security. \n* :diamond_shape_with_a_dot_inside: Reconverts them into applicables one through \"netsh advfirewall firewall add rule\".\n* :diamond_shape_with_a_dot_inside: Will get dumped \u0026 converted in: %USERPROFILE%\\Rules\\FWCommands.txt\n* :diamond_shape_with_a_dot_inside: Prompts user to open the dump/rules location, for analysis/learning/re-apply/backups.\n* ## :open_file_folder: To-do: Add to extraction/conversion: Deny rules :no_entry: ##\n* ## :warning: Packages in rules won't be applied/converted/extracted to rules (to-do) ##\n\n![image](https://user-images.githubusercontent.com/91343617/147798910-7dc5afd3-d63a-435e-8d82-8338cd4a4e72.png)\n\n## Instructions:\n\n* __Right-click the script, run in PowerShell__ :repeat_one:\n\n\u003e Get-Rules Block :cinema:\n\u003e 1. Creates the Rules folder in %USERPROFILE%\\Rules if not present\n\u003e 2. Dumps all \"allowed\" firewall rules into a textfile at %USERPROFILE%\\Rules\\FW-Rules.txt\n\u003e 3. Stock the rules into a variable from the file dumped (user can use custom file/path)\n\u003e 4. Parse each rules ending at '(?\u003c=Action:                               Allow)'\n\u003e 5. Create a .txt of each rules at %USERPROFILE%\\Rules\\$i.txt\n\u003e 6. Increment until none left\n\n![image](https://user-images.githubusercontent.com/91343617/147798014-032e47a0-d412-4a5f-b934-0e879ba99917.png)\n\n\u003e Conversion (Rules, Groups) :arrows_counterclockwise:\n\u003e 1. Gets the last item of the rules dumped, then starts the loop until last rule\n\u003e 2. Starting from rule #1, it'll extract all rule's parameters into variables\n\u003e 3. Then create a netsh command to re-enter it as needed, with rule's variables\n\u003e 4. Each set of variables creates a command which is added to a command file\n\u003e 5. Final textfile contains all commands ready to be applied, in the 'netsh' format.\n\n![image](https://user-images.githubusercontent.com/91343617/147798717-e9763699-5f01-418d-80d6-535f6f6d69cc.png)\n![image](https://user-images.githubusercontent.com/91343617/147798855-5a5e5030-85f0-4136-bd1b-32ca203a4445.png)\n![image](https://user-images.githubusercontent.com/91343617/147798831-1544997e-0cff-47a4-a8b7-8fbb97f03e6a.png)\n\nI created this dumper to easily re-create multiple rules I needed. Be sure to note the packages or you may be missing some stuff, lemme know if anything is wrong! \nWith the \"Export Policy\" option, you can't select which to export/import, (like the predefined firewall rules) you have to overwrite the whole set :x:\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftester1010101%2Fget-rules-groups","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftester1010101%2Fget-rules-groups","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftester1010101%2Fget-rules-groups/lists"}