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 提供支持
在本页
  • 参数
  • 要扫描的IP
  • 设备发现
  • 端口扫描技术
  • 集中分析
  • 加快Nmap服务扫描速度 x16
  1. Generic Methodologies & Resources
  2. Pentesting Network

Nmap Summary (ESP)

上一页Network Protocols Explained (ESP)下一页Pentesting IPv6

最后更新于1年前

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

支持 HackTricks 的其他方式:

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

  • 获取

  • 探索 ,我们的独家

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

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

nmap -sV -sC -O -n -oA nmapscan 192.168.0.1/24

参数

要扫描的IP

  • <ip>,<net/mask>: 直接指定IP

  • -iL <ips_file>: 列出IPs

  • -iR <number>: 随机IP数量,可以使用 --exclude <Ips> 或 --excludefile <file> 排除可能的IP。

设备发现

默认情况下,Nmap启动一个发现阶段,包括:-PA80 -PS443 -PE -PP

  • -sL: 非侵入式,列出目标,通过DNS请求解析名称。用于了解例如 www.prueba.es/24 所有IP是否为我们的目标。

  • -Pn: 无ping。如果您知道它们都是活动的(否则,您可能会浪费很多时间,但此选项也会产生虚假负面结果,表示它们不活动),它可以防止发现阶段。

  • -sn : 无端口扫描。完成侦察阶段后,不扫描端口。相对隐蔽,允许进行小范围网络扫描。具有特权时,发送一个ACK(-PA)到80,一个SYN(-PS)到443,以及一个回显请求和一个时间戳请求,没有特权时总是完成连接。如果目标是网络,则仅使用ARP(-PR)。如果与另一个选项一起使用,则仅丢弃另一个选项的数据包。

  • -PR: ARP ping。在分析我们网络中的计算机时默认使用,比使用ping更快。如果不想使用ARP数据包,请使用 --send-ip。

  • -PS <ports>: 发送SYN数据包,如果回答SYN/ACK则为开放(回答RST以避免结束连接),如果回答RST则为关闭,如果不回答则为不可达。如果没有特权,则自动使用完整连接。如果未指定端口,则默认为80。

  • -PA <ports>: 与前一个类似,但使用ACK,结合两者可以获得更好的结果。

  • -PU <ports>: 目标相反,发送到预期关闭的端口。某些防火墙仅检查TCP连接。如果关闭,则回答端口不可达,如果回答其他ICMP或不回答,则保持为目标不可达。

  • -PE, -PP, -PM : ICMP PINGS: 回显回复,时间戳和地址掩码。用于确定目标是否活动。

  • -PY<ports>: 默认发送SCTP INIT探测到80,INIT-ACK(开放)或ABORT(关闭)或无回应或ICMP不可达(不活动)可以回复。

  • -PO <protocols>: 在标头中指定协议,默认为1(ICMP),2(IGMP)和4(Encap IP)。对于ICMP、IGMP、TCP(6)和UDP(17)协议,发送协议标头,对于其余协议仅发送IP标头。目的是由于标头的畸形,回答协议不可达或相同协议的响应,以了解其是否处于活动状态。

  • -n: 无DNS

  • -R: 始终DNS

