Git Product home page Git Product logo

djangoat-python's Introduction

Codacy Badge Build Status Codacy Badge CodeFactor Total alerts codebeat badge DeepSource

DjanGoat

DjanGoat is a vulnerable Django Application based in large part off the RailsGoat project. The application purports to be an internal employee portal for MetaCorp, Inc but includes vulnerabilities from the OWASP Top 10 and is intended to be used as an educational tool for developers and security professionals. Any maintainers are welcome to make pull requests.

Installation

On a mac, first install python.

Initial Setup

Requirements:

  • Python 2.7
  • Pip
  • mysql (optional)

Begin by creating a virtual-env

    pip install virtualenv
    virtualenv env
    source env/bin/activate

Then install using pip

    make install

DB-Setup

SQLite

Djangoat uses a SQLite database by default. To deploy the server locally with a SQLite database, use:

    make run

This will initialize and migrate a new (gitignored) SQLite database db.sqlite3 in the root project directory. It will then run the server locally.

At any point after the database has been migrated, it can be seeded with python manage.py seed.

MySQL

  1. Make sure you have mysql installed and run the following to setup the database
    mysql -u root -p
    CREATE DATABASE `db_name`;
    CREATE USER 'username'@'localhost' IDENTIFIED BY 'your_password';
    GRANT ALL PRIVILEGES ON `db_name`.* TO 'username'@'localhost';
    FLUSH PRIVILEGES;
    quit
  1. Go to pygoat/production_settings.py and fill out the given information for your database.

  2. Migrate the models and associated database data

    python manage.py makemigrations
    python manage.py migrate
  1. To set up seed data you can run:
    python manage.py seed

For developers create a local_settings.py file in the pygoat folder that mocks production_setting.py.

If Django does not recognize MySQL after the setup above, try installing mysql-python and migrate again

    pip install mysql-python

Finally run on localhost:8000

    python manage.py runserver

PostgreSQL

If you want to setup DjanGoat with a PostgreSQL database, checkout the PostgreSQL branch with the following command:

    $ git checkout postgresql-database

The PostgreSQL branch has modified documentation and tests.

Testing

To run tests, simply run:

    make test

Linting

To run pylint using the provided .pylintrc configuration file:

    make lint

Tutorial

Tutorial information on the various vulnerabilities in this application are here.

Acknowledgements

The development team.

djangoat-python's People

Contributors

alice-duan avatar codacy-badger avatar contrast-alexb avatar lazorchakp avatar marklacasse avatar palmergs avatar prodion23 avatar ryandens avatar stevefeldman avatar vinairachakonda avatar ziyangw avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.