Git Product home page Git Product logo

skf-labs's Introduction

Introduction

security knowledge framework

Here we find all the labs and write-ups for the security knowledge framework!
These labs are correlated to knowledge-base id's which are on their place
again correlated to security controls such as from the ASVS or NIST, etc.

The labs are all downloadable from the following Github repository:

{% hint style="info" %} SKF Labs repo {% endhint %}

The images can also be found on the skf docker hub. These skf-labs images are automatically pushed to the docker registry on each commit to the Github repository.

Useful tools

First thing we need to do is to be able to investigate the requests that are being made by the labs/applications. We do this by setting up our intercepting proxy so we can gain more understanding of the application under test.

{% hint style="info" %} Burp suite:
https://portswigger.net/burp/communitydownload {% endhint %}

{% hint style="info" %} ZAP: For the latest features we want to advise to use the Weekly build of ZAP. This is using the latest and greatest improvements + Libraries https://www.zaproxy.org/download/#weekly {% endhint %}

How to add a Lab & write-up

When you want to contribute and add your own labs then please make sure you use the styling template in one of the lab challenges. We think its really important to have one look and feel and for able to merge your lab its required to use the SKF template. You can copy this from any of the labs we currently already have.

For adding the write-up for the lab we advice to create a copy of on existing write-up and work from there or use the template.md file as a base. You can store all your images in .gitbook/assets/ and also make sure you correlate your lab to one of the knowledge base item identifier in SKF. When you completed the lab and the write-up you only have to add it to the SUMMARY.md file and you are ready to create your Pull Request.

After the pull request you can find your nice styled write-up here: https://skf.gitbook.io/asvs-write-ups/

Deploying SKF Lab's from your terminal

You can now deploy skf-lab from your terminal, with joyghoshs/skf-cli, you don't need to setup server if you don't want to with skf-cli you can deploy lab with security knowledge frameworks own api, if you want you can also search and deploy lab using skf-cli.

skf-labs's People

Contributors

4390c336 avatar abhiabhi2306 avatar albertocoding avatar anon-exploiter avatar asurwade avatar blabla1337 avatar brunocortesrodrigues avatar ctxhamza avatar david3107 avatar giuliocomi avatar jigsjst avatar joyghoshs avatar karim-ouerghemmi-sonarsource avatar lmol avatar mrx465 avatar python-semicolon avatar ran-dall avatar riiecco avatar rolfvreijdenberger avatar rudytruyens avatar shayubit avatar tdimbs avatar thesebas avatar tsluyter avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

skf-labs's Issues

sqlalchemy.exc.IntegrityError

While building the dockerfile for graphql-IDOR challenge I am getting a sqlalchemy.exc.IntegrityError

➜ sudo docker build .
Sending build context to Docker daemon  2.048kB
Step 1/8 : FROM alpine:3.7
 ---> 6d1ef012b567
Step 2/8 : MAINTAINER Davide Cioccia <[email protected]>
 ---> Using cache
 ---> 95ba54cc967e
Step 3/8 : RUN apk update --no-cache && apk add python3     python3-dev     py3-pip     bash     git
 ---> Using cache
 ---> 5f4cb88ed81f
Step 4/8 : RUN git clone https://github.com/blabla1337/skf-labs.git
 ---> Using cache
 ---> 232cff693419
Step 5/8 : WORKDIR /skf-labs/graphql-IDOR
 ---> Using cache
 ---> 75195b284e90
Step 6/8 : RUN pip3 install -r requirements.txt
 ---> Using cache
 ---> 58b625454a81
Step 7/8 : RUN python3 populate-database.py
 ---> Running in c5f965a913fd
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1246, in _execute_context
    cursor, statement, parameters, context
  File "/usr/lib/python3.6/site-packages/sqlalchemy/engine/default.py", line 581, in do_execute
    cursor.execute(statement, parameters)
sqlite3.IntegrityError: UNIQUE constraint failed: users.username

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "populate-database.py", line 60, in <module>
    db.session.commit()
  File "/usr/lib/python3.6/site-packages/sqlalchemy/orm/scoping.py", line 162, in do
    return getattr(self.registry(), name)(*args, **kwargs)
  File "/usr/lib/python3.6/site-packages/sqlalchemy/orm/session.py", line 1036, in commit
    self.transaction.commit()
  File "/usr/lib/python3.6/site-packages/sqlalchemy/orm/session.py", line 503, in commit
    self._prepare_impl()
  File "/usr/lib/python3.6/site-packages/sqlalchemy/orm/session.py", line 482, in _prepare_impl
    self.session.flush()
  File "/usr/lib/python3.6/site-packages/sqlalchemy/orm/session.py", line 2479, in flush
    self._flush(objects)
  File "/usr/lib/python3.6/site-packages/sqlalchemy/orm/session.py", line 2617, in _flush
    transaction.rollback(_capture_exception=True)
  File "/usr/lib/python3.6/site-packages/sqlalchemy/util/langhelpers.py", line 68, in __exit__
    compat.reraise(exc_type, exc_value, exc_tb)
  File "/usr/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 153, in reraise
    raise value
  File "/usr/lib/python3.6/site-packages/sqlalchemy/orm/session.py", line 2577, in _flush
    flush_context.execute()
  File "/usr/lib/python3.6/site-packages/sqlalchemy/orm/unitofwork.py", line 422, in execute
    rec.execute(self)
  File "/usr/lib/python3.6/site-packages/sqlalchemy/orm/unitofwork.py", line 589, in execute
    uow,
  File "/usr/lib/python3.6/site-packages/sqlalchemy/orm/persistence.py", line 245, in save_obj
    insert,
  File "/usr/lib/python3.6/site-packages/sqlalchemy/orm/persistence.py", line 1137, in _emit_insert_statements
    statement, params
  File "/usr/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 982, in execute
    return meth(self, multiparams, params)
  File "/usr/lib/python3.6/site-packages/sqlalchemy/sql/elements.py", line 287, in _execute_on_connection
    return connection._execute_clauseelement(self, multiparams, params)
  File "/usr/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1101, in _execute_clauseelement
    distilled_params,
  File "/usr/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1250, in _execute_context
    e, statement, parameters, cursor, context
  File "/usr/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1476, in _handle_dbapi_exception
    util.raise_from_cause(sqlalchemy_exception, exc_info)
  File "/usr/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 398, in raise_from_cause
    reraise(type(exception), exception, tb=exc_tb, cause=cause)
  File "/usr/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 152, in reraise
    raise value.with_traceback(tb)
  File "/usr/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1246, in _execute_context
    cursor, statement, parameters, context
  File "/usr/lib/python3.6/site-packages/sqlalchemy/engine/default.py", line 581, in do_execute
    cursor.execute(statement, parameters)
