Understanding Preflight OPTIONS Requests: The CORS Gatekeeper

Browsers enforce the same-origin policy to prevent malicious cross-site requests. Preflight acts as a “handshake” before sensitive requests, asking: “Server, are you cool with this?” 🔥 Triggers for Preflight: Non-simple HTTP methods (PUT, DELETE, PATCH) Custom headers (e.g., X-API-Token) “Advanced” Content-Types (e.g., application/json) Credentialed requests (with cookies/auth) ✅ Simple requests (GET/POST with basic headers) skip preflight! 🔁 How Preflight Works: A 2-Step Dance sequenceDiagram Browser->>Server: OPTIONS Request (Preflight) Note left of Browser: Headers sent:<br>📍 Origin<br>📍 Access-Control-Request-Method<br>📍 Access-Control-Request-Headers alt Server Allows Server-->>Browser: 200 OK + CORS Headers Note right of Server: Headers returned:<br>✅ Access-Control-Allow-Origin<br>✅ Access-Control-Allow-Methods<br>✅ Access-Control-Allow-Headers Browser->>Server: Actual Request (e.g., DELETE) else Server Denies Server-->>Browser: CORS Error Blocked! end ⚙️ Server-Side Setup Essentials Handle OPTIONS requests correctly: ...

October 21, 2025 · 2 min · 309 words · 0xuki

Mastering .NET Reverse Engineering with dnSpy: A Security Professional's Guide

Reverse Engineering Malicious Binaries Step 1: Initial Triage Load suspect .dll/.exe into dnSpy Use Assembly Explorer to identify: Suspicious imports (e.g., System.IO.Compression for packed payloads) Obfuscation markers (ConfuserEx, Eazfuscator strings) Embedded resources (malicious scripts) Step 2: Deobfuscation Workflow // Before deobfuscation public string Decode(string input) { return Encoding.UTF8.GetString(Convert.FromBase64String(input).Reverse().ToArray()); } // After using dnSpy's "Simplify" feature: public string Decode(string input) => "FLARE-ON_2023"; // Revealed C2 domain Techniques: Right-click → Analyze to detect crypto routines Ctrl+Shift+R to rename obfuscated variables Export decrypted resources via Save Code Debugging for Vulnerability Research Exploiting Logic Flaws Set breakpoints at authentication methods Modify return values in Debug > Windows > Immediate: // Change authentication result ? isAdmin = true // Bypasses access checks Trace insecure deserialization paths (e.g., BinaryFormatter usage) Extracting Secrets Use Memory Window during execution to: Dump RSA private keys from CSP containers Capture DPAPI-protected credentials Extract hardcoded API tokens Binary Patching for Exploit Development Scenario: Craft PoC for license check bypass ...

June 13, 2025 · 3 min · 462 words · Your Name Here

Source to Sink: Core Penetration Testing Approach

🎯 1. Investigating Blind Spots in Authenticated Areas 🚩 Source: Parameters in authenticated functionality ⚠️ Sink: Privileged operations user_id = request.form['user_id'] # 🚩 Source db.execute(f"DELETE FROM users WHERE id = {user_id}") # ⚠️ Sink 🔗 Attack Flow: Source → Privilege bypass → Sink 🧼 2. Input Sanitization Analysis 🚩 Source: User input fields ⚠️ Sink: Rendering functions const userComment = req.body.comment; // 🚩 Source const sanitized = userComment.replace('<script>', ''); // 🛑 Vulnerable res.send(`<div>${sanized}</div>`); // ⚠️ Sink 🔗 Attack Vector: Source → Weak sanitization → Sink ...

June 6, 2025 · 2 min · 326 words · 0xuki

Node.js Buffer Objects: A Comprehensive Guide to Binary Data Manipulation

“Buffer Objects” 🔄 — A concept that every Node.js developer inevitably encounters. While its presence is felt in file operations, network communications, image processing, and more, many developers find themselves wondering: “How do I use it?” and “Why is it necessary?” In this article, we’ll thoroughly explain everything from Buffer’s fundamental role to practical applications, accompanied by real-world code examples. Understanding Buffer: Diving into the World of Binary Data 🎯 Binary Data Fundamentals “Raw Sequence of 0s and 1s” ...

May 22, 2025 · 4 min · 756 words · 0xuki

webpack: The Core Tool for Modern Front-End Development

