File Inclusion
| Field | Value |
|---|---|
| Module ID | 23 |
| Difficulty | Medium |
| Tier | Tier 0 |
| Category | Offensive |
| Estimated Time | 8 hours |
| Cubes Earned | 0 |
| Experience Points | 740 |
| Creators | 21y4d, MinatoTW |
| Last Updated | 2025-10-01T00:00:00.000000Z |
| URL | https://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
| # | Group | Type | Title |
|---|---|---|---|
| 1 | Introduction | theory | Intro to File Inclusions |
| 2 | File Disclosure | interactive | Local File Inclusion (LFI) |
| 3 | interactive | Basic Bypasses | |
| 4 | interactive | PHP Filters | |
| 5 | Remote Code Execution | interactive | PHP Wrappers |
| 6 | interactive | Remote File Inclusion (RFI) | |
| 7 | interactive | LFI and File Uploads | |
| 8 | interactive | Log Poisoning | |
| 9 | Automation and Prevention | interactive | Automated Scanning |
| 10 | interactive | File Inclusion Prevention | |
| 11 | Skills Assessment | interactive | Skills 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