sqlalchemy.exc.IntegrityError: (sqlite3.IntegrityError) UNIQUE constraint failed: users.username
[SQL: INSERT INTO users (username, password, "isAdmin") VALUES (?, ?, ?)]
[parameters: ('johndoe', 'password1', 0)]
(Background on this error at: http://sqlalche.me/e/gkpj)
The command '/bin/sh -c python3 populate-database.py' returned a non-zero code: 1

Consider using some other webterminal

Currently, we are using butterfly to provide a web-based terminal for our Binary exploitation challenges but the issue is that butterfly isn't under development, the last commit on that project was in 2018. Also when I tried to set up butterfly on other dockerfiles there was some PEP 517 error.

I think we should try to use some other web-based terminal like pyxterm.js.

open-redir-harder lab not working as intended

SKF open-redir-harder Docker container.

If you click the “Go to new website” button it redirects to: /redirect?newurl=/newsite

It should redir to: /redirect?newurl=newsite

need to check with the writeup and why its not working as it should :)

Can't pull docker image of parameter binding exercise

Hi,

Was trying to pull the image of parameter-bindings and got the following error:

Error response from daemon: manifest for blabla1337/owasp-skf-lab:parameter-binding not found: manifest unknown: manifest unknown

The challenge is situated at the following link:
https://github.com/blabla1337/skf-labs/blob/master/kbid-147-parameter-binding.md

After googling found out that the issue occurs when either the latest tag isn't present (which isn't the case here) or when the specified tag isn't present.

I tried searching for the tag but couldn't find it in docker hub repository:
https://hub.docker.com/r/blabla1337/owasp-skf-lab

POC (of tag not being present on docker hub):

image


Used command to pull the image:

docker pull blabla1337/owasp-skf-lab:parameter-bindings

POC (of other tags/images being pulled):

image

Let me know if anything else is required from my side. Thanks!

File injection lab has issues

When I run File injection in web portal or on docker I get below error could you help me with resolving the same

builtins.OSError
OSError: No content, file name. Nothing is given
image

Contribution.

@blabla1337 I have Experience on Various attack vectors and OWASP-Top 10 model attacks. Also, I do CTFs and Pentesting, so can I contribute to SKF-Labs.

CORS example exploitation demo has no 'protected' page to 'exploit'

The main problem is the entire demo relies on this package, and is default insecure.

from flask.ext.cors import CORS, cross_origin
app = Flask(__name__, static_url_path='/static', static_folder='static')
@app.after_request
def add_headers(response):
response.headers.add('Access-Control-Allow-Origin', '*')
response.headers.add('Access-Control-Allow-Headers', 'Content-Type,Authorization')
return response

The package that is meant to be an example of enabling CORS, is actually inherently insecure too!

It defaults to disable CORS protections, not demonstration enabling CORS

I.e. putting Access-Control-Allow-Origin: * is not enabling CORS, it is telling the browser to disable same-origin policy protections for CORS and allow all origins, not allow a specific cross-origin to share resources with.

Essentially this demo snippet:

@app.route("/protected", methods=['GET'])
def protected():
    return "protected"

This is not enabling CORS, or protected by CORS protections. it is unprotected by design.

The next snippet in the demo implies the application has enabled CORS:

@app.route("/allowed", methods=['GET'])
@cross_origin()
def allowed():
    return "allowed"

That use of @cross_origin() implies enabling CORS, but without the attribute origins it just means there are no allowed origins, and it will use the decorator default origin setting to allow all origins..

all origins is an important semantic because CORS is a protection to permit only allowed origins to share resources with, so enabling CORS should add this protection of only allowed origins! When you allow all origins, not just a permitted origin, you effectively disable CORS protections and force the behaviour no cross-origin resource sharing because, public is just public, it's not cross-origin when all origins are ignored and the resources are just shared to any origin.

What the demo actually does

Firstly it's easy to see that /protected has not enabled any CORS configuration to protect anything, the default disabled same-origin policy and allowed all origins, so the method is deliberately unprotected - ergo /unprotected, and there is no part of the demo app that has any actual protected paths to be exploited.

There is no way to demo an exploit if there's nothing to exploit in the demo..

What would make this demo, an actual demo of exploiting CORS

If there was a protected path in this demo, to exploit, CORS would actually be enabled

@app.route("/protected", methods=['GET'])
@cross_origin(origins=["app.realdomain.tld"])
def protected():
    return "protected"

NB: the list for origins is misleading, only 1 origin is a valid value: corydolphin/flask-cors#300

Current demo can never be a good demo

As long as the @app.after_request to always send Access-Control-Allow-Origin: *

The confusion is /allowed , what is the intention? it uses @cross_origin() without an origin, so does that mean it intended it to be same-origin? We covered above that it doesn't act this way by default, so does that mean the demo intended this /allowed path to be all origins? If that is the intention then using @cross_origin() is redundant and if you delete the decorator the behaviour is completely unchanged because you have @app.after_request to always send Access-Control-Allow-Origin: * (which is default for @cross_origin())

