Jump to content

Recommended Posts

I'm using a very basic php switch right now, and it's only real purpose is navigation. However, just glancing at it told me it was vulnerable to RFI. Here is the switch in it's current form:

 

<?php
switch($id) {
default:
include('index.html');
break; case"id1":include('id1.html');
break; case"id2":include('id2.html');
break; case"id3":include('id3.htm');
break; case"id4":include('id4.htm');
break; case"id5":include('id5.htm');
} ?>

 

Is there any way to make it secure without having to scrap it and replace it with something needlessly bloated with features I don't need?

 

And yes, I suck when it comes to security.

Link to comment
https://forums.phpfreaks.com/topic/162296-solved-making-my-php-switch-secure/
Share on other sites

How is that vulnerable to RFI ?

your pages are hard coded!

 

Someone attempted RFI and screwed up my site the other day, and ended up with the switch directing to an offsite script.

 

EDIT: Found the problem was in fact in another script that allowed the attacker enough access to mess with the switch. Fixed up that exploit and so don't expect any more problems. My mistake  ::)

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.