Hacking Equipments | C/C++ Coding | Updates:: Did you tried Our Online ? AdobePhotoshop |

Goto Top

Securing of RFI vulnerabilities




Asalam-0-Alikum,



Completing My RFI Series:


  1.  Beginning of RFI
  2.  Finding And Exploiting RFI vulnerabilities
  3.  Securing RFI vulnerabilities



Secure user inputs!!!!


And not just those you THINK is used in SQL queries or include functions or etc. ALL user inputs should be secured. You do this by strip/disallow words or phrases or symbols in the user inputs. And the most common solution when it comes to RFI is just to make the page less dynamic and hardcode the pages. If you still want to have a dynamical editable page you MUST make sure you secure the user inputs. Check it for the word “http”, check it for the word “www.”, check it for “../”, check it for “?” etc etc. Disable “show PHP errors” in the PHP configuration. Do a file_exists() check. These are all easy things you can do to prevent RFI(and LFI, but that is again another story).

Here is a example on a dynamic page and a hardcoded page. The dynamic one is not secure, the hardcoded one is.


Dynamic:




PHP Code:


if (isset($_GET['page']))
{
include($_GET['page'] . “.php”);
}
else
{
echo('
page1
');
echo('page2
');
echo('page3
');
}


Hardcoded:




PHP Code:


if (isset($_GET['page']))
{
if ($_GET['page'] == “page1”)
include(“1.php”);
if ($_GET['page'] == “page2”)
include(“2.php”);
if ($_GET['page'] == “page3”)
include(“3.php”);
}
else
{
echo('
page1
');
echo('page2
');
echo('page3
');
}


So what do you got and what you got for me tell me in comments , sucessfully completed my series thanks :)


0 Comments :

Post a Comment

Having Confusion ,oH Dear ask me in comments!!

Related Posts Plugin for WordPress, Blogger...
 

About Admin

I am a pro-programmer of C++ ,php i can crack some softwares and am a web desighner .I AM also on .


| Solve Byte © 2011 - 2016. All Rights Reserved | Back To Top |