Which in itself is a massive problem because the entire demo will always respond with Access-Control-Allow-Origin: * and importing cross_origin at all is redundant, even my example improved /protected method that defined an allowed origin is redundant because @app.after_request makes all origins always allowed!

A better demo

To actually have a demo that shows an exploitation of CORS, you must first have a server-side demonstration of using CORS to permit only an allowed origin to the /protected path. Then the exploit would need to demonstrate how to access the /protected path from a malicious origin (which is not actually possible using a browser, but can be demonstrated using cURL or other non-browser clients)

Be honest, not a leet haxor exploit demo..

Misconfiguration demo is still a very good demo, it doesn't need to be called an exploit!

Just be honest, and say that the demo is showing how an intentionally insecure by-design app, that completely misconfigures CORS, can be exposing parts of your app you assumed were protected.

There is no exploit but rather an honest demo, without all the hyperbolic hacker nonesense, just a truthful humble demo of what a misconfiguration looks like. And the entire demo language changes to something that a developer (and most normal people) can relate too, and therefore actually find useful and learn from.

Labs 2.0 - Menu add-on editor

Menu add-on editor for all the labs

For the labs we want to add a light weight browser editor to be able to modify the lab code that is running.

menu

When you open the menu you will have the Editor with the application logs in the bottom, the idea is the user can modify the code and automatically will be running the updated application:
ski-editor

Also when the top icon is clicked the user can select also different files to edit and work on:
ski-editor2

With this improvement we can also use the lab environment to practise the secure coding principles and be able to play with the secure design patterns for mitigating the different vulnerabilities.

Intercept using proxy

Unable to intercept using proxy like burp.

Any settings to be done , please advice?

Unable to build bufferoverflow challenge because of pip

I am trying to build 32_bufferoverflow challenge on my system but getting the following error:

