Posts

Showing posts with the label Web Security

[pwncollege] Path Traversal 1 write-up

Image
Exploiting Path Traversal Vulnerabilities: A Step-by-Step Guide Exploiting Path Traversal Vulnerabilities: A Step-by-Step Guide Introduction Path traversal is a common web vulnerability that allows attackers to access files outside the intended directory. In this guide, we'll explore how to exploit and prevent this vulnerability using a real-world example. The Challenge The challenge involves a Flask-based web server that serves files from the /challenge/files directory. The server is vulnerable to path traversal due to improper handling of user input in the URL path. Server Code #!/opt/pwn.college/python import flask import os app = flask.Flask(__name__) @app.route("/files", methods=["GET"]) @app.route("/files/ ", methods=["GET"]) def challenge(path="index.html"): requested_path = app.root_path + "/files/" + path ...

Web Security the Same Origin Policy

Image
Understanding the Same Origin Policy and Its Implications Understanding the Same Origin Policy and Its Implications Introduction to the Same Origin Policy The internet is an intricate web of data, allowing us to interact with various websites and services. How browsers handle requests across different origins is critical for maintaining security... What is the Same Origin Policy? The Same Origin Policy is a security measure implemented in browsers that restricts cross-origin interactions. An origin comprises three components: Scheme: Protocol (e.g., HTTP/HTTPS) Host: Domain or IP address Port: Communication endpoint (e.g., 80, 443) Defining an Origin Examples of different origins: http://example.com vs. https://example.com (different schemes) http://sub.example.com vs. http://example.com:8080 (different host/port) How the Same Origin Poli...

Web Security Injection

Image
Understanding Injection Vulnerabilities in Web Security Understanding Injection Vulnerabilities in Web Security Introduction Injection vulnerabilities are one of the most critical issues in web security, affecting numerous websites, applications, and systems... What is Injection Vulnerability? Injection vulnerabilities arise when an untrusted source (like user input) is inserted or "injected" into a command or data structure without proper validation... Types of Injection Vulnerabilities Command Injection What is Command Injection? Command injection occurs when an attacker injects malicious commands through a parameter that the application passes to the operating system's command parser... How Command Injection Works ; ls -la This input leverages the shell's command parsing capability, allowing the attacker to list files and directories on the serve...

Web Security SQL

Image
Understanding SQL: The Essential Guide for Beginners Understanding SQL: The Essential Guide for Beginners Introduction In the digital age, understanding how to manipulate and manage data is crucial... What is SQL? SQL, or Structured Query Language, is a standardized programming language designed for managing relational databases... The Structure of a Database Databases: The overarching container for data Tables: Collections of related data Rows and Columns: Records and data attributes Getting Started with SQL Operations 1. Creating Tables CREATE TABLE users (username VARCHAR(255), password VARCHAR(255)); 2. Inserting Data INSERT INTO users (username, password) VALUES ('admin', 'admin'); 3. Querying Data SELECT * FROM users; Advanced SQL Operations 1. Union Operation...

Web Security introduction

Image
Understanding Web Security: Essentials for Safe Applications Understanding Web Security: Essentials for Safe Applications Introduction to Web Security The digital landscape offers a plethora of opportunities and convenience, especially in sectors such as online banking. However, this increased accessibility also opens doors for malicious activities, making web security a paramount concern. In this blog post, we delve into the intricate world of web security, focusing on its principles, best practices, and the balance that must be struck between security and usability. What is Web Security? Web security encompasses the measures taken to protect websites and online services from unauthorized access and attacks. The core purpose is to prevent crimes like online banking fraud, data breaches, and various forms of cyberattacks. A strong web security framework ensures that sensitive information remains confidential, preventing harm...