端口扫描技术

  • -sS: 不完成连接,因此不留下痕迹,如果可以使用非常好(特权)。默认使用此选项。

  • -sT: 完成连接,因此会留下痕迹,但可以确保使用。默认情况下没有特权。

  • -sU: 较慢,用于UDP。主要用于:DNS(53), SNMP(161,162), DHCP(67和68), (-sU53,161,162,67,68): 开放(回复),关闭(端口不可达),过滤(其他ICMP),开放/过滤(无回应)。对于开放/过滤,-sV发送大量请求以检测nmap支持的任何版本,并可以检测真实状态。这会大大增加时间。

  • -sY: SCTP协议无法建立连接,因此没有日志,类似于-PY

  • -sN,-sX,-sF: Null, Fin, Xmas,可以穿透一些防火墙并提取信息。它们基于符合标准的机器应该用RST回复所有没有SYN、RST或ACK标志的请求:开放/过滤(无回应),关闭(RST),过滤(ICMP不可达)。在Windows、CIsco、BSDI和OS/400上不可靠。在Unix上是可靠的。

  • -sM: Maimon扫描:发送FIN和ACK标志,用于BSD,目前将所有返回为关闭。

  • -sA, sW: ACK和Window,用于检测防火墙,了解端口是否被过滤。-sW可以区分开放/关闭,因为开放的端口会用不同的窗口值回复:开放(带有非0窗口的RST),关闭(RST窗口=0),过滤(ICMP不可达或无回应)。并非所有计算机都按此方式工作,因此如果全部关闭,则不起作用,如果有一些开放,则正常工作,如果有许多开放和少数关闭,则反向工作。

  • -sI: 空闲扫描。对于存在主动防火墙但我们知道它不会过滤到某个IP的情况(或者当我们只是想要匿名时),我们可以使用僵尸扫描器(适用于所有端口),要查找可能的僵尸,我们可以使用脚本ipidseq或exploit auxiliary/scanner/ip/ipidseq。此扫描器基于IP数据包的IPID编号。

  • --badsum: 发送错误的校验和,计算机将丢弃数据包,但防火墙可能会回复,用于检测防火墙。

  • -sZ: “奇怪”的SCTP扫描器,当发送带有cookie回显片段的探测时,如果开放则应该被丢弃,如果关闭则应该回复ABORT。可以通过无法通过的防火墙,不好的是它不能区分过滤和开放。

  • -sO: 协议IP扫描。发送错误和空标头,有时甚至无法区分协议。如果收到ICMP不可达协议,则为关闭,如果收到不可达端口,则为开放,如果收到其他错误,则为过滤,如果没有收到任何内容,则为开放|过滤。

  • -b <server>: FTPhost--> 用于从另一台主机扫描主机,通过连接另一台机器的ftp,并要求其向您要扫描的端口发送文件,根据回复我们将知道它们是否开放。 [<user>:<password>@]<server>[:<port>] 几乎所有ftp服务器现在不允许您这样做,因此实用性很小。

集中分析

-p: 用于指定要扫描的端口。要选择65335个端口:-p- 或 -p all。Nmap根据其流行度有内部分类。默认使用前1000个端口。使用 -F(快速扫描)分析前100个端口。使用 --top-ports <number> 分析指定数量的主要端口(从1到65335)。按随机顺序检查端口,为了避免这种情况发生 -r。还可以选择端口:20-30,80,443,1024- 这最后意味着查看1024之后的端口。还可以按协议分组端口:U:53,T:21-25,80,139,S:9。还可以选择nmap中常用端口范围内的端口:-p [-1024] 分析nmap-services中包含的端口直到1024。--port-ratio <ratio> 分析常见端口,比率必须介于0和1之间。

-sV 版本扫描,可以调整强度从0到9,默认为7。

--version-intensity <numero> 调整强度,较低的强度只会发送最可能的探测,而不是全部。这样可以大大缩短UDP扫描时间。

-O 操作系统检测

--osscan-limit 要正确扫描主机,至少需要一个端口开放和一个关闭,如果不满足此条件并且已设置此选项,则不会尝试进行操作系统预测(节省时间) --osscan-guess 当操作系统检测不完美时,会增加工作量

脚本

--script <filename>|<category>|<directory>|<expression>[,...]

默认情况下使用-sC或--script=default

可用的类型有: auth, broadcast, default, discovery, dos, exploit, external, fuzzer, intrusive, malware, safe, version, and vuln

  • Auth: 运行所有可用于身份验证的脚本

  • Default: 运行工具的默认基本脚本

  • Discovery: 检索目标或受害者的信息

  • External: 用于使用外部资源的脚本

  • Intrusive: 使用被认为对受害者或目标具有侵入性的脚本

  • Malware: 检查是否存在恶意代码或后门打开的连接

  • Safe: 运行非侵入性脚本

  • Vuln: 发现最常见的漏洞

  • All: 运行所有可用的NSE扩展脚本

搜索脚本:

nmap --script-help="http-*" -> 以http-开头的脚本

nmap --script-help="not intrusive" -> 除了这些之外的所有脚本

nmap --script-help="default or safe" -> 在其中一个或两者中的脚本