Building wheels for collected packages: tornado, cryptography
  Building wheel for tornado (setup.py): started
  Building wheel for tornado (setup.py): finished with status 'done'
  Created wheel for tornado: filename=tornado-5.1.1-cp27-cp27mu-linux_i686.whl size=462414 sha256=2b58107f250152150e24d5d7e0aac39a59d179e49f05dd8bd5b0dad717b4eecf
  Stored in directory: /root/.cache/pip/wheels/d8/83/af/e0dc6afbf3a2c51af8d6e3f9fbe790d0c581c2de05bc5d50f5
  Building wheel for cryptography (PEP 517): started
  Building wheel for cryptography (PEP 517): finished with status 'error'
  ERROR: Command errored out with exit status 1:
   command: /usr/bin/python /usr/local/lib/python2.7/dist-packages/pip/_vendor/pep517/_in_process.py build_wheel /tmp/tmpcmrfkw
       cwd: /tmp/pip-install-bVBvq4/cryptography
  Complete output (137 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-2.7
  creating build/lib.linux-x86_64-2.7/cryptography
  copying src/cryptography/exceptions.py -> build/lib.linux-x86_64-2.7/cryptography
  copying src/cryptography/__about__.py -> build/lib.linux-x86_64-2.7/cryptography
  copying src/cryptography/__init__.py -> build/lib.linux-x86_64-2.7/cryptography
  copying src/cryptography/fernet.py -> build/lib.linux-x86_64-2.7/cryptography
  copying src/cryptography/utils.py -> build/lib.linux-x86_64-2.7/cryptography
  creating build/lib.linux-x86_64-2.7/cryptography/x509
  copying src/cryptography/x509/oid.py -> build/lib.linux-x86_64-2.7/cryptography/x509
  copying src/cryptography/x509/name.py -> build/lib.linux-x86_64-2.7/cryptography/x509
  copying src/cryptography/x509/ocsp.py -> build/lib.linux-x86_64-2.7/cryptography/x509
  copying src/cryptography/x509/__init__.py -> build/lib.linux-x86_64-2.7/cryptography/x509
  copying src/cryptography/x509/certificate_transparency.py -> build/lib.linux-x86_64-2.7/cryptography/x509
  copying src/cryptography/x509/extensions.py -> build/lib.linux-x86_64-2.7/cryptography/x509
  copying src/cryptography/x509/general_name.py -> build/lib.linux-x86_64-2.7/cryptography/x509
  copying src/cryptography/x509/base.py -> build/lib.linux-x86_64-2.7/cryptography/x509
  creating build/lib.linux-x86_64-2.7/cryptography/hazmat
  copying src/cryptography/hazmat/_oid.py -> build/lib.linux-x86_64-2.7/cryptography/hazmat
  copying src/cryptography/hazmat/__init__.py -> build/lib.linux-x86_64-2.7/cryptography/hazmat
  copying src/cryptography/hazmat/_der.py -> build/lib.linux-x86_64-2.7/cryptography/hazmat
  creating build/lib.linux-x86_64-2.7/cryptography/hazmat/bindings
  copying src/cryptography/hazmat/bindings/__init__.py -> build/lib.linux-x86_64-2.7/cryptography/hazmat/bindings
  creating build/lib.linux-x86_64-2.7/cryptography/hazmat/primitives
  copying src/cryptography/hazmat/primitives/keywrap.py -> build/lib.linux-x86_64-2.7/cryptography/hazmat/primitives
  copying src/cryptography/hazmat/primitives/hmac.py -> build/lib.linux-x86_64-2.7/cryptography/hazmat/primitives
  copying src/cryptography/hazmat/primitives/padding.py -> build/lib.linux-x86_64-2.7/cryptography/hazmat/primitives
  copying src/cryptography/hazmat/primitives/constant_time.py -> build/lib.linux-x86_64-2.7/cryptography/hazmat/primitives
  copying src/cryptography/hazmat/primitives/__init__.py -> build/lib.linux-x86_64-2.7/cryptography/hazmat/primitives
  copying src/cryptography/hazmat/primitives/poly1305.py -> build/lib.linux-x86_64-2.7/cryptography/hazmat/primitives
  copying src/cryptography/hazmat/primitives/cmac.py -> build/lib.linux-x86_64-2.7/cryptography/hazmat/primitives
  copying src/cryptography/hazmat/primitives/hashes.py -> build/lib.linux-x86_64-2.7/cryptography/hazmat/primitives
  creating build/lib.linux-x86_64-2.7/cryptography/hazmat/backends
  copying src/cryptography/hazmat/backends/__init__.py -> build/lib.linux-x86_64-2.7/cryptography/hazmat/backends
  copying src/cryptography/hazmat/backends/interfaces.py -> build/lib.linux-x86_64-2.7/cryptography/hazmat/backends
  creating build/lib.linux-x86_64-2.7/cryptography/hazmat/bindings/openssl
  copying src/cryptography/hazmat/bindings/openssl/_conditional.py -> build/lib.linux-x86_64-2.7/cryptography/hazmat/bindings/openssl
  copying src/cryptography/hazmat/bindings/openssl/binding.py -> build/lib.linux-x86_64-2.7/cryptography/hazmat/bindings/openssl
  copying src/cryptography/hazmat/bindings/openssl/__init__.py -> build/lib.linux-x86_64-2.7/cryptography/hazmat/bindings/openssl
  creating build/lib.linux-x86_64-2.7/cryptography/hazmat/primitives/twofactor
  copying src/cryptography/hazmat/primitives/twofactor/totp.py -> build/lib.linux-x86_64-2.7/cryptography/hazmat/primitives/twofactor
  copying src/cryptography/hazmat/primitives/twofactor/__init__.py -> build/lib.linux-x86_64-2.7/cryptography/hazmat/primitives/twofactor
  copying src/cryptography/hazmat/primitives/twofactor/hotp.py -> build/lib.linux-x86_64-2.7/cryptography/hazmat/primitives/twofactor
  copying src/cryptography/hazmat/primitives/twofactor/utils.py -> build/lib.linux-x86_64-2.7/cryptography/hazmat/primitives/twofactor
  creating build/lib.linux-x86_64-2.7/cryptography/hazmat/primitives/kdf
  copying src/cryptography/hazmat/primitives/kdf/x963kdf.py -> build/lib.linux-x86_64-2.7/cryptography/hazmat/primitives/kdf
  copying src/cryptography/hazmat/primitives/kdf/concatkdf.py -> build/lib.linux-x86_64-2.7/cryptography/hazmat/primitives/kdf
  copying src/cryptography/hazmat/primitives/kdf/kbkdf.py -> build/lib.linux-x86_64-2.7/cryptography/hazmat/primitives/kdf
  copying src/cryptography/hazmat/primitives/kdf/__init__.py -> build/lib.linux-x86_64-2.7/cryptography/hazmat/primitives/kdf
  copying src/cryptography/hazmat/primitives/kdf/hkdf.py -> build/lib.linux-x86_64-2.7/cryptography/hazmat/primitives/kdf
  copying src/cryptography/hazmat/primitives/kdf/scrypt.py -> build/lib.linux-x86_64-2.7/cryptography/hazmat/primitives/kdf
  copying src/cryptography/hazmat/primitives/kdf/pbkdf2.py -> build/lib.linux-x86_64-2.7/cryptography/hazmat/primitives/kdf
  creating build/lib.linux-x86_64-2.7/cryptography/hazmat/primitives/asymmetric
  copying src/cryptography/hazmat/primitives/asymmetric/rsa.py -> build/lib.linux-x86_64-2.7/cryptography/hazmat/primitives/asymmetric
  copying src/cryptography/hazmat/primitives/asymmetric/x25519.py -> build/lib.linux-x86_64-2.7/cryptography/hazmat/primitives/asymmetric
  copying src/cryptography/hazmat/primitives/asymmetric/x448.py -> build/lib.linux-x86_64-2.7/cryptography/hazmat/primitives/asymmetric
  copying src/cryptography/hazmat/primitives/asymmetric/dsa.py -> build/lib.linux-x86_64-2.7/cryptography/hazmat/primitives/asymmetric
  copying src/cryptography/hazmat/primitives/asymmetric/padding.py -> build/lib.linux-x86_64-2.7/cryptography/hazmat/primitives/asymmetric
  copying src/cryptography/hazmat/primitives/asymmetric/ed25519.py -> build/lib.linux-x86_64-2.7/cryptography/hazmat/primitives/asymmetric
  copying src/cryptography/hazmat/primitives/asymmetric/__init__.py -> build/lib.linux-x86_64-2.7/cryptography/hazmat/primitives/asymmetric
  copying src/cryptography/hazmat/primitives/asymmetric/dh.py -> build/lib.linux-x86_64-2.7/cryptography/hazmat/primitives/asymmetric
  copying src/cryptography/hazmat/primitives/asymmetric/utils.py -> build/lib.linux-x86_64-2.7/cryptography/hazmat/primitives/asymmetric
  copying src/cryptography/hazmat/primitives/asymmetric/ed448.py -> build/lib.linux-x86_64-2.7/cryptography/hazmat/primitives/asymmetric
  copying src/cryptography/hazmat/primitives/asymmetric/ec.py -> build/lib.linux-x86_64-2.7/cryptography/hazmat/primitives/asymmetric
  creating build/lib.linux-x86_64-2.7/cryptography/hazmat/primitives/serialization
  copying src/cryptography/hazmat/primitives/serialization/pkcs12.py -> build/lib.linux-x86_64-2.7/cryptography/hazmat/primitives/serialization
  copying src/cryptography/hazmat/primitives/serialization/__init__.py -> build/lib.linux-x86_64-2.7/cryptography/hazmat/primitives/serialization
  copying src/cryptography/hazmat/primitives/serialization/ssh.py -> build/lib.linux-x86_64-2.7/cryptography/hazmat/primitives/serialization
  copying src/cryptography/hazmat/primitives/serialization/base.py -> build/lib.linux-x86_64-2.7/cryptography/hazmat/primitives/serialization
  creating build/lib.linux-x86_64-2.7/cryptography/hazmat/primitives/ciphers
  copying src/cryptography/hazmat/primitives/ciphers/aead.py -> build/lib.linux-x86_64-2.7/cryptography/hazmat/primitives/ciphers
  copying src/cryptography/hazmat/primitives/ciphers/modes.py -> build/lib.linux-x86_64-2.7/cryptography/hazmat/primitives/ciphers
  copying src/cryptography/hazmat/primitives/ciphers/__init__.py -> build/lib.linux-x86_64-2.7/cryptography/hazmat/primitives/ciphers
  copying src/cryptography/hazmat/primitives/ciphers/algorithms.py -> build/lib.linux-x86_64-2.7/cryptography/hazmat/primitives/ciphers
  copying src/cryptography/hazmat/primitives/ciphers/base.py -> build/lib.linux-x86_64-2.7/cryptography/hazmat/primitives/ciphers
  creating build/lib.linux-x86_64-2.7/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/ocsp.py -> build/lib.linux-x86_64-2.7/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/rsa.py -> build/lib.linux-x86_64-2.7/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/aead.py -> build/lib.linux-x86_64-2.7/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/x25519.py -> build/lib.linux-x86_64-2.7/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/hmac.py -> build/lib.linux-x86_64-2.7/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/x448.py -> build/lib.linux-x86_64-2.7/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/backend.py -> build/lib.linux-x86_64-2.7/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/dsa.py -> build/lib.linux-x86_64-2.7/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/x509.py -> build/lib.linux-x86_64-2.7/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/ed25519.py -> build/lib.linux-x86_64-2.7/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/decode_asn1.py -> build/lib.linux-x86_64-2.7/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/__init__.py -> build/lib.linux-x86_64-2.7/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/dh.py -> build/lib.linux-x86_64-2.7/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/utils.py -> build/lib.linux-x86_64-2.7/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/poly1305.py -> build/lib.linux-x86_64-2.7/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/ciphers.py -> build/lib.linux-x86_64-2.7/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/ed448.py -> build/lib.linux-x86_64-2.7/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/cmac.py -> build/lib.linux-x86_64-2.7/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/encode_asn1.py -> build/lib.linux-x86_64-2.7/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/ec.py -> build/lib.linux-x86_64-2.7/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/hashes.py -> build/lib.linux-x86_64-2.7/cryptography/hazmat/backends/openssl
  running egg_info
  writing requirements to src/cryptography.egg-info/requires.txt
  writing src/cryptography.egg-info/PKG-INFO
  writing top-level names to src/cryptography.egg-info/top_level.txt
  writing dependency_links to src/cryptography.egg-info/dependency_links.txt
  reading manifest file 'src/cryptography.egg-info/SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  no previously-included directories found matching 'docs/_build'
  warning: no previously-included files found matching 'vectors'
  warning: no previously-included files matching '*' found under directory 'vectors'
  warning: no previously-included files found matching 'azure-pipelines.yml'
  warning: no previously-included files found matching '.azure-pipelines'
  warning: no previously-included files found matching '.travis.yml'
  warning: no previously-included files found matching '.travis'
  warning: no previously-included files matching '*' found under directory '.azure-pipelines'
  warning: no previously-included files matching '*' found under directory '.travis'
  warning: no previously-included files found matching 'release.py'
  warning: no previously-included files found matching '.coveragerc'
  warning: no previously-included files found matching 'codecov.yml'
  warning: no previously-included files found matching 'dev-requirements.txt'
  warning: no previously-included files found matching 'rtd-requirements.txt'
  warning: no previously-included files found matching 'tox.ini'
  writing manifest file 'src/cryptography.egg-info/SOURCES.txt'
  running build_ext
  generating cffi module 'build/temp.linux-x86_64-2.7/_padding.c'
  creating build/temp.linux-x86_64-2.7
  generating cffi module 'build/temp.linux-x86_64-2.7/_constant_time.c'
  generating cffi module 'build/temp.linux-x86_64-2.7/_openssl.c'
  building '_openssl' extension
  creating build/temp.linux-x86_64-2.7/build
  creating build/temp.linux-x86_64-2.7/build/temp.linux-x86_64-2.7
  i686-linux-gnu-gcc -pthread -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-Avp9ce/python2.7-2.7.17=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c build/temp.linux-x86_64-2.7/_openssl.c -o build/temp.linux-x86_64-2.7/build/temp.linux-x86_64-2.7/_openssl.o -Wconversion -Wno-error=sign-conversion
  build/temp.linux-x86_64-2.7/_openssl.c:498:10: fatal error: openssl/opensslv.h: No such file or directory
   #include <openssl/opensslv.h>
            ^~~~~~~~~~~~~~~~~~~~
  compilation terminated.
  error: command 'i686-linux-gnu-gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for cryptography
Successfully built tornado
Failed to build cryptography
ERROR: Could not build wheels for cryptography which use PEP 517 and cannot be installed directly
The command '/bin/sh -c pip install butterfly' returned a non-zero code: 1

Provide linux/arm64/v8 Docker images

Hey there,

really like this project. Could you please also provide Docker images for linux/arm64/v8, too?
This would allow users of a MacBook with Apple Silicon CPUs to also use the images.

Thanks

Docker containers of java labs don't work

Identifier

SQLI

Title

Java docker labs are not reproducibles

Description

I built the java/sqli lab using Docker but the container complains that db page doesn't exists.

cd java/sqli
docker build -t sfk-java-sqli --platform linux/amd64 .
docker run --rm -p 5000:5000 sfk-java-sqli

When I click on "Welcome" or "About us" links, application fails. Below the log from the container:

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::       (v2.7.0-SNAPSHOT)

2022-11-28 22:32:03.536  INFO 1 --- [           main] com.skf.labs.sqli.SqliApplication        : Starting SqliApplication v0.0.1-SNAPSHOT using Java 1.8.0_212 on 90a75471d096 with PID 1 (/skf/target/app.jar started by spring in /skf)
2022-11-28 22:32:03.559  INFO 1 --- [           main] com.skf.labs.sqli.SqliApplication        : No active profile set, falling back to 1 default profile: "default"
2022-11-28 22:32:05.891  INFO 1 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 5000 (http)
2022-11-28 22:32:05.939  INFO 1 --- [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2022-11-28 22:32:05.940  INFO 1 --- [           main] org.apache.catalina.core.StandardEngine  : Starting Servlet engine: [Apache Tomcat/9.0.63]
2022-11-28 22:32:06.410  INFO 1 --- [           main] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2022-11-28 22:32:06.412  INFO 1 --- [           main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 2692 ms
2022-11-28 22:32:06.730  INFO 1 --- [           main] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Starting...
2022-11-28 22:32:06.904  INFO 1 --- [           main] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Start completed.
2022-11-28 22:32:07.337  INFO 1 --- [           main] o.s.b.a.w.s.WelcomePageHandlerMapping    : Adding welcome page template: index
2022-11-28 22:32:07.887  INFO 1 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 5000 (http) with context path ''
2022-11-28 22:32:07.923  INFO 1 --- [           main] com.skf.labs.sqli.SqliApplication        : Started SqliApplication in 5.798 seconds (JVM running for 6.94)
2022-11-28 22:32:20.597  INFO 1 --- [nio-5000-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring DispatcherServlet 'dispatcherServlet'
2022-11-28 22:32:20.597  INFO 1 --- [nio-5000-exec-1] o.s.web.servlet.DispatcherServlet        : Initializing Servlet 'dispatcherServlet'
2022-11-28 22:32:20.602  INFO 1 --- [nio-5000-exec-1] o.s.web.servlet.DispatcherServlet        : Completed initialization in 3 ms
2022-11-28 22:32:24.042 ERROR 1 --- [nio-5000-exec-2] o.a.c.c.C.[.[.[/].[dispatcherServlet]    : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.jdbc.UncategorizedSQLException: StatementCallback; uncategorized SQLException for SQL [SELECT pageId, title, content FROM pages WHERE pageId=2]; SQL state [null]; error code [1]; [SQLITE_ERROR] SQL error or missing database (no such table: pages); nested exception is org.sqlite.SQLiteException: [SQLITE_ERROR] SQL error or missing database (no such table: pages)] with root cause

org.sqlite.SQLiteException: [SQLITE_ERROR] SQL error or missing database (no such table: pages)
        at org.sqlite.core.DB.newSQLException(DB.java:1012) ~[sqlite-jdbc-3.36.0.1.jar!/:na]
        at org.sqlite.core.DB.newSQLException(DB.java:1024) ~[sqlite-jdbc-3.36.0.1.jar!/:na]
        at org.sqlite.core.DB.throwex(DB.java:989) ~[sqlite-jdbc-3.36.0.1.jar!/:na]
        at org.sqlite.core.NativeDB.prepare_utf8(Native Method) ~[sqlite-jdbc-3.36.0.1.jar!/:na]
        at org.sqlite.core.NativeDB.prepare(NativeDB.java:134) ~[sqlite-jdbc-3.36.0.1.jar!/:na]
        at org.sqlite.core.DB.prepare(DB.java:257) ~[sqlite-jdbc-3.36.0.1.jar!/:na]
        at org.sqlite.jdbc3.JDBC3Statement.executeQuery(JDBC3Statement.java:66) ~[sqlite-jdbc-3.36.0.1.jar!/:na]
        at com.zaxxer.hikari.pool.ProxyStatement.executeQuery(ProxyStatement.java:110) ~[HikariCP-4.0.3.jar!/:na]
        at com.zaxxer.hikari.pool.HikariProxyStatement.executeQuery(HikariProxyStatement.java) ~[HikariCP-4.0.3.jar!/:na]
        at org.springframework.jdbc.core.JdbcTemplate$1QueryStatementCallback.doInStatement(JdbcTemplate.java:452) ~[spring-jdbc-5.3.20.jar!/:5.3.20]
        at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:381) ~[spring-jdbc-5.3.20.jar!/:5.3.20]
        at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:465) ~[spring-jdbc-5.3.20.jar!/:5.3.20]
        at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:475) ~[spring-jdbc-5.3.20.jar!/:5.3.20]
        at com.skf.labs.sqli.SqliModel.getPage(SqliModel.java:18) ~[classes!/:0.0.1-SNAPSHOT]
        at com.skf.labs.sqli.SqliController.home(SqliController.java:18) ~[classes!/:0.0.1-SNAPSHOT]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_212]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_212]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_212]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_212]
        at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205) ~[spring-web-5.3.20.jar!/:5.3.20]
        at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:150) ~[spring-web-5.3.20.jar!/:5.3.20]
        at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:117) ~[spring-webmvc-5.3.20.jar!/:5.3.20]
        at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895) ~[spring-webmvc-5.3.20.jar!/:5.3.20]
        at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:808) ~[spring-webmvc-5.3.20.jar!/:5.3.20]
        at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) ~[spring-webmvc-5.3.20.jar!/:5.3.20]
        at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1067) ~[spring-webmvc-5.3.20.jar!/:5.3.20]
        at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:963) ~[spring-webmvc-5.3.20.jar!/:5.3.20]
        at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006) ~[spring-webmvc-5.3.20.jar!/:5.3.20]
        at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:898) ~[spring-webmvc-5.3.20.jar!/:5.3.20]
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:655) ~[tomcat-embed-core-9.0.63.jar!/:na]
        at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883) ~[spring-webmvc-5.3.20.jar!/:5.3.20]
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:764) ~[tomcat-embed-core-9.0.63.jar!/:na]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227) ~[tomcat-embed-core-9.0.63.jar!/:na]
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) ~[tomcat-embed-core-9.0.63.jar!/:na]
        at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) ~[tomcat-embed-websocket-9.0.63.jar!/:na]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) ~[tomcat-embed-core-9.0.63.jar!/:na]
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) ~[tomcat-embed-core-9.0.63.jar!/:na]
        at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) ~[spring-web-5.3.20.jar!/:5.3.20]
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.20.jar!/:5.3.20]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) ~[tomcat-embed-core-9.0.63.jar!/:na]
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) ~[tomcat-embed-core-9.0.63.jar!/:na]
        at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) ~[spring-web-5.3.20.jar!/:5.3.20]
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.20.jar!/:5.3.20]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) ~[tomcat-embed-core-9.0.63.jar!/:na]
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) ~[tomcat-embed-core-9.0.63.jar!/:na]
        at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) ~[spring-web-5.3.20.jar!/:5.3.20]
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.20.jar!/:5.3.20]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) ~[tomcat-embed-core-9.0.63.jar!/:na]
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) ~[tomcat-embed-core-9.0.63.jar!/:na]
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:197) ~[tomcat-embed-core-9.0.63.jar!/:na]
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97) [tomcat-embed-core-9.0.63.jar!/:na]
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541) [tomcat-embed-core-9.0.63.jar!/:na]
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:135) [tomcat-embed-core-9.0.63.jar!/:na]
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) [tomcat-embed-core-9.0.63.jar!/:na]
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78) [tomcat-embed-core-9.0.63.jar!/:na]
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:360) [tomcat-embed-core-9.0.63.jar!/:na]
        at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:399) [tomcat-embed-core-9.0.63.jar!/:na]
        at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) [tomcat-embed-core-9.0.63.jar!/:na]
        at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:890) [tomcat-embed-core-9.0.63.jar!/:na]
        at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1743) [tomcat-embed-core-9.0.63.jar!/:na]
        at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-embed-core-9.0.63.jar!/:na]
        at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191) [tomcat-embed-core-9.0.63.jar!/:na]
        at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) [tomcat-embed-core-9.0.63.jar!/:na]
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-9.0.63.jar!/:na]
        at java.lang.Thread.run(Thread.java:748) [na:1.8.0_212]

