Questions tagged [file-inclusion]
A remote code execution attack where user input is used to build the path of code files to be executed, allowing an attacker to control which code is executed. Most commonly affects web applications that rely on a scripting run time, most commonly PHP.
39 questions
8
votes
2
answers
3k
views
What files should I download or check on a Windows system in case of Local File Inclusion (LFI)?
I have a question about a Local File Inclusion (LFI) vulnerability on a Windows system. When it's possible to download any file from the operating system (OS), which file should I download first?
I'm ...
6
votes
3
answers
9k
views
Can't get a reverse shell on port 80
In a pentest, I have found a RFI and the endpoint looks like:
https://xxx.com/file.php?page={localhost/evilcode.txt}
Port 80 isn't open. 22,443 are only open ports
Now, I am using php reverse shell ...
5
votes
2
answers
14k
views
What is the difference between RFI/LFI and SSRF?
Is there any difference between those? Can we say that Server Side Request Forgery (SSRF) is a generalization of Remote File Inclusion (RFI) and Local File Inclusion (LFI)?
5
votes
1
answer
13k
views
Exploit LFI bug when a ".inc.php" is appended to the file name?
I'm trying to exploit a LFI bug. My link looks like this:
http://example.com/challenge/mypage.php?page=test
When I put /etc/passwd instead of test it shows me:
Warning: include() [function....
5
votes
1
answer
2k
views
Are LFI attacks possible (removing extension) in PHP 5.4.4+?
Wondering if there was a possible attack vector still around for LFI attacks that remove the file extension. Obviously the null byte was fixed in previous PHP versions and no longer works, along with ...
5
votes
1
answer
4k
views
What is the difference between local file inclusion (LFI) and remote file inclusion (RFI)?
Based on this previous question, it seems like the difference between directory traversal and file inclusion is as follows:
Directory traversal
Improper validation of user input leads to read ...
5
votes
2
answers
12k
views
How to hack linux via Local File Inclusion vulnerability?
During my penetration testing, I found a local file inclusion vulnerability. In fact this vulnerability existed in mailwatch <= 1.0.4, and its exploit existed in Exploit-DB.
I tried to exploit the ...
4
votes
3
answers
5k
views
PHP null byte include failing explation seeked
I am watching a tutorial on YouTube about how to include remote files or local through a standard include command.
Here is the code:
<?php
if(isset($_GET["language"])) {
$language = $_GET["...
2
votes
1
answer
2k
views
Is all Snort community rules available in Snort registered rules?
I am working with snort. I have included both latest community and registered rules in my snort configuration file. During run time I found many rules have duplicated, that is some rules available in ...
2
votes
1
answer
293
views
What is attacker trying to do with my server?
Some is trying to access this link (and similar ones) frequently in my site:
http://example.com/upload/RS=%5EADAJVxZ5NB.GMTgFV3EMEJX3sN22Jw-
Note that my server doesn't have an upload folder inside ...
2
votes
1
answer
908
views
solaris equivalent of /proc/self/environ LFI
I need to exploit a Solaris vulnerability for class, but we never dealt with Solaris before and I never installed it.
Does Solaris have an equivalent to Linux's /proc/self/environ, exposing a ...
2
votes
1
answer
4k
views
Security implications of the contents of /proc/self/environ in LFI attacks
During penetration testing on a website, the tests have found a local file inclusion vulnerability in an old wordpress plugin that was installed. An attacker can exploit the LFI vulnerability to ...
1
vote
3
answers
24k
views
Local File Inclusion to RCE using PHP File Wrappers
Suppose we have code that looks something like this:
<?php include("includes/".$_GET['param1'].".php");?>
Now the above code is vulnerable to LFI. If I pass payload ../../../../etc/passwd%00it ...
1
vote
1
answer
527
views
Prevent injection in PHP file
Recently I wrote this code:
<?php
$path = '../data/about.html';
$handle = fopen($path, 'w') or die('Cannot open file: '. $path);
$data = $_POST['name'];
fwrite($handle, $data);
fclose($handle);
...
1
vote
2
answers
12k
views
Local File Inclusion [ Post-Exploitation ]
I am curious what kind of sensitive files should I look for on a Windows server which is vulnerable to LFI compared to Linux?
I mean the first file or common files which a pentester or an ...
1
vote
2
answers
3k
views
How To Patch LFI Vulnerability
I'm pretty sure that you all are aware of this vulnerability, but i wonder how to patch this? I have seen this code in a tutorial that it is the way to patch this but still user can access all the ...
1
vote
1
answer
545
views
How to check www.abc.com/?page=xyz is vulnerable to RFI or not?
On my friends website when I typed www.abc.com/?page=non existing page, I got page not found error.But when I gave www.abc.com/?page=www.google.com I got blank white page.So is this website ...
1
vote
2
answers
11k
views
Tomcat application arbitrary file read exploitation
In recent black-box pen-test of a webapp hosted on CentOS, I found a vulnerability that allowed me to grab contents of files (kind of file inclusion) located within the home path of Tomcat.
In ...
1
vote
2
answers
466
views
How to know if an RFI/LFI attack was successful?
Let's say that an attacker wants to search websites for RFI/LFI vulnerability with a script, he's fuzzing the URL with a list of remote/local files. And he prints the headers that return from the ...
1
vote
1
answer
2k
views
Difference between XML external entities and Remote File Inclusion attacks
I was just studying about the XML external entities attack and Remote File Inclusion Attack.
According to my understanding, the XML external entities attack is where the XML parser in the web ...
1
vote
1
answer
2k
views
Local file inclusion in JS app [closed]
I am working on a project which requires the name of the page as a query parameter 'path'. The app stores path variable as res.query.path. My manager asked me to pay attention to LFI, so I'm concerned ...
1
vote
0
answers
7k
views
LFI to RCE when log file isn't readable
During a penetration test, I came across an endpoint which lets me include local files and I can read /etc/passwd. However I don't have permissions to read proc/self/environ and /etc/shadow.
The ...
0
votes
1
answer
427
views
Please define "Carpet Bombing"
I saw a 2008 article about a certain vulnerability in WebKit which referred to "Carpet Bombing": https://www.cert.org/blogs/certcc/2008/09/carpet_bombing_and_directory_p.html (This vulnerability is ...
0
votes
2
answers
521
views
How does Local File Inclusion (LFI) work?
In the past few days, I have created my own webserver to serve as my sandbox for learning pen-testing. I saw this blog (https://outpost24.com/blog/from-local-file-inclusion-to-remote-code-execution-...
0
votes
1
answer
543
views
RFI - Is this possible even if you use an Application Server?
Since JBoss is acting as a middleware - Application Server - I was wondering if it's still possible to face with File Inclusion attacks.(?) The reason I was wandering so is that in such a case, no ...
0
votes
1
answer
1k
views
Rails File.open(#{Rails.root}) is vulnerable to LFI?
I am performing White Box testing on Rails application with static code analyzing tools like brakeman, I came across an instance where the developer is loading images using file.open.
file = File....
0
votes
1
answer
6k
views
Metasploit Exploitation with Virtual Hosts (PHP_Include Exploit)
I am currently trying to build an example of a host vulnerable to Remote File Inclusion vulnerabilities. I have a docker application which hosts 3 vulnerable websites, and in order to access them I ...
0
votes
1
answer
561
views
File inclusion check bypass
The following function is used to protect from arbitrary file download:-
function file_download($file_name, $file_path) {
$allowedExtensions = array(
"csv"
);
$...
0
votes
1
answer
767
views
From a local file inclusion to a shell when file is downloaded?
I've just participated in a boot2root capture the flag event where I got close to solving an item but couldn't quite get it over the line and want to learn what I could have done differently.
In the ...
0
votes
2
answers
3k
views
Simple Remote File Inclusion vulnerability not working?
So I've hosted a php file vulnerable to RFI with code like this:
<?php
echo include($_GET['page']);
?>
However,when I try to exploit the code by vsiting http://192.168.8.133/test.php?page=...
0
votes
3
answers
6k
views
How to leverage a stored XSS to perform a file inclusion?
I have identified a stored XSS and I'm wondering, how could I leverage that vulnerability to upload a shell.
0
votes
0
answers
1k
views
Arbitrary File Upload Vulnerability
I have found an arbitrary file upload vulnerability on a flask application that I was playing with that essentially allows me to append to any file (and create new ones) in the file system. The code ...
0
votes
0
answers
187
views
Does Burp Suite affect my request directly?
When I try to bypass the security configuration of Natas13 (http://natas13.natas.labs.overthewire.org/ A/P:natas13/lW3jYRI02ZKDBb8VtQBU1f6eDRo6WEj9) while using Burp Suite Community Edition on ...
0
votes
0
answers
84
views
How does "./" affects signature generation for files, in a PHP based web application?
I am solving a lab related to serialization vulnerabilities. It deals with retrieving files based on the signature. The theory of the lab states as quoted, "Adding ./ will still give you the same ...
0
votes
1
answer
264
views
Remotely included script cannot set session variables
I'm trying to simulate a remote file inclusion attack on my local web server as part of a course I am taking. I got the idea of being able to "logging" in on a website I set up without really logging ...
0
votes
1
answer
2k
views
File inclusion on a website always appending .php
I'm looking at a website that uses a URL parameter to include the current page, like http://host.tld/index.php?page=about.
If I add anything other than the current page (e.g. http://host.tld/index....
-1
votes
1
answer
355
views
How To Patch LFI Vulnerabilities [closed]
I wonder how to patch the LFI problem in this code? Please suggest a good way to patch this vulnerability.
-1
votes
1
answer
1k
views
How to exploit a local file inclusion vulnerability in a Solaris server [closed]
I am trying to exploit a local file inclusion vulnerability on a Solaris server for my security course. The server is running Apache2 through CoolStack. What is the file that I need to open? The ...
-3
votes
1
answer
370
views
LFI attacks auth.log , environ , passwd [closed]
paths like /proc/self/environ , /etc/passwd and /var/log/auth.log are targeted by the attackers.
how can I hide those files ( passwd ) ( environ ) ( auth.log ) to be not include in LFI attack