This project creates, and uses, a model for vulnerability detection in javascript files.
- Install python3 from https://www.python.org/downloads/
- Inside this directory, run
pip install -r requirements.txt
, this will download all python dependencies to your machine - Inside this directory, run
python3 train_model.py
, the program will train the model, and then display the different graphs explained in the project. - The output is saved in the
models
folder
- Install docker from https://www.docker.com/products/docker-desktop
- Inside the project, run
docker build . -t project
to build the docker image for this project - Execute
docker run -p 3000:3000 project
, this will allow you to access the static analysis server vialocalhost:3000
- Inside the project, run
python3 test-sample.py
, this will send the code insidesample-js-function.js
and evaluate it using the model, returning the prediction for this file.