Skip to content

Instantly share code, notes, and snippets.

@antonydevanchi
Last active November 14, 2020 14:46
Show Gist options
  • Save antonydevanchi/cf1b6fc0dca3f99a7b8bc23bef064f09 to your computer and use it in GitHub Desktop.
Save antonydevanchi/cf1b6fc0dca3f99a7b8bc23bef064f09 to your computer and use it in GitHub Desktop.
How to parse raw .mobileconfig with web clips and extract base64 encoded PNG icons from payload. Нахуя и зачем — не спрашивайте. Просто... Примите и отпустите.
strings ~/Downloads/profile_dfcab51cf5cccfd991b9065745bf71c4_signed.mobileconfig | grep -E '<plist/>|<plist.*><' | xmlstarlet sel -t -m /plist/dict/array/dict -v data -n | xargs -n1 bash -c 'echo "$@" | base64 -d > ~/Downloads/`date +%s`_`openssl rand -base64 32 | md5`.png' --
# raw — to .plist file (edit with XCode for rich UI tools)
strings ~/Downloads/profile_dfcab51cf5cccfd991b9065745bf71c4_signed.mobileconfig | grep -E '<plist/>|<plist.*><' > $HOME/Downloads/mobileconfig_`date +%s`.plist
# raw — to .mobileconfig file (edit with Apple Configurator 2 for rich UI tools)
strings ~/Downloads/profile_dfcab51cf5cccfd991b9065745bf71c4_signed.mobileconfig | grep -E '<plist/>|<plist.*><' > $HOME/Downloads/mobileconfig_`date +%s`.mobileconfig
# formatted — to terminal
strings ~/Downloads/profile_dfcab51cf5cccfd991b9065745bf71c4_signed.mobileconfig | grep -E '<plist/>|<plist.*><' | xmllint -format -
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment