Giter Site home page Giter Site logo

yeswehack / vulnerable-code-snippets Goto Github PK

View Code? Open in Web Editor NEW
830.0 24.0 122.0 14.47 MB

Twitter vulnerable snippets

PHP 51.72% Python 16.59% Go 0.91% JavaScript 2.37% Shell 0.04% CSS 1.66% HTML 10.32% C 0.56% Dockerfile 13.90% Java 1.23% Ruby 0.71%
bugbounty snippets vulnerable owasp code example-code web-application websecurity worst-practices code-analyze

vulnerable-code-snippets's Introduction

YWH Logo Vulnerable Code Snippets

Vulnerable code snippet (Vsnippet) banner YesWeHack Github repository

Vulnerabilities | Programming languages | Run a vulnerable code snippet | Installation | Update

YesWeHack present code snippets containing several different vulnerabilities to practice your code analysis in a safe dockerized envoriment. The vulnerable code snippets are suitable for all skill levels.

~ New vulnerable code snippet at Twitter @yeswehack every Friday! ๐Ÿ—’

If you want to see something special or if you just have an idea about a vulnerable code snippet, feel free to create a "New Issue" where you explain your idea, no idea is stupid.


โš ๏ธ Be aware

Be sure to run this in a secure environment, as the code is vulnerable and is intended to be used for learning code analysis! By default, all vulnerable code snippets contain a docker setup that isolates the code from your host system and make it safe to run (read more in the section : "Run a vulnerable code snippet").

Twitter (X) posts

A Collection of all vulnerable code snippets posted on our Twitter ๐Ÿ“‚

ID Vulnerability Description
๐Ÿ“œ#1 SQLi & XSS Backslash filter collide
๐Ÿ“œ#2 Improper file access & XSS Invalid char and regex verificaion
๐Ÿ“œ#3 Log Forging injection, Path traversal & Code injection Poor filter and improper include() handling
๐Ÿ“œ#4 XSS Invalid user input filter
๐Ÿ“œ#5 SSRF & Broken authorization Trusted user input and client IP from header
๐Ÿ“œ#6 SSTI Mixed input format
๐Ÿ“œ#7 SQLi Use of invalid variable within statement
๐Ÿ“œ#8 CSRF No CSRF token included
๐Ÿ“œ#9 Open Redirect Invalid regex handler
๐Ÿ“œ#10 DOM XSS Backend filter collide with client side JavaScript
๐Ÿ“œ#11 CORS Misconfigured Access-Control-Allow header
๐Ÿ“œ#12 CSRF/ClickJacking GET request CSRF with insecure delete process / ClickJacking - X-Frame-Options set in HTML meta tag
๐Ÿ“œ#13 Path Traversal/Unrestricted File Upload Poor Path Traversal and file upload protection results in a code injection
๐Ÿ“œ#14 DOS Incorrect operator handler in "for loop"
๐Ÿ“œ#15 Weak Password Recovery Mechanism for Forgotten Password Weak hash for password recovery
๐Ÿ“œ#16 IDOR insecure if statement leads to improper access control
๐Ÿ“œ#17 Insecure deserialization Execute trusted user input inside pickle function loads()
๐Ÿ“œ#18 Path Traversal Improper user validation of filename
๐Ÿ“œ#19 Open Redirect Invalid handling of user-controlled input "location.hash"
๐Ÿ“œ#20 SQL injection Invalid use of function replace(), The char is only replaced once
๐Ÿ“œ#21 PostMessage DOM XSS No origin validation, leading to PostMessage DOM XSS
๐Ÿ“œ#22 XSS/OpenRedirect The filter protection does not filter all special characters that can be used to exploit the vulnerabilities
๐Ÿ“œ#23 Buffer overflow Take user's STDIN input with the gets() function without checking the buffer size
๐Ÿ“œ#24 SQL injection Incorrect use of the PHP function addslashes()
๐Ÿ“œ#25 XSS - CSP bypass No validation of user input along with insecure handling of nonce
๐Ÿ“œ#26 Path Traversal The filter provided by the PHP function "preg_replace()" is limited to filtering only the first 10 characters
๐Ÿ“œ#27 Web Cache Poisoning The HTTP header Referer is reflected in the cached response body without being filtered
๐Ÿ“œ#28 Business logic vulnerability An attacker can withdraw negative amounts to increase the overall balance of their account
๐Ÿ“œ#29 IDOR An attacker can gain access to sensitive data from other users by performing a Forced browsing attack
๐Ÿ“œ#30 Insecure deserialization Use of a dangerous function (exec) that can be controlled by the user, resulting in an RCE
๐Ÿ“œ#31 LFI No proper character escaping or filter verification. The include() function executes all PHP code in the given file, no matter the file extension, resulting in code injection
๐Ÿ“œ#32 Format injection! Format a string containing values provided by the client, resulting in a format injection
๐Ÿ“œ#33 SQL injection (second order) All SQL queries use prepared statements except the last one. This statement extracts a value from the database that was once controlled by the user and adds it to the SQL query, leading to an SQL injection (second order)
๐Ÿ“œ#34 Regular expression Denial of Service (ReDoS) Poorly configured regex pattern used to filter user-controlled input
๐Ÿ“œ#35 XSS Trusted user input in GET parameter
๐Ÿ“œ#36 Unrestricted File Upload Insufficient validation of the file extension of the uploaded file and missed validation of the file content
๐Ÿ“œ#37 SSRF Insecure handling of the proxy header X-Forwarded-Host and cURL leading to a full SSRF
๐Ÿ“œ#38 Code injection The user can write customised content to a selected file which is then launched on the vulnerable system
๐Ÿ“œ#39 LFI Exploitation of an LFI make it possible to run the tool pearcmd resulting in a remote code execution
๐Ÿ“œ#40 Unrestricted File Upload The php3 extension can be used to execute php code due to the configuration in the Apache proxy.
๐Ÿ“œ#41 New! ...

Vulnerabilities

Programming languages

Also included


Run a vulnerable code snippet

In each vulnerable code snippet (Vsnippet) folder there is a docker-compose.yml file. To start a Vsnippet in an isolated docker environment simply run the following command:

docker compose up --build

or

docker-compose up --build

Installation

git clone https://github.com/yeswehack/vulnerable-code-snippets.git

Update

To get the latest vulnerable code snippets, run:

git pull

~ H4v3 y0u f0und th3 E4st3r 3gg y3t? ๐Ÿ‡๐Ÿชบ

For questions, help or if you have discovered a problem with the code. Contact us on Twitter: @yeswehack ๐Ÿ“ฌ

vulnerable-code-snippets's People

Contributors

brumensywh 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vulnerable-code-snippets's Issues

Dockerize the project

Dockerizing the project would make it easier for people to run the snippets without installing PHP or MySQL on their systems.

We can potentially use Docker Compose to make it even easier.

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.