nmap --script-help="default and safe" --> 同时存在的脚本

nmap --script-help="(default or safe or intrusive) and not http-*"

--script-args <n1>=<v1>,<n2>={<n3>=<v3>},<n4>={<v4>,<v5>}

--script-args-file <filename>

--script-help <filename>|<category>|<directory>|<expression>|all[,...]

--script-trace ---> 提供脚本运行信息

--script-updatedb

要运行单个脚本,只需输入: nmap --script Script_Name target --> 输入脚本将同时运行脚本和扫描器,因此也可以添加扫描器选项,可以添加 “safe=1” 以仅运行安全脚本。

时间控制

Nmap可以调整时间单位为秒、分钟、毫秒: --host-timeout 参数 900000ms, 900, 900s, and 15m 都是相同的。

Nmap将要扫描的主机总数分成组,并以块的形式分析这些组,直到所有组都被分析完毕,才会转移到下一个块(用户在块被分析之前也不会收到任何更新),这样,对于nmap来说使用大组更为高效。默认情况下,在C类中使用256。

可以使用**--min-hostgroup** <numhosts>; --max-hostgroup <numhosts>(调整并行扫描组大小)

可以控制并行扫描器的数量,但最好不要这样做(nmap已根据网络状态自动进行控制): --min-parallelism <numprobes>; --max-parallelism <numprobes>

可以调整rtt超时时间,但通常不需要: --min-rtt-timeout <time>, --max-rtt-timeout <time>, --initial-rtt-timeout <time>

可以修改尝试次数:--max-retries <numtries>

可以修改主机扫描时间: --host-timeout <time>

可以调整每个测试之间的时间间隔以减慢速度: --scan-delay <time>; --max-scan-delay <time>

可以调整每秒发送的数据包数量: --min-rate <number>; --max-rate <number>

许多端口由于被过滤或关闭而响应时间较长,如果只关注打开的端口,可以使用以下选项加快速度: --defeat-rst-ratelimit

用于定义nmap攻击强度: -T paranoid|sneaky|polite|normal|aggressive|insane

-T (0-5)

-T0 --> 一次只扫描一个端口,等待5分钟后进行下一个

-T1 和 T2 --> 非常相似,但分别等待15秒和0.4秒进行下一个测试

-T3 --> 默认操作,包括并行操作

-T4 --> --max-rtt-timeout 1250ms --min-rtt-timeout 100ms --initial-rtt-timeout 500ms --max-retries 6 --max-scan-delay 10ms

-T5 --> --max-rtt-timeout 300ms --min-rtt-timeout 50ms --initial-rtt-timeout 250ms --max-retries 2 --host-timeout 15m --max-scan-delay 5ms

防火墙/IDS

阻止端口通信并分析数据包。

-f 用于分片数据包,默认在头部后分片为8字节,要指定大小使用 ..mtu(不要与-f一起使用),偏移必须是8的倍数。版本扫描器和脚本不支持分片

-D decoy1,decoy2,ME Nmap发送扫描器,但使用其他IP地址作为源,以隐藏您的真实IP地址。如果将ME放在列表中,Nmap会将您定位到那里,最好在您之前放置5或6个以完全掩盖您的身份。可以使用RND:<number>生成随机IP。不适用于无TCP连接的版本检测。如果在网络内部,最好使用活动IP地址,否则很容易发现您是唯一活动的。

使用随机IP地址: nmap-D RND: 10 Ip_target

-S IP 当Nmap无法获取您的IP地址时,您需要使用此选项提供IP地址。也可用于让目标认为有其他扫描目标。

-e <interface> 选择接口

许多管理员会保持入站端口开放以确保一切正常运行,这样更容易而不是寻找其他解决方案。这些可能是DNS或FTP端口...为了查找此漏洞,nmap提供: --source-port <portnumber>;-g <portnumber> 等效

--data <hex string> 用于发送十六进制文本: --data 0xdeadbeef and --data \xCA\xFE\x09

--data-string <string> 用于发送普通文本: --data-string "Scan conducted by Security Ops, extension 7192"

--data-length <number> Nmap仅发送头部,使用此选项可添加指定数量的字节(将随机生成)

要完全配置IP数据包,请使用**--ip-options**

