What's Done: Writing JSON File using PHP >---> Reading JSON File using Python
To install php5.6:
Use these commands:
sudo add-apt-repository ppa:ondrej/php
sudo apt-get install software-properties-common
sudo apt-get update
sudo apt-get install php5.6
sudo apt-get install php5.6-mbstring php5.6-mcrypt php5.6-mysql php5.6-xml
How to Use:
-
Use all files under your username (not root).
Do this by usingsudo chown yourusername:yourusername -R PHP-Python-Communicator/
-
Provide Executable permissions for flag.json and json-generator.php
Do this by usingsudo chmod a+x filename
and thensudo chmod 777 filename
-
Keep running the python script in the background using
python3 json-checker.py
-
Open flag-sender.html file from your browser.
That's it!!!
You have changed the flag value from your flag.json.
Now open your flag.json for confirming change in values.
If Value sent from flag-sender.html is '0', json-checker.py will print "Will Skip Code"
If Value sent from flag-sender.html is '1', json-checker.py will print "Will Execute Code"