🟥
LSWSec - Offensive
  • Introduction
  • File transfer
    • Transferring Files
      • Transferring Files - Linux
      • Transferring Files - Windows
  • Recon
    • Passive information Gathering
      • Website
      • Finding SubDomains
        • DNS
        • DNS Zone Transfer
    • Subdomain Enumeration
    • OSINT
      • Email
      • People
      • Social Media
      • Username and Accounts
      • Passwords
      • Business
      • Image and Location
    • Active Information Gathering
      • Nmap
      • Netcat
      • ss
      • Unknown Port Scanning
      • Footprinting
        • FTP
        • SMB
        • NFS
        • DNS
    • Vulnerability Searching
  • Ports
    • 21 - FTP
    • 22 - SSH
    • 23 - Telnet
    • 25 - SMTP
    • 69 - TFTP
    • 80 - HTTP
    • 88 - Kerberos
    • 110 - Pop3
    • 111 - RPCBind
    • 119 - NNTP
    • 135 - MSRPC
    • 139/445 - SMB
      • PSExec
      • Nmap
      • Other tools
    • 143/993 - IMAP
    • 161/162 - SNMP
    • 389/636 - LDAP
    • 443 - HTTPS
    • 554 - RTSP
    • 587 - Submission
    • 631 - Cups
    • 1433 - MsSQL
    • 2049 - NFS
    • 3306 - MySQL
    • 3389 - RDP
  • Web
    • useful information
    • Web Proxy
      • Burp
    • Web Content Discovery
    • SQL
    • Web Fuzzing with FFUF
      • Directory Fuzzing
      • Domain Fuzzing
      • Paramater fuzzing
    • Local File Inclusion
      • LFI
      • Basic Bypass
    • Authentication Bypass
    • IDOR
  • Priv-esc
    • Windows
      • mimikatz
  • Pivoting
    • Info
    • Locating other machines
    • proxy
    • SSH tunneling/port forwarding
    • plink
    • socat
    • chisel
    • sshuttle
    • connecting to windows environments with a user account
  • Command and Control
    • powershell empire
    • Armitage
  • Active Directory
    • Debugging DNS
    • NTLM Authenticated Services
    • LDAP Bind Credentials
Powered by GitBook
On this page
  • Non-recursive path traversal filters
  • Encoding
  • Approved Paths
  • Appended Extension
  1. Web
  2. Local File Inclusion

Basic Bypass

Non-recursive path traversal filters

  • one of the most basic defences is a search and replace filters to simply delete substrings of (../) to avoid path traversals

  • $language = str_replace('../', '', $_GET['language]);

  • This filter does not recursively remove the ../ substring, as it runs a single time on the input string and does not apply the filter on the output string

  • we can use ....// as our payload and the filter would only remove ../ leaving ../ behind.

  • we could also use

    • ..././

    • ....\/

    • ....////

Encoding

  • some web filters may prevent input filters that include certain LFI-related characters, like a dot . or a slash / used for path traversal

  • these filters can sometimes be bypassed by encoding our input

  • Core PHP filters on version 5.3.4 and earlier were specifically vulnerable to this bypass, it can also work on newer versions occasionally

  • we can URL encode ../ into %2e%2e%2f

  • URL encoding can be done on any online encoder

  • burp decoder can be used to double encode strings to bypass other filters

Approved Paths

  • Some applications may use Regex to ensure that the file being included is under a specific path

  • To find approved paths, examine the requests sent by the existing form to see what paths they use

  • we can also fuzz web directories under the same path or try different ones until we get a match

  • to bypass this use the accepted directory then use ../ to go back to root

Appended Extension

  • Some web apps append an extension to our input string

PreviousLFINextAuthentication Bypass

Last updated 7 months ago