--ttl <value>

--randomize-hosts 使攻击不那么明显

--spoof-mac <MAC address, prefix, or vendor name> 更改MAC地址示例: Apple, 0, 01:02:03:04:05:06, deadbeefcafe, 0020F2, and Cisco --proxies <逗号分隔的代理URL列表> 有时代理无法保持nmap所需的连接数,因此需要调整并行性: --max-parallelism

-sP 通过ARP在当前网络中发现主机

许多管理员在防火墙中创建规则,允许通过特定端口(如20、53和67)传递所有数据包,我们可以告诉nmap从这些端口发送数据包: nmap --source-port 53 Ip

输出

-oN file 普通输出

-oX file XML输出

-oS file Script kiddies输出

-oG file grepable输出

-oA file 除了-oS之外的所有输出

-v level 详细程度

-d level 调试

--reason 主机和状态的原因

--stats-every time 每隔一段时间显示运行状态

--packet-trace 查看发送的数据包,可以指定过滤器,如: --version-trace 或 --script-trace

--open 显示开放、开放|过滤和未过滤的端口

--resume file 生成摘要

其他

-6 允许ipv6

-A 等同于 -O -sV -sC --traceroute

运行时

在nmap运行时,可以更改选项:

v / V 增加/减少详细程度

d / D 增加/减少调试级别

p / P 打开/关闭数据包跟踪

? 打印运行时交互帮助屏幕

Vulscan

nmap的脚本,查看从离线数据库(从其他重要数据库下载)获取的服务版本,并返回可能的漏洞

使用的数据库包括:

下载并安装到Nmap文件夹:

wget http://www.computec.ch/projekte/vulscan/download/nmap_nse_vulscan-2.0.tar.gz && tar -czvf nmap_nse_vulscan-2.0.tar.gz vulscan/ && sudo cp -r vulscan/ /usr/share/nmap/scripts/

还需下载数据库包并添加到 /usr/share/nmap/scripts/vulscan/

用法:

使用所有数据库: sudo nmap -sV --script=vulscan HOST_TO_SCAN

使用特定数据库: sudo nmap -sV --script=vulscan --script-args vulscandb=cve.csv HOST_TO_SCAN

加快Nmap服务扫描速度 x16

如果要查看发送和接收的数据包选项,请指定--packet-trace。有关使用Nmap的IP选项的更多信息和示例,请参阅。

Scipvuldb.csv |

Cve.csv |

Osvdb.csv |

Securityfocus.csv |

Securitytracker.csv |

Xforce.csv |

Exploitdb.csv |

Openvas.csv |

根据,您可以通过将 /usr/share/nmap/nmap-service-probes 中的所有 totalwaitms 值修改为 300,tcpwrappedms 修改为 200 来加快nmap服务分析速度。

此外,没有明确定义 servicewaitms 的探测使用默认值 5000。因此,我们可以为每个探测添加值,或者我们可以自己编译nmap并在中更改默认值。

如果您不想在 /usr/share/nmap/nmap-service-probes 文件中完全更改 totalwaitms 和 tcpwrappedms 的值,可以编辑,使得nmap-service-probes文件中的这些值完全被忽略。

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

支持HackTricks的其他方式:

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

获取

探索,我们的独家系列

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

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

🤩
http://seclists.org/nmap-dev/2006/q3/52
http://www.scip.ch/en/?vuldb
http://cve.mitre.org
http://www.osvdb.org
http://www.securityfocus.com/bid/
http://www.securitytracker.com
http://xforce.iss.net
http://www.exploit-db.com
http://www.openvas.org
此帖子
service_scan.h
parsing code
htARTE (HackTricks AWS Red Team Expert)
订阅计划
官方PEASS & HackTricks周边产品
PEASS家族
NFTs
Discord群
电报群
@hacktricks_live
HackTricks
HackTricks Cloud
htARTE(HackTricks AWS 红队专家)
订阅计划
官方 PEASS & HackTricks 商品
PEASS 家族
NFTs
Discord 群组
电报群组
@hacktricks_live
HackTricks
HackTricks Cloud
Websec | Uw Cybersecurity Specialist
Websec | Uw Cybersecurity Specialist
Logo
Logo