If you’re involved in front-end development, webpack is a name you can’t ignore. While its configuration complexity often intimidates newcomers, understanding its core principles unlocks unparalleled control over your build process. This article dives into webpack’s architecture, advanced configurations, and industry best practices. 📦 Understanding Module Bundling webpack is a JavaScript module bundler designed to resolve dependencies and optimize assets. Unlike traditional task runners, it constructs a dependency graph to bundle: ...

May 16, 2025 · 3 min · 447 words · 0xuki

The Ultimate Guide to Handlebars Template Engine: From Fundamentals to Expert Practices

Handlebars is a logic-less templating engine for JavaScript, designed to generate dynamic HTML/text content. Built as an extension of Mustache, it combines simplicity with powerful features like custom helpers and precompilation, making it suitable for both frontend (e.g., React, Vue) and backend (Node.js) workflows. Key Features: 📌 Expression Embedding: {{variable}} 🔄 Built-in Helpers: #if, #each, #with ⚡ Precompilation: Up to 7x faster runtime performance 🛠️ Extensibility: Custom helper functions and partials 💻 Core Syntax & Usage 1. Variable Embedding <h1>{{title}}</h1> <p>{{user.profile.bio}}</p> Outputs escaped HTML by default to prevent XSS. ...

May 14, 2025 · 3 min · 465 words · 0xuki

Mastering EJS: The Ultimate Guide to JavaScript Templating Engine

In frontend development or Node.js server-side rendering, templating engines are powerful tools for dynamic HTML generation. Among them, EJS (Embedded JavaScript Templates) stands out. Let’s explore its features, core syntax, and practical use cases! 🔥 Key Features of EJS ✅ HTML-like Syntax: Embeds JavaScript directly into HTML—easy to learn! ✅ Flexibility: Supports conditionals, loops, and partial templates. ✅ Dual Compatibility: Works in browsers and Node.js environments. ✅ Lightweight: Blazing-fast performance with minimal setup. 📜 Basic Syntax Crash Course 1️⃣ Output Escaped Variables <h1><%= title %></h1> <%= %> escapes HTML to prevent XSS attacks. ...

May 11, 2025 · 3 min · 487 words · 0xuki

Getting Started with Devin AI: A Beginner's Guide 🚀

Devin is an AI software engineer that can help you with coding tasks, debugging issues, and building features. Think of Devin as your coding assistant that understands programming languages and development workflows! How to Start Using Devin 🏁 1. Setting Up Your First Session 💻 Starting with Devin is easy: Log into the Devin web app Click “New Session” to start a conversation Describe your task or problem in natural language 2. Communicating with Devin 💬 Devin understands plain English, so you can: ...

May 10, 2025 · 2 min · 307 words · 0xuki

Reverse Image Search: Technical Deep Dive and Advanced Applications

Reverse Image Search (RIS) is a retrieval technology that uses visual input (images) as queries to identify similar images, contextual information, or metadata. Unlike text-based searches, RIS relies on analyzing low-level and high-level image features, enabling applications in copyright enforcement, counterfeit detection, academic research, and more. ❷ Underlying Technology: CBIR Content-Based Image Retrieval (CBIR) forms the backbone of RIS systems. Key processes include: Feature Extraction: Algorithms (e.g., CNNs, SIFT, SURF) analyze color histograms, texture patterns, edges, and semantic content. Indexing and Hashing: Features are converted into compact hash codes (e.g., perceptual hashing) for efficient database comparisons. Similarity Metrics: Cosine similarity, Euclidean distance, or deep metric learning quantify image resemblance. Example: Google Vision API employs a hybrid architecture combining Vision Transformers (ViTs) and approximate nearest neighbor (ANN) search for real-time scalability. ...

May 9, 2025 · 3 min · 526 words · 0xuki

Unmasking Prototype Pollution: A Deep Dive into the Mechanics and Mitigation Strategies

In the evolving landscape of web application security, Prototype Pollution has emerged as a sophisticated and potentially critical vulnerability, particularly within JavaScript environments. Exploiting the inherent prototypal inheritance mechanism of JavaScript, this attack vector allows malicious actors to inject or overwrite properties in the prototypes of objects, leading to unexpected and often detrimental consequences for the application’s integrity and security. This article provides an in-depth exploration of Prototype Pollution, dissecting its operational principles, potential impacts, and the comprehensive strategies required for effective mitigation. A solid understanding of this vulnerability is paramount for security professionals and developers striving to build resilient and secure web applications. ...

May 7, 2025 · 5 min · 979 words · 0xuki