Forums | MacLife
You are not logged in.
#1 2007-04-09 5:07 pm
Get user's NAT address or MAC address with PHP?
this is for a legitimate use - we have a problem with internal people filling out forms that our clients should be filling out and for legal reasons we can't have any of it. I'm wondering if it is possible to do a little back tracing of the request to get the internal IP address or MAC address of the client used to fill out the form.
Is there any way to packet sniff with PHP?
Offline
#2 2007-04-09 8:15 pm
- Rozzlapeed
- Born to be IT

- From: Scottsdale, AZ
- Registered: 2003-01-02
- Posts: 1095
- Website
Re: Get user's NAT address or MAC address with PHP?
PHP does have access to IP-related information. It's stored in the $_SERVER[] superglobal array.
PHP.net documentation
[edit] Short answer:
Code:
$user_ip = $_SERVER['REMOTE_ADDR']; $requested_page = $_SERVER['REQUEST_URI'];
Last edited by Rozzlapeed (2007-04-09 8:19 pm)
"He hoped and prayed that there wasn't an afterlife. Then he realized there was a contradiction involved here and merely hoped that there wasn't an afterlife."
-- Douglas Adams, The Hitch Hiker's Guide to the Galaxy
Offline
#3 2007-04-09 9:52 pm
- jb
- Member
- From: Melbourne, Australia.
- Registered: 2004-01-04
- Posts: 2179
Re: Get user's NAT address or MAC address with PHP?
That only gives the external IP address (or has, in my experiences).
I looked at this for a few hours as a matter of interest some time ago, and didn't find any answers. After some googling today, I found this page, with two options, but they both seem to be closed source. The first one doesn't seem to want any money, however.
They say that the most secure computer is the one not connected to the internet.
That's why security experts recommend Telstra BigPond.
Offline
#4 2007-04-09 10:08 pm
- jb
- Member
- From: Melbourne, Australia.
- Registered: 2004-01-04
- Posts: 2179
Re: Get user's NAT address or MAC address with PHP?
I also found IP Unmasker, a plugin for phpbb. I don't know java, so I couldn't strip it down, but it looks like it can be fitted for any application.
The coder's sample is here, and it works for me, behind two routers, both with NAT.
They say that the most secure computer is the one not connected to the internet.
That's why security experts recommend Telstra BigPond.
Offline
#5 2007-04-09 11:49 pm
Re: Get user's NAT address or MAC address with PHP?
<mr.burns>Excellent </mr.burns>
Offline
#6 2007-04-10 4:03 am
Re: Get user's NAT address or MAC address with PHP?
That begs the question, what use is snooping the internal address to you? If I happen to use the same private subnet as your co-workers, would I be blocked?
,xtG
.tsooJ
Offline
#7 2007-04-10 8:56 am
Re: Get user's NAT address or MAC address with PHP?
Yes... in this case we must block the use of this form from our offices. So blocking anybody in the building is OK, and preferred. Snooping the internal IP would help us track down the offenders and give them a good slap. Since a good deal of our customers are handled by sales teams we can't easily associate who might have used the form "for their customer" - but what the sales reps fail to understand is that there are legal issues with what they are signing their customers up for that can't be agreed to by the sales rep.
Blocking the entire company from using the form is 100% desireable.
Offline
#9 2007-04-10 12:50 pm
Re: Get user's NAT address or MAC address with PHP?
Well, site it hosted in California, we're in Colorado. Our external IP addresses (4) are all I need to worry about to cut them off, but if I could get the NAT'd address I could actually walk over and slap the offender. I'm being mean and not filtering the submission until they actually submit the form - that means I get to capture who they're trying to sign up and waste their "precious" time, the extra info would just help us with the final reprimand.
It isn't crucial, just wondering if it was possible.
Last edited by Gipetto (2007-04-10 12:52 pm)
Offline
#10 2007-04-10 2:41 pm
Re: Get user's NAT address or MAC address with PHP?
I'm in California.
Drop me a line and I'll go slap them for you 
Offline

