Challenge Web & API Security +50 XP

File Include Bypass

This corporate document portal implements dynamic file inclusion with security filters to prevent unauthorized access, but experienced attackers know that basic protections often have weaknesses. 🛡️ The system blocks directory traversal and PHP file inclusion, but what about other sensitive files that might be lurking in the web directory? 💡 Master the art of filter bypass and discover how to extract authentication credentials from protected areas! 🔓

81% solve it 26 hackers played 1 flag Updated Oct 06, 2026 First blood 3xpl0it3r
Local File InclusionFilter BypassApache AuthenticationPassword Cracking
Start Your Challenge
  1. 1Create a free account, then click "Start Lab"You'll get your own private machine with an IP address
  2. 2Explore the targetOpen the IP in your browser and look for vulnerabilities
  3. 3Find and submit flagsFlags are secret text strings hidden in the system - paste them below to score
  • ~1-2 min setup
  • Private instance
  • 30 min per session. Restart it for free, as often as you like.

Local File Inclusion (LFI) vulnerabilities are among the most dangerous web application security flaws, allowing attackers to read sensitive files from the server's filesystem. When developers implement basic security filters to block LFI attacks, skilled testers must understand filter bypass techniques to verify whether the protections are truly effective. This progression from basic LFI to filter bypass represents a realistic scenario encountered in professional penetration testing.

How LFI Filter Bypass Works

Many web applications implement input filters that check for common attack patterns like "../" (directory traversal) or specific file extensions. However, these filters are often implemented as simple string matching or basic regular expressions that can be circumvented. Common bypass techniques include URL encoding (..%2F), double URL encoding (..%252F), using alternative path separators, null byte injection (%00 on older PHP versions), and path truncation. Each technique exploits a gap between what the filter checks and what the server's file system actually processes.

Apache Authentication Files

One of the most valuable targets for LFI attacks is Apache's authentication system. The .htaccess file controls directory-level configuration including authentication requirements, while .htpasswd stores username and password hash pairs. If an attacker can read the .htpasswd file through LFI, they obtain password hashes that can be cracked offline using tools like John the Ripper or Hashcat. These credentials often provide access to protected administrative areas of the application.

Defense in Depth Against LFI

Effective LFI prevention requires multiple layers of defense. Input validation should use allowlists rather than blocklists - only permitting known-good file names rather than trying to block all malicious patterns. Path canonicalization before file operations prevents traversal bypasses. PHP applications should use realpath() to resolve the full path and verify it falls within the expected directory. Proper file permissions and running web servers with minimal privileges limit the impact of successful exploitation.

What You Will Learn

  • How security filters attempt to prevent LFI attacks
  • Multiple filter bypass techniques including encoding and path manipulation
  • Apache .htaccess and .htpasswd file structure and significance
  • Password hash cracking from extracted authentication files
  • Why blocklist-based filtering is insufficient for LFI prevention

Prerequisites

Understanding of basic LFI concepts URL encoding knowledge Basic command line skills