Skip to content

File Inclusion ​

FieldValue
Module ID23
DifficultyMedium
TierTier 0
CategoryOffensive
Estimated Time8 hours
Cubes Earned0
Experience Points740
Creators21y4d, MinatoTW
Last Updated2025-10-01T00:00:00.000000Z
URLhttps://academy.hackthebox.com/app/module/23

Module Includes ​

  • 11 Sections
  • 10 Interactive Exercises
  • 1 Assessments
  • 0 Cubes

Module Description ​

File Inclusion is a common web application vulnerability, which can be easily overlooked as part of a web application's functionality.

Module Summary ​

This module introduces the fundamentals of file inclusion vulnerabilities. Web applications often present a large attack surface, and as information security professionals, it is important to understand common attacks against a variety of frameworks and server-side languages. A successful file inclusion attack may result in sensitive data exposure (such as configuration files containing credentials) or even remote code execution.

In this module, we will cover:

  • An intro to file inclusion vulnerabilities
  • Local File Inclusion (LFI)
  • Path Traversal
  • Bypassing basic LFI restrictions
  • LFI to remote code execution (RCE)
    • RCE through PHP wrappers
    • RCE through Remote File Inclusion (RFI)
    • RCE through malicious file uploads
    • RCE through log poisoning
  • Automating LFI exploitation
  • Preventing LFI exploitation

CREST CPSA/CRT-related Sections:

  • Intro to File Inclusions
  • Local File Inclusion (LFI)
  • Remote File Inclusion (RFI)
  • File Inclusion Prevention

CREST CPSA/CRT-related Sections:

  • All sections

CREST CCT INF-related Sections:

  • All sections

This module is broken down into sections with accompanying hands-on exercises to practice each of the tactics and techniques we cover. The module ends with a practical hands-on skills assessment to gauge your understanding of the various topic areas.

You can start and stop the module at any time and pick up where you left off. There is no time limit or "grading", but you must complete all of the exercises and the skills assessment to receive the maximum number of cubes and have this module marked as complete in any paths you have chosen.

As you work through the module, you will see example commands and command output for the various topics introduced. It is worth reproducing as many of these examples as possible to further reinforce the concepts introduced in each section. You can do this in the PwnBox provided in the interactive sections or in your own virtual machine.


The module is classified as "Medium" and assumes a working knowledge of the Linux command line and an understanding of information security fundamentals. The module also assumes a basic understanding of web applications and web requests, and will build on this understanding to teach how Arbitrary File Upload vulnerabilities work and how to exploit them.

In addition to the above, a firm grasp of the following modules can be considered as prerequisites for the successful completion of this module:

  • Introduction to Networking
  • Linux Fundamentals
  • Web Requests

Sections ​

11 sections - 10 Interactive

#GroupTypeTitle
1IntroductiontheoryIntro to File Inclusions
2File DisclosureinteractiveLocal File Inclusion (LFI)
3interactiveBasic Bypasses
4interactivePHP Filters
5Remote Code ExecutioninteractivePHP Wrappers
6interactiveRemote File Inclusion (RFI)
7interactiveLFI and File Uploads
8interactiveLog Poisoning
9Automation and PreventioninteractiveAutomated Scanning
10interactiveFile Inclusion Prevention
11Skills AssessmentinteractiveSkills Assessment - File Inclusion

Conclusion ​

Congratulations on finishing the File Inclusion modules. We hope that you are now able to exploit all of the vulnerabilities shown in this module, and utilize the various attacking techniques for different situations you may face in pentests. In this module, we covered file inclusion fundamentals, including various ways to read local files, bypass filters, and achieve remote code execution (RCE).

Module Key Takeaways

  • Basic Local File Inclusion (LFI)
  • Path traversal
  • Bypassing LFI filters
  • Remote Code Execution through:
    • PHP wrappers
    • RFI
    • Malicious file uploads
    • Log poisoning
  • How to automate LFI exploitation
  • How to prevent LFI exploitation