Skip to content

Multiple improvements added#12

Open
redd1ng wants to merge 1 commit into
secureworks:mainfrom
redd1ng:main
Open

Multiple improvements added#12
redd1ng wants to merge 1 commit into
secureworks:mainfrom
redd1ng:main

Conversation

@redd1ng
Copy link
Copy Markdown
Contributor

@redd1ng redd1ng commented May 11, 2026

I have added the following improvements:

  • Handle EncryptedPolicyBody for platform and remediation scripts (fixes Encrypted Intune policies #11)
  • Files are now written to disk instead of stdout. This helps when a tenant has a large number of scripts and fixes the case where encoding errors threw an exception.
  • Added a try except to apps download so it will continue to download the other apps in case an error occurs.

It will create the following folders when downloading scripts/apps, saves the files according to its type in the dedicated folder and makes it easier to search for specific keywords trough all files.
IntuneScriptsAndApps
├── Apps
├── PlatformScripts
└── RemediationScripts

$ python3 pytune.py get_remediations -m DEVICE_mdm.pfx -d DEVICE
[*] downloading remediation scripts...
[!] remediation scripts found!
[*] #1 (Remediation/Policy ID:a39781a8-7f9b-4d68-b273-13fada14fc91, Name:a39781a8-7f9b-4d68-b273-13fada14fc91)
[+] saved detection script to 
IntuneScriptsAndApps/RemediationScripts/a39781a8-7f9b-4d68-b273-13fada14fc91.detect.ps1
[+] saved remediation script to 
IntuneScriptsAndApps/RemediationScripts/a39781a8-7f9b-4d68-b273-13fada14fc91.remediate.ps1
[*] #2 (Remediation/Policy ID:42812dca-43d5-4768-8a16-0c04fb1d6698, Name:42812dca-43d5-4768-8a16-0c04fb1d6698)
[+] saved detection script to 
IntuneScriptsAndApps/RemediationScripts/42812dca-43d5-4768-8a16-0c04fb1d6698.detect.ps1
[+] saved remediation script to 
IntuneScriptsAndApps/RemediationScripts/42812dca-43d5-4768-8a16-0c04fb1d6698.remediate.ps1
$ python3 pytune.py download_apps -m DEVICE_mdm.pfx -d DEVICE   
[*] downloading scripts...
[*] #1 (Platform Script/Policy ID:ba65d9f0-0642-497d-b8db-dfb2dc9771e5, Name:ba65d9f0-0642-497d-b8db-dfb2dc9771e5)
[+] saved script to IntuneScriptsAndApps/PlatformScripts/ba65d9f0-0642-497d-b8db-dfb2dc9771e5.ps1
[*] #2 (Platform Script/Policy ID:00af5cac-a84a-4bb6-9249-27f46b69d716, Name:00af5cac-a84a-4bb6-9249-27f46b69d716)
[+] saved script to IntuneScriptsAndApps/PlatformScripts/00af5cac-a84a-4bb6-9249-27f46b69d716.ps1
[*] downloading win32apps...
[-] available intunewin file not found

…s are now written to disk instead of stdout. This helps when a tenant has a large number of scripts and fixes the edge case where encoding errors threw an exception. Added a try except to apps download so it will continue to download the other apps in case an error occurs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Encrypted Intune policies

1 participant