All,
There are certain scripts that I have that only I want to run, both from
home and sometimes work. If I add something like this (below) to the
scripts, will this keep out unauthorized use (if the scripts are found
somehow), or can the REMOTE_ADDR be easily spoofed ?
Should I be checking HTTP_CLIENT_IP and HTTP_X_FORWARDE D_FOR also ?
$ip = $_SERVER["REMOTE_ADD R"];
if (($ip == "x.x.x.x") or ($ip == "y.y.y.y"))
{
//secret stuff
}
else
{
echo "<META HTTP-EQUIV=\"refresh \" content=\"0; url=/index.php\">";
die();
}
or something like this:
function getipaddress()
{
$ip;
if (getenv("HTTP_C LIENT_IP")) $ip = getenv("HTTP_CL IENT_IP");
else if (getenv("HTTP_X _FORWARDED_FOR" )) $ip =
getenv("HTTP_X_ FORWARDED_FOR") ;
else if (getenv("REMOTE _ADDR")) $ip = getenv("REMOTE_ ADDR");
else $ip = "UNKNOWN";
return $ip;
}
$ip = getipaddress();
if(($ip == "x.x.x.x") or ($ip == "y.y.y.y"))
{
//secret stuff
} else {
echo "<META HTTP-EQUIV=\"refresh \" content=\"0; url=/index.php\">";
die();
}
Thanks. 3 3996
"StinkFinge r" <st****@pinky.c om> wrote in message
news:10******** *****@corp.supe rnews.com... All, There are certain scripts that I have that only I want to run, both from home and sometimes work. If I add something like this (below) to the scripts, will this keep out unauthorized use (if the scripts are found somehow), or can the REMOTE_ADDR be easily spoofed ?
You can send TCP/IP packets with fake return addresses fairly easily. But to
take advantage of it in an attack against a web server is hard, I believe,
as the HTTP response would get routed to the real address.
Chung Leong wrote: "StinkFinge r" <st****@pinky.c om> wrote in message news:10******** *****@corp.supe rnews.com...
All, There are certain scripts that I have that only I want to run, both from home and sometimes work. If I add something like this (below) to the scripts, will this keep out unauthorized use (if the scripts are found somehow), or can the REMOTE_ADDR be easily spoofed ?
You can send TCP/IP packets with fake return addresses fairly easily. But to take advantage of it in an attack against a web server is hard, I believe, as the HTTP response would get routed to the real address.
Just kinda thinking out loud... by why not limit access to the directory
your scripts are in with .htaccess or IIS's authentication? That'd
probably be a bit more secure than relying upon the REMOTE_ADDR.
Regards,
- Dan http://blog.dantripp.com
Dan Tripp wrote: There are certain scripts that I have that only I want to run, both from home and sometimes work. If I add something like this (below) to the scripts, will this keep out unauthorized use (if the scripts are found somehow), or can the REMOTE_ADDR be easily spoofed ?
You can send TCP/IP packets with fake return addresses fairly easily. But to take advantage of it in an attack against a web server is hard, I believe, as the HTTP response would get routed to the real address.
Just kinda thinking out loud... by why not limit access to the directory your scripts are in with .htaccess or IIS's authentication? That'd probably be a bit more secure than relying upon the REMOTE_ADDR.
Not an answer to your solution, but a suggestion that instead of writing out
a meta tag refresh you might want to do this instead:
header("Locatio n: /index.php");
exit;
Chris
--
Chris Hope
The Electric Toolbox Ltd http://www.electrictoolbox.com/ This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Laphan |
last post by:
Hi All
I've been looking at having my Javascript file as an ASP one to try and stop
general prying eyes, eg:
<SCRIPT LANGUAGE="javascript" SRC="js-something.asp">
</SCRIPT>
and this seems to work well apart from the fact that if the user, puts in
for example:
|
by: wotan |
last post by:
We have an application that accesses a particular table, but it is
never updated. Without stepping through the complex application code,
is there a method of logging when a particular table is accessed?
|
by: Daniel |
last post by:
Does anyone know how this can be done?
Thanks
|
by: Vani Murarka |
last post by:
Hi Everyone,
Does .NET offer any collection class which will give me objects last
*accessed* such that I may build a least-recently-used cache that
kills off objects that haven't been used for awhile?
Or is there any other way to implement this kind of a cache /
collection where one can do this kind of cleanup based on
least-recently-used objects?
|
by: Caveman |
last post by:
I wonder if anyone has any hard fact based pro or contra, especially on
performance, about having views as opposed to tables when the object is
being accessed for read only by multiple sessions/users/spids. I am
particularly concerned about the multiple instantiations of the view.
Relevant thoughts on this are much appreciated.
Thanks,
Caveman
| |
by: Markus Enders |
last post by:
Hi everybody,
we are using version 7 of db2 and need to replicate a database. We are
using two web-based systems, which access two different databases. One
system is used for import data (internal usage), the other system is
used to show the imported data via web to the end-user (just reading the
database).
Both databases are running on different systems (both solaris).
Want we want to do is to replicate the import-database (source)...
|
by: Bangalore |
last post by:
Hi,
In the following program, eventhogh two member function declared under
private section of the derived class are accessable by derived class
pointer.
Please clarify me how can derived class pointer acess private member
functions.
private member functions
#include <stdio.h>
|
by: Simon Harvey |
last post by:
Hi everyone,
We have a need to make a Windows Forms (2.0) client application that
will be installed on our clients site.
The data that the application uses needs to be centrally available to a
potentially large number of other sites, which would seem to leave us
with our traditional approach, or having a central database server on a
dedicated server someplace.
|
by: =?Utf-8?B?TWlrZQ==?= |
last post by:
Hi.
In VB.NET, is it possible to determine whether an ASP.NET is being accessed
internally (within the same domain hosting the application) or externally
(across the internet)? I've looked at using the HttpRequest.ServerVariables
Property, but it doesn't look like it's NameValueCollection contains any
items which would identify whether or not a program is being accessed
internally/externally.
Basically I need to apply certain logic...
|
by: tshad |
last post by:
I am trying to get access to a file that may still being written because the
file is so large (7-10MB).
I get an error:
The process cannot access the file 'c:\TestDocs\XMLFiles\492172.XML' because
it is being used by another process
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
| |
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
| |
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |