Lab 3 Database Webserver Connection - JadenGil/Jaden-Tech-Journal GitHub Wiki
To begin I logged into mysql and made 2 new users with full privileges (for now)
Updated the UFW Firewall rules:
Normally I'd need to install python3 with sudo apt-get python3
but the Kali box I'm using already has it installed
Intalling python3 addons:
apt-get install python3-pip
apt-get install python3.12-venv
Made a directory on the desktop called "project"
Create a virtual environment:
Install flask:
Make a directory for flask:
Install the following:
pip install flask-mysql
pip install cryptography
now before moving on we need to make a directory called "static", "js" that is in the static dir, and "templates" which is in the flask dir. It should look something like this at first:
Creating app.py
I made app.py using sudo nano app.py
and it should look something like this:
Creating button.html
Button.html will be in the templates directory and should look something like this:
Creating button.js
Button.js should be in the static/js/ directory and it should look something like this:
Running the server
To run the server we need to enter the following:
export FLASK_APP=app.py
flask run --host=0.0.0.0
The output should look like this:
going to 127.0.0.1 will take you to this page:
Deliverable Test Connection: