Hugo Cheat Sheet

Hugo is a fast static site generator written in Go. Here are its key features: ⚡ Ultra-fast build speed 📦 Simple installation and configuration 🎨 Rich themes and customization options 📝 Content management with Markdown 🔄 Hot reload for improved development efficiency 🌐 Multi-language support 🛠️ Rich shortcodes and template functionality Hugo can be used for various purposes such as blogs, portfolios, and documentation sites. 🚀 Installing Hugo While homebrew is the standard installation method, we’ll use the tar ball for better security considerations. ...

August 20, 2024 · 2 min · 310 words · 0xuki

Complete Guide to Machine Learning Model Evaluation Methods

Core Data Concepts in Model Evaluation 📊 Training Set: Dataset used to train machine learning models (parameter optimization) Validation Set: Dataset used for hyperparameter tuning and model selection during development Test Set: Dataset reserved exclusively for assessing generalization performance → Used for final model evaluation after development completion Evaluation Methodologies Holdout Method Randomly splits the dataset into two mutually exclusive subsets: Typical split: 80% training / 20% testing (ratio varies by use case) Strengths: Computationally efficient, simple implementation Limitations: High variance in performance estimates with small datasets k-Fold Cross-Validation Systematic evaluation protocol: Partition dataset into k equal-sized folds Iteratively use each fold as validation set while training on remaining k-1 folds Aggregate results (mean ± standard deviation) across all folds Key Advantages: Reduces variance in performance estimates Maximizes data utilization (critical for small datasets) Common Variants: Stratified k-fold (preserves class distribution) Leave-One-Out Cross-Validation (LOOCV) Extreme case of k-fold where k = n (number of samples) Use Case: Small-scale datasets with <100 samples Tradeoff: Computationally prohibitive for large n (requires n model fits)

August 1, 2024 · 1 min · 172 words · 0xuki

HTTP Request Smuggling (HRS)

Understanding HTTP Request Smuggling: A Deep Dive into Web Security In the dynamic world of web security, new threats and vulnerabilities continuously emerge, challenging the robustness of our digital infrastructures. Among these, HTTP request smuggling stands out as a complex yet intriguing exploit that targets the very foundations of how the web operates. This blog post aims to unravel the complexities of HTTP request smuggling, exploring its mechanisms, potential impacts, and effective countermeasures to safeguard against this sophisticated cyber threat. ...

April 20, 2024 · 3 min · 597 words · 0xuki

Cross-Origin Resource Sharing (CORS)

Understanding Cross-Origin Resource Sharing (CORS): A Beginner’s Guide In the world of web development, security is paramount. One crucial aspect of securing web applications is understanding how to manage Cross-Origin Resource Sharing, commonly known as CORS. This concept can be a bit daunting for beginners, so in this blog post, we’ll break down CORS in a way that’s easy to understand and implement. What is CORS? CORS is a security feature implemented by web browsers to prevent malicious websites from accessing resources from another domain without permission. Essentially, it allows web servers to define who can access their resources and how. It’s a policy used to relax the same-origin policy, which is a security measure that restricts how a document or script from one origin can interact with resources from another origin. ...

April 13, 2024 · 3 min · 597 words · 0xuki

CSRF Cross Site Request Forgery

Cross-Site Request Forgery (CSRF) What is CSRF? Cross-Site Request Forgery (CSRF) is a type of attack that forces a logged-in user to perform unwanted actions on a web application. The attacker tricks the user into submitting a malicious request to the web application, which the application then executes as if it were coming from the legitimate user. How does CSRF work? There are two main ways that CSRF attacks can be carried out: ...

April 1, 2024 · 2 min · 362 words · 0xuki

CSRF Tokens

CSRF Tokens: A Comprehensive Guide for Security Professionals Introduction Cross-Site Request Forgery (CSRF) is a malicious attack that tricks a user’s browser into performing unintended actions on a trusted website where the user is logged in. This can lead to unauthorized data access, financial losses, and other serious consequences. How CSRF Attacks Work: Victim logs in: The victim logs into a trusted website (e.g., a bank) and their browser stores a session cookie. Attacker creates a malicious link or form: The attacker creates a link or form on a different website (e.g., a website they control or a compromised ad). Victim visits the attacker’s site: The victim is tricked into visiting the attacker’s website or clicking on the malicious link. Victim’s browser sends the cookie: When the victim interacts with the attacker’s website (e.g., clicking a link or submitting a form), their browser unknowingly sends the session cookie for the trusted website along with the request. Attacker leverages the cookie: The attacker’s website receives the victim’s session cookie and includes it in a request to the trusted website. Since the website sees a valid cookie, it assumes the request is coming from the legitimate user and performs the action embedded in the attacker’s request. What is a CSRF Token? ...

March 21, 2024 · 3 min · 475 words · 0xuki

Understanding Entropy and Information Theory in Machine Learning

Introduction 📚 This article explores the fundamental concepts of information theory, which form the mathematical foundation for many machine learning algorithms. Understanding these concepts is crucial for grasping how models process and learn from data. Information Quantity When an event A occurs with probability P(A), the information quantity I(A) measures how much information we gain from observing this event: $ I(A) = -\log P(A)$ Key insight: Rare events carry more information than common ones. This makes intuitive sense - learning that a rare event occurred tells us more than learning about a common event. ...

March 20, 2024 · 2 min · 321 words · 0xuki

Understanding Idle Scan: Mechanism and Characteristics

Idle Scan is an advanced TCP port scanning technique. In this method, an attacker uses a “zombie” computer (a machine in an idle state) to perform port scanning on target systems. 🎯 Basic Concepts Idle Scan is based on three important facts: TCP Port State Verification Open port → Responds with SYN/ACK packet Closed port → Responds with RST packet Unsolicited Packet Response Unsolicited SYN/ACK → Responds with RST Unsolicited RST → Ignored IP ID Characteristics ...

March 20, 2024 · 1 min · 205 words · 0xuki

JavaScript's Promise, Async, Await in 3 minutes

JavaScript’s Promise, Async, and Await: Mastering Asynchronous Programming JavaScript reigns supreme in web development, but handling asynchronous operations can introduce complexity. This is where Promise, Async, and Await come to the rescue. These powerful tools simplify and streamline asynchronous programming in JavaScript. Promise: A Placeholder for the Future A Promise represents the eventual outcome of an asynchronous operation. It exists in three states: Pending: The operation is still underway. Resolved: The operation completed successfully, and a result is available. Rejected: The operation encountered an error. Promises offer several advantages: ...

March 19, 2024 · 2 min · 345 words · 0xuki

Threat Intelligence

There are several categories of threat intelligence. https://info-savvy.com/types-of-threat-intelligence/ Technical Threat Intelligence Technical cyber intelligence involves collecting information about the attacker’s resources, such as command & control channels and tools. For example, it focuses on technical clues that indicate cybersecurity threats to phishing emails and malicious URLs. The goal is to collect information on specific IOCs (IP addresses, phishing email headers, hash checksums). This type of threat intelligence is important because it allows for the analysis of attacks. However, the value of technical threat intelligence is short-lived because hackers often change tactics. It is crucial to detect and analyze IOCs at the right time. Tactical intelligence is used by SOC team members. The information obtained here leads to new rules being written into the organization’s current security products (IDS/IP, firewalls, endpoint security systems, etc.). Suspicious IPs may also be detected from spam emails. The information obtained is directly fed back into the organization’s products. ...

March 10, 2024 · 3 min · 453 words · 0xuki