^C2022-11-28 22:32:26.633  INFO 1 --- [ionShutdownHook] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Shutdown initiated...
2022-11-28 22:32:26.660  INFO 1 --- [ionShutdownHook] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Shutdown completed.

However, if I run the container using the image from Docker registry, the app works perfectly:

docker pull blabla1337/owasp-skf-lab:java-sqli
docker run --rm -p 5000:5000 blabla1337/owasp-skf-lab:java-sqli

I inspected the two images with container-diff tool and indeed dependencies are different...

container-diff diff daemon://sfk-java-sqli blabla1337/owasp-skf-lab:java-sqli --type=file > diff.txt

Language(s)

No response

Difficulty

No response

Containerized apps run as root

It is inherently risky to run containerized applications as root, as is outlined in many "container escape" documents.

Yes, in many cases the container will need to run in "privileged" mode, but we cannot guarantee that students will never do this. So, it's better to protect students against themselves! Let's consider refactoring our lab containers to run as non-root user. Let's lead by example! :)

Wrong amount of hints in XSS Labs

<h2 align="center">Hint <span id="hint-num">0</span>/3 (<button

There are 0/3 hints shown, but when i try to open the hints, i can only open 2 hints, because there are only 2 list elements (in line 53-58). Is there missing a third list element, or should there just be 2 hints?

The problem also ocures in the following files:
https://github.com/blabla1337/skf-labs/blob/98c6426c54d3d00d0bbc3fce518c5c70beb98996/XSS-attribute/templates/index.html
https://github.com/blabla1337/skf-labs/blob/98c6426c54d3d00d0bbc3fce518c5c70beb98996/XSS-DOM/templates/index.html
https://github.com/blabla1337/skf-labs/blob/e8a833b4b56ae02a87957b40999e998f33dd4eb1/XSS/templates/index.html
https://github.com/blabla1337/skf-labs/blob/98c6426c54d3d00d0bbc3fce518c5c70beb98996/XSS-DOM-2/templates/index.html

Update documentation screenshots (WIP)

SKF write-up images

The SKF has a LOT of write-ups about different vulnerabilities.
The problem is that recently we updated the look and feel of the labs, but the
screenshots remain the same.

To have more coherent documentation we need to update the old screenshots:

spaces_-LVYiEUhSeJlr6AAhtYG_uploads_git-blob-3228269c0a14a60b32afe2534fca5002a3a53dcf_Screen Shot 2019-01-29 at 12 58 36

To the new look and feel of the labs:

Screenshot 2022-10-14 at 11 36 27

Getting started

Goto SKF

The easiest way to get started is to visit and log in with GitHub or register an account.

OWASP/OSSF SKF

Then Navigate to the "Labs" tab

There you will find a table with "write-up" and "action" Columns

Screenshot 2022-10-14 at 11 42 39

Following the write-up column:

The write-ups take you to our Gitbook where you find the write-up written for 3 different programming languages.
You can pick any one of them since they all share the same images. These images are stored in the "SKF-labs"

requirements.txt incorrect in SSRF, RFI, Url-redirection

Unable to build the docker images for SSRF, RFI, URL-redirection because the "validators" version specified in the requirements.txt does not exist.

docker build -t ssrf SSRF/Docker/
Sending build context to Docker daemon  2.048kB
Step 1/7 : FROM alpine:3.7
 ---> bc8fb6e6e49d
Step 2/7 : MAINTAINER Giulio Comi
 ---> Using cache
 ---> f5ef76b8b8bf
Step 3/7 : RUN apk update --no-cache && apk add python3 python3-dev py3-pip git bash netcat-openbsd
 ---> Using cache
 ---> 4ae90dd601e8
Step 4/7 : RUN git clone https://github.com/blabla1337/skf-labs.git
 ---> Using cache
 ---> 6be4363501a1
Step 5/7 : WORKDIR /skf-labs/SSRF
 ---> Using cache
 ---> 4eaca1517fe3
Step 6/7 : RUN pip3 install -r requirements.txt
 ---> Running in 204ea6caf329
Collecting Flask==0.10.1 (from -r requirements.txt (line 1))
  Downloading https://files.pythonhosted.org/packages/db/9c/149ba60c47d107f85fe52564133348458f093dd5e6b57a5b60ab9ac517bb/Flask-0.10.1.tar.gz (544kB)
Collecting flask-cors==3.0.7 (from -r requirements.txt (line 2))
  Downloading https://files.pythonhosted.org/packages/65/cb/683f71ff8daa3aea0a5cbb276074de39f9ab66d3fbb8ad5efb5bb83e90d2/Flask_Cors-3.0.7-py2.py3-none-any.whl
Collecting requests==2.19.1 (from -r requirements.txt (line 3))
  Downloading https://files.pythonhosted.org/packages/65/47/7e02164a2a3db50ed6d8a6ab1d6d60b69c4c3fdf57a284257925dfc12bda/requests-2.19.1-py2.py3-none-any.whl (91kB)
Collecting validators==1.12.0 (from -r requirements.txt (line 4))
  Could not find a version that satisfies the requirement validators==1.12.0 (from -r requirements.txt (line 4)) (from versions: 0.1.0, 0.2.0, 0.3.0, 0.4.0, 0.5.0, 0.6.0, 0.7, 0.8, 0.9, 0.10, 0.10.1, 0.10.2, 0.10.3, 0.11.0, 0.11.1, 0.11.2, 0.11.3, 0.12.0, 0.12.1, 0.12.2, 0.12.3, 0.12.4)
No matching distribution found for validators==1.12.0 (from -r requirements.txt (line 4))
You are using pip version 9.0.3, however version 19.0.3 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
The command '/bin/sh -c pip3 install -r requirements.txt' returned a non-zero code: 1

Labs 2.0 - Tour add-on

Add for the labs a Tour helper to explain the different Menu items and objective of the Lab. We could use something like this:
https://introjs.com

Explain the lab first and how to start exploiting it.
Then we can explain the CodeQL part to write a detection rule
Then we can explain the editor and implement the fix for the specific vulnerability

SKF Labs containers needlessly large

You may have noticed pull request 115 -> #115

I've been going over a few of your Docker files to make sure that the containers we produce are as small as possible. For students with limited resources (young students, developing countries, little expendable income) storage space can come at a premium. Shrinking our requirements by 60% seems like a very user-friendly thing to do.

With my proposed refactoring, our resulting containers go down from an average 330MB to ~77MB.

The biggest factor in the current ~330MB size per container, lies in the fact that the whole SKF Labs Git repo is pulled into the container and then never removed. By refactoring the Dockerfile to git pull, and then only copying the needed content, it's a huge space-saver already.

Another nice way to save space on our layers is to combine into one RUN the apk add, the pip intall and the apk del to immediately remove unneeded packages.

In the past, some of our students complained that editing the source files with all the ^M (Windows) line endings in place is troublesome. These occur, depending on whom built the container where. To resolve this issue I've started including dos2unix into each Dockerfile, to clean up any scripts and other text-based files. I'm considering adding nano into the containers for those completely unfamiliar with vi.

Please let me know if you'd like me to continue these activities.

Unable to pull owasp-skf-lab docker image

docker pull blabla1337/owasp-skf-lab
Using default tag: latest
Error response from daemon: manifest for blabla1337/owasp-skf-lab:latest not found: manifest unknown: manifest unknown

Labs 2.0 - Menu add-on Proxy

Menu add-on Proxy for all the labs

For the labs we want to add a light weight browser proxy to be able to modify the requests in the browser itself without the need to setup a local HTTP intercepting proxy. The last request done from the application point of view would be visible in the HTTP proxy tab, for example:
ski-proxy

From here the user can already modify the content, headers, cookies, GET, POST and so on to make it easier to start testing properly using only the browser as a tool.

Labs 2.0 - Menu add-on CodeQL

Menu add-on CodeQL for all the labs

For the labs we want to add a light weight browser editor to be able to create CodeQL queries and run these against the lab to detect the exploited vulnerability in the lab. For example:
ski-codeql

With this improvement we can also use the lab environment to practise the CodeQL skillset and gain experience in writing queries.

Thoughts on restructuring challenges and writeups

Right now all the challenges and writeups are not properly structured so it would be nice if we restructure them into two directories named challenges and writeups.

For this change to take place we will have to do the following:

  • Change writeups URL in SUMMARY.md file.
  • Change path of a challenge inside all the docker files.

@blabla1337 What are your thoughts on this. If you think this is a valid issue then I'd be happy to work on this.

Gettong an error while installing Infra labs.

Hi there!
I am trying to install your infra labs in Ubuntu and Windows 10 and Windows 11. I am facing an error as given below,

For Basic Lab 1
image

For Basic Lab 2
image

Also, I have tried with /start.sh to add #!/bin/bash and #!/bin/sh

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.