473,772 Members | 3,603 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

PHP, Visitor IP address and invisible proxies

I was faced with a difficult configuration issue a few days ago with
another companys web service. In short, their web service requires the
user to login on their page before their service can be used through
another application. During the login phase the remote server tries to
determine the visitors ip-address and after that only allows the use of
the external application from that ip-address.

As most of us well know, there really is no reliable way to get the
visitors ip-address through php or other server-side scripting.
Troubleshooting my connection issues I found out that our ISP is using a
completely transparent proxy in between. It does not add extra headers
to its requests, so the webserver has no idea it is actually fetching
the proxys ip-address instead of mine.

Quite often proxies add the real ip-address in the request headers
($_SERVER["HTTP_X_FORWARD ED_FOR"]), but my ISP's transparent proxy does
not do this. Obviously the service was unusable, and I know that there
would be other ways for the company to deal with the identification. I
Finally got around the issue after using some ugly workarounds.

(the "livehttpheader s" mozilla extension allows me to manually add
request headers to single page requests, although it is pretty much work
and has to be done manually for each request. My ISP's proxy seems to
pass these extra headers through untouched, so I was able to manually
define http_x_forwarde d_for as my ip and got it all working, although
now this needs to be done with every login).

While investigating the problem I came to face 2 questions that I would
like answers to.

1) Despite the completely transparent proxy, I found 2 pages in the
internet that _did_ report my real IP-address despite of the proxy in
between. These were www.whatismyip.com and checkip.dyndns. org. Any and
all other such pages always returned my proxys ip-address instead. I
suspect that the two working sites use some much more sophisticated
technique to finding out my ip-address that just server variables or
headers, but I am unsure what that is (Some kind of routing analysis
perhaps?). So _how on earth do www.whatismyip.com or checkip.dyndns. org
find out the real ip-address instead of the completely invisible proxy
in between_ ?

2) In the future, to make analysing similar problems easier, or to just
add depth to the experiments with web services, it would help a lot to
have an easier way to set request headers. Are there any other
extensions/plugins/software to edit my request headers that the mozilla
livehttpheaders ? It would be good if I could permanently set some
request headers that would always be applied to my requests, or applied
site-specificly.

Thanks in advance.

--
Suni

Jul 17 '05 #1
3 3494
"Juha Suni" <ju*******@ilmi antajat.fi> wrote in message news:<41******* *************** *@news.song.fi> ...
<snip>
1) Despite the completely transparent proxy, I found 2 pages in the
internet that _did_ report my real IP-address despite of the proxy in
between. These were www.whatismyip.com and checkip.dyndns. org.
Not for me, at least when I tried. So, I guess, your proxy actually
sends your IP to them in _some_ headers. Probably you should loop
through the $_SERVER variables to findout that.
Any and
all other such pages always returned my proxys ip-address instead. I
suspect that the two working sites use some much more sophisticated
technique to finding out my ip-address that just server variables or
headers, but I am unsure what that is (Some kind of routing analysis
perhaps?). So _how on earth do www.whatismyip.com or checkip.dyndns. org
find out the real ip-address instead of the completely invisible proxy
in between_ ?
Again I don't think so. But, it's quite easy to find if the IP is
proxy or not.
2) In the future, to make analysing similar problems easier, or to just
add depth to the experiments with web services, it would help a lot to
have an easier way to set request headers. Are there any other
extensions/plugins/software to edit my request headers that the mozilla
livehttpheaders ? It would be good if I could permanently set some
request headers that would always be applied to my requests, or applied
site-specificly.


I don't know. Perhaps you should hack the source of
livehttpheaders ?

--
<?php echo 'Just another PHP saint'; ?>
Email: rrjanbiah-at-Y!com Blog: http://rajeshanbiah.blogspot.com/
Jul 17 '05 #2
Juna,

There is no way of doing this reliably. The only way to guarantee that
you have the end users ip address and not an intermediate proxy is to
ensure that the request was HTTPS. The problem first came to light when
I discovered when looking at AOL users (the AOL network makes extensive
use of proxies that overwrite the end user's ip address during the
inbound request), and there were no HTTP headers, not even
HTTP_X_FORWARDE D_FOR that would me the correct ip. In fact I managed to
demonstrate that the end user ip address could always hidden by opening
an AOL account for this express purpose.

Steve

Jul 17 '05 #3
R. Rajesh Jeba Anbiah wrote:
"Juha Suni" <ju*******@ilmi antajat.fi> wrote in message news:<41******* *************** *@news.song.fi> ...
<snip>
1) Despite the completely transparent proxy, I found 2 pages in the
internet that _did_ report my real IP-address despite of the proxy in
between. These were www.whatismyip.com and checkip.dyndns. org.

