- fetch the original script but never change it directly
- parse the php script using
token_get_all()
andtoken_name()
- replace every sensitive functions by a
wrape_function_name
to control the behavore - rebuild the script and store the mirror script somewhere
- use
getcwd()
to store the current directory andchdir()
to reset it to the original location so the static resources will be dowloaded from the origine - execute the mirror script
- use
chdir()
to restore the previous directory location
Last active
August 29, 2015 14:23
-
-
Save rafasashi/7af69e03c73f4acdc9f6 to your computer and use it in GitHub Desktop.
How to review and run an external php script safely?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment