Remote File Inclusion - RFI

Jerry Shah (Jerry)
2 min readFeb 13, 2020

--

Summary :

A remote file inclusion (RFI) occurs when a file from a remote web server is inserted into a web page. This can be done on purpose to display content from a remote web application. But, it can also happen by accident, due to a misconfiguration of the respective programming language, which can lead to a RFI attack.

Even though this kind of file inclusion can occur in almost every kind of web application, those written in PHP code are more likely to to be vulnerable to Remote File Inclusion attacks, because PHP provides native functions that allow the inclusion of remote files. Other languages usually require a workaround to imitate this behavior.

In my case I got file parameter that was fetching an image from somewhere so I thought that it might be vulnerable to RFI so I went further and checked it and it was vulnerable.

How to find this vulnerability ?

  1. Go to your target website and find any parameter that loads the content of any remote websites for eg. url, page, file etc. (Use Spider option of burp for finding parameters)
File Parameter

2. Now here we have the file parameter that is fetching an image, lets exploit it

Error

3. While exploiting issue it was giving me an error and was not allowing me to load the contents, so I got an idea of trying it using burp repeater.

4. After trying with burp repeater I was able to exploit it successfully. I loaded the content of some https://www.jp-bank.japanpost.jp/rss/notice.xml website for testing.

Exploited it using burp repeater

5. For confirming I exploited it once again and it was successfully exploited.

Exploited

Thank You :)

Instagram : jerry._.3

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Jerry Shah (Jerry)
Jerry Shah (Jerry)

Written by Jerry Shah (Jerry)

OSCP+ | OSCP | CRTP | CRTSv2 | CRTA | eWPTXv2 | eJPTv2 | MCRTA | CRT-COI | CAP | CNSP | C3SA

Responses (1)

Write a response