Not for me, at least when I tried. So, I guess, your proxy actually
sends your IP to them in _some_ headers. Probably you should loop
through the $_SERVER variables to findout that.


The transparent proxy set up by Telefónica (main company here in Spain)
adds x-forwarded-for to the headers:

if (getenv("HTTP_X _FORWARDED_FOR" )) {
$ip = getenv("HTTP_X_ FORWARDED_FOR") ;
$host = gethostbyaddr($ ip);
$proxy = "sí: " . getenv ("REMOTE_ADDR") ;
} else {
$ip = getenv("REMOTE_ ADDR");
$host = gethostbyaddr($ ip);
$proxy = "no";
}


Any and
all other such pages always returned my proxys ip-address instead. I
suspect that the two working sites use some much more sophisticated
technique to finding out my ip-address that just server variables or
headers, but I am unsure what that is (Some kind of routing analysis
perhaps?). So _how on earth do www.whatismyip.com or checkip.dyndns. org
find out the real ip-address instead of the completely invisible proxy
in between_ ?

Again I don't think so. But, it's quite easy to find if the IP is
proxy or not.

2) In the future, to make analysing similar problems easier, or to just
add depth to the experiments with web services, it would help a lot to
have an easier way to set request headers. Are there any other
extensions/plugins/software to edit my request headers that the mozilla
livehttpheade rs? It would be good if I could permanently set some
request headers that would always be applied to my requests, or applied
site-specificly.

I don't know. Perhaps you should hack the source of
livehttpheaders ?

Jul 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
2197
by: Bob Bedford | last post by:
Hello there, I'd like to get the visitor's email (not for spamming....) It's to avoid to show some content to my competitors....
10
2410
by: Clive Backham | last post by:
I tried posting this on comp.infosystems.www.misc, but that group appears to get very little traffic. So now I'm trying here. If there is a more appropriate group, please let me know. I'm interested in how cacheing web proxies are expected to behave with regard to pages that change. After changing the content of a simple web site I have, I discovered that the cacheing web proxies at at least one ISP I have access to did not refresh their...
7
21317
by: Privacy Advocate | last post by:
//crossposted to: comp.lang.javascript, alt.comp.lang.javascript in an effort to get factual answers from JavaScript experts// Simply put; Is it possible to obtain the real (actual) IP address of someone (client) that visits a web site through an anonymous proxy if this person ONLY has JavaScript enabled in their browser? This is NOT a question about PHP, perl, VBScript, Java(.class), or ActiveX. Let us _only_ deal with JavaScript for...
5
2416
by: olduncleamos | last post by:
Hi all. Is there any legitimate reason the IP address from a client will change between request? I am wondering if I can autheticate a session by making sure they all come from the same IP. I realize that dial up servers will assign a different IP to the users each time they connect. Any help will be greatly appreciated.
9
4118
by: brett | last post by:
How can I get the IP address of a visitor to my site in ASP.NET 2.0? Please include the full namespace. Thanks, Brett
18
2472
by: damezumari | last post by:
I would like to know how many of the visitors to my site has js enabled and how many has it turned off. I haven't found a simple solution searching Google groups so I suggest the following using php and mysql: Create a table mc_jscount table in mysql with two fields nonjs (int) and js (int). Create one record with nonjs and js set to zero. Put this code at the top of your page:
3
11302
by: bush | last post by:
hi everyone! i want to get the ipaddress,and the country name of a webpage visitor,using asp.Net(C#).if anyone knows about it,plz rply me. thanx in advance.
0
11629
weaknessforcats
by: weaknessforcats | last post by:
Design Patterns: Visitor Introduction Polymorphism requires a class hierarchy where the interface to the hierarchy is in the base class. Virtual functions allow derived classes to override base class functions. Applications using polymorphism typically have functions with base class pointers or references as arguments. Then derived objects are created and used as arguments to these functions. Inside the function, only the base class methods...
8
1440
by: Spence | last post by:
My web site is built using ASP.NET, the host supporting .NET 3.5, SQL Server Express and Access. I want to start collecting some visitor stats, in particular OS and Browser used, pages visited, length of time on each page, screen size, browser window size and IP address. I'm hoping that this session information is available via the .NET framework. Can someone point me in the right direction please.
0
9620
marktang
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...
0
9454
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,...
0
10261
Oralloy
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...
0
10104
jinu1996
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...
1
10038
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,...
0
9912
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8934
agi2029
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...
0
6715
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5354
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 using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.