Git Product home page Git Product logo

vulnerablesamlapp's Introduction

Vulnerable SAML infrastructure.

A high level getting started guide is below, if you would like a more detailed guide, that covers the app, features, settings, and walkthroughs please check out:

The purpose of these applications is to showcase how certain vulnerable configurations can be exploited to allow a user to change there permissions, name, etc. within an application. OneLogins python SAML library was utilized for this. In order for some of these vulnerable configurations to work the library was heavily modified.

This configuration contains two docker images. The vulnerableidp is an identity provider. It contains a 'database' with a few different users.

To spin up these docker images is fairly easy. Just run:

docker-compose up

The images will build and then the web application will be hosted at http://127.0.0.1:8000

Login Credentials

To login as an unpriviledged user:

Username: yogi
Password: bear

Admin user:

Username: admin
Password: this-is-the-administrator-pasword-oh-no-is-that-a-typo-in-password

User accout for CVE2017-11427

Username: brubble
Password: password

Instructor user that can adjust security levels:

Username: instructor
Password: G0od-LuckGu3ssingThisButHeyItCouldHappenRight?

To upgrade privileges after logging in as the 'yogi' user change the group membership in the SAML message from 'users' to 'admin'

If you'd like to change the user accounts, or the groups around edit the vulnerableidp/authsources.php file. All user accounts are statically assigned and created within that file.

Splitting the Deployment to Multiple Hosts:

Want to set this up on seperate servers or point to an address that isn't localhost? A couple of changes need to be made before you build the images first. The easiest thing to do is to run the configure_platform.py as a privileged user and follow the prompts for each of the hosts. If you allow it to run privileged the script will edit the configuration files for you, build the docker images, and launched them for you.

Want to edit the files manually, continue below:

IDP Configuration Changes and Running:

File: VulnerableSAMLApp/vulnerableidp/saml20-sp-remote.php

Change:

Replace every instance of '127.0.0.1:8000' with the ip of the host hosting the web application.

Lets build the Docker image:

sudo docker build -t idp:1.0 .

Run the container:

sudo docker run -it --rm --name idp -d -p 80:80 idp:1.0

Confirm container is running:

sudo docker ps

Output should have something similar to this:

189adee1b091  localhost/idp:1.0  apache2ctl -D FOR...  2 seconds ago  Up 2 seconds ago  0.0.0.0:80->80/tcp  idp

Confirm idp is listening:

curl http://127.0.0.1

Web Application Configuration Changes and Running:

File: VulnerableSAMLApp/vulnerablesp/yogiSP/saml/settings.json

Change:

In the settings.json file within the SP section replace the '127.0.0.1:8000' with your web applications ip.
Within the IDP section you'll also need to replace the '127.0.0.1' address with the address of the IDP server.

Lets build the Docker image:

sudo docker build -t sp:1.0 .

Run the container:

sudo docker run -it --rm --name sp -d -p 8000:8000 sp:1.0

Confirm container is running:

sudo docker ps

Output should be similar to this:

94476aee1abf    sp:1.1    "uwsgi --ini vulnsp.…"   4 minutes ago    Up 4 minutes    0.0.0.0:8000->8000/tcp    sp

Confirm web application is listening:

curl http://127.0.0.1

You should now be able to access the web application on port 8000 and authenticate through the IDP on port 80. Make sure that you have access to both hosts.

Want to change default security settings?

Before building the container edit the /vulnerablesp/yogiSP/saml/advanced_settings.json file.

Set values to True that you want to have loaded when the application runs. Once these settings are in, build the image and run it.

TODO:

  • Open User registration
  • Config script to make app more portable
  • Implement vulnerabilities to allow XSW attacks
  • Implement patch for cve-2017-11427 so that the vulnerability can be turned on/off

Shout out to E.D. for initial dockerization of the idp.

vulnerablesamlapp's People

Contributors

yogisec 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.