Re: [PHP] Find MAC Address in PHP

2007-04-26 Thread Nathaniel Hall

chris smith wrote:

On 4/25/07, Nathaniel Hall [EMAIL PROTECTED] wrote:

Davi wrote:
 Em Domingo 22 Abril 2007 03:12, Richard Lynch escreveu:

 On Fri, April 20, 2007 3:00 pm, Nathaniel Hall wrote:

 ?php $MAC = system(arp 192.168.200.254); echo $MAC; ?
 does not give me any
 output.  I have copied arp to a place that the apache user can 
execute

 from and ensured arp is executable.

 Use exec and the extra args to get error codes.


 ARP is a root-command... =]


 Can you run 'arp' and get what you want from command line?


 As web-user? No.


 Can you 'su' to PHP user and *then* run it and get what you want?


 Hum... Not at all... You need to enter the root password... How can 
you do

 that?
 sudo sounds a little better... But... How about security?

I know it can be done because I have a Fedora Core 4 system doing it
right now.  I didn't have to do anything special for it to work.  The
system I am working on now is a Fedora Core 6 box.  In /var/log/messages
I receive:

Apr 24 09:33:51 STUAUTH kernel: audit(1177425231.020:114): avc:  denied
{ execute } for  pid=31786 comm=httpd name=bash dev=dm-0 ino=916642
scontext=root:system_r:httpd_t:s0
tcontext=system_u:object_r:shell_exec_t:s0 tclass=file


If fixing up selinux doesn't work then look in to using 'sudo'. The
manpage(s) show examples about how to set it up to allow specific
commands to be run without a password.



Thanks for everybody's help.  I have narrowed the problem down to 
SELinux.  Once I disabled SELinux the arp command works fine.  I'm now 
in the process of making it where SELinux can remain on while allowing 
PHP to execute the command.  Thanks a lot.


--
Nathaniel Hall, GSEC GCFW GCIA GCIH GCFA

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Find MAC Address in PHP

2007-04-24 Thread Daevid Vincent
This may help you (find .tgz file at the page bottom):

http://daevid.com/examples/dhcp/

This is a little web tool I use to see who is on my LAN

D.Vin 

 -Original Message-
 From: Nathaniel Hall [mailto:[EMAIL PROTECTED] 
 Sent: Friday, April 20, 2007 1:00 PM
 To: php-general@lists.php.net
 Subject: [PHP] Find MAC Address in PHP
 
 Hi all,
 
 I am attempting to find the MAC address of systems visiting 
 my page from 
 the local LAN.  I have tried several things, but it appears 
 it will not 
 let me run system commands.  For example, running ?php $MAC = 
 system(arp 192.168.200.254); echo $MAC; ? does not give me any 
 output.  I have copied arp to a place that the apache user 
 can execute 
 from and ensured arp is executable.
 
 This is on a Fedora Core 6 box running PHP 5.1.6-3.4 and Apache 
 2.2.3-5.  Any help is appreciated.
 
 --
 Nathaniel Hall
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Find MAC Address in PHP

2007-04-24 Thread Tijnema !

On 4/23/07, Davi [EMAIL PROTECTED] wrote:

Em Domingo 22 Abril 2007 03:12, Richard Lynch escreveu:
 On Fri, April 20, 2007 3:00 pm, Nathaniel Hall wrote:
  ?php $MAC = system(arp 192.168.200.254); echo $MAC; ?
  does not give me any
  output. I have copied arp to a place that the apache user can execute
  from and ensured arp is executable.

 Use exec and the extra args to get error codes.

ARP is a root-command... =]


Ok, maybe it's because i've builded my own Linux, and didn't wanted to
have any security, but /sbin/arp has chmod value 755 on my system, and
so, i can execute it with any user.




 Can you run 'arp' and get what you want from command line?

As web-user? No.


i can :)



 Can you 'su' to PHP user and *then* run it and get what you want?

Hum... Not at all... You need to enter the root password... How can you do
that?
sudo sounds a little better... But... How about security?


Hmm, that would mean that you have to store your root password in your
PHP script ... I don't prefer that, maybe you could use it on a
development server, but don't use it on production server ;)



 If not, you can't do that.

And with a shell-script outputting the MAC to a .txt temp file, reading it
from the PHP script?

BTW, have a look at suPHP [1]... =]

[1] - http://www.howtoforge.com/suphp_debian_etch_ispconfig


That's really a big job to install :(

Tijnema

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Find MAC Address in PHP

2007-04-24 Thread Davi
Em Terça 24 Abril 2007 10:07, Tijnema ! escreveu:
 On 4/23/07, Davi [EMAIL PROTECTED] wrote:
  Em Domingo 22 Abril 2007 03:12, Richard Lynch escreveu:
   On Fri, April 20, 2007 3:00 pm, Nathaniel Hall wrote:
?php $MAC = system(arp 192.168.200.254); echo $MAC; ?
does not give me any
output. I have copied arp to a place that the apache user can execute
from and ensured arp is executable.
  
   Use exec and the extra args to get error codes.
 
  ARP is a root-command... =]

 Ok, maybe it's because i've builded my own Linux, and didn't wanted to
 have any security, but /sbin/arp has chmod value 755 on my system, and
 so, i can execute it with any user.


cheatter... =P

   Can you run 'arp' and get what you want from command line?
 
  As web-user? No.

 i can :)

cheatter... =P

   Can you 'su' to PHP user and *then* run it and get what you want?
 
  Hum... Not at all... You need to enter the root password... How can you
  do that?
  sudo sounds a little better... But... How about security?

 Hmm, that would mean that you have to store your root password in your
 PHP script ... I don't prefer that, maybe you could use it on a
 development server, but don't use it on production server ;)


Yes... You store your root pwd in your script then:

?php

$root_pwd=123456;

echo system(su - -c arp);

?

$ su - -c arp
Password:

How you'll type your root pwd? =P

   If not, you can't do that.
 
  And with a shell-script outputting the MAC to a .txt temp file, reading
  it from the PHP script?

#!/bin/bash

if [ ! $# -eq 1 ]; then
echo Usage: $0 target_ip;
exit;
fi;

MAC_ADDR=`sudo arp | grep $1 | cut -d  -f18`

echo ${MAC_ADDR}  /your/html/pub/dir/mac_temp.txt


?php

$mac=file(mac_temp.txt);

foreach($mac_addr as $mac){
echo $mac_addr;
}

?

 
  BTW, have a look at suPHP [1]... =]
 
  [1] - http://www.howtoforge.com/suphp_debian_etch_ispconfig

 That's really a big job to install :(

Yeah!! =P


-- 
Davi Vidal
[EMAIL PROTECTED]
[EMAIL PROTECTED]
--
Religion, ideology, resources, land,
spite, love or just because...
No matter how pathetic the reason,
it's enough to start a war. 


pgpwZwDXPVazK.pgp
Description: PGP signature


Re: [PHP] Find MAC Address in PHP

2007-04-24 Thread Tijnema !

On 4/24/07, Davi [EMAIL PROTECTED] wrote:

Em Terça 24 Abril 2007 10:07, Tijnema ! escreveu:
 On 4/23/07, Davi [EMAIL PROTECTED] wrote:
  Em Domingo 22 Abril 2007 03:12, Richard Lynch escreveu:
   On Fri, April 20, 2007 3:00 pm, Nathaniel Hall wrote:
?php $MAC = system(arp 192.168.200.254); echo $MAC; ?
does not give me any
output. I have copied arp to a place that the apache user can execute
from and ensured arp is executable.
  
   Use exec and the extra args to get error codes.
 
  ARP is a root-command... =]

 Ok, maybe it's because i've builded my own Linux, and didn't wanted to
 have any security, but /sbin/arp has chmod value 755 on my system, and
 so, i can execute it with any user.


cheatter... =P


I hate security ;)
Also, i have Apache running as root, so i can execute everything i want :)



   Can you run 'arp' and get what you want from command line?
 
  As web-user? No.

 i can :)

cheatter... =P

   Can you 'su' to PHP user and *then* run it and get what you want?
 
  Hum... Not at all... You need to enter the root password... How can you
  do that?
  sudo sounds a little better... But... How about security?

 Hmm, that would mean that you have to store your root password in your
 PHP script ... I don't prefer that, maybe you could use it on a
 development server, but don't use it on production server ;)


Yes... You store your root pwd in your script then:

?php

$root_pwd=123456;

echo system(su - -c arp);

?

$ su - -c arp
Password:

How you'll type your root pwd? =P


Something with the proc_* functions as you need bi-directional streams
(input/output). Something like this: (not tested, partly copied form
example 1926)
?php

$root_pwd=123456;

$descriptorspec = array(
  0 = array(pipe, r),  // stdin is a pipe that the child will read from
  1 = array(pipe, w),  // stdout is a pipe that the child will write to
  2 = array(file, /tmp/error-output.txt, a) // stderr is a
file to write to
);

$process = proc_open('su - -c arp', $descriptorspec, $pipes);

if (is_resource($process)) {
   fwrite($pipes[0], $root_pwd.\r\n);
   fclose($pipes[0]);

   echo stream_get_contents($pipes[1]);
   fclose($pipes[1]);

   proc_close($process);
}
?



   If not, you can't do that.
 
  And with a shell-script outputting the MAC to a .txt temp file, reading
  it from the PHP script?

#!/bin/bash

if [ ! $# -eq 1 ]; then
   echo Usage: $0 target_ip;
   exit;
fi;

MAC_ADDR=`sudo arp | grep $1 | cut -d  -f18`

echo ${MAC_ADDR}  /your/html/pub/dir/mac_temp.txt



Where's the root password? I guess you need it too when using sudo?



?php

$mac=file(mac_temp.txt);

foreach($mac_addr as $mac){
   echo $mac_addr;
}

?


Uhm, this is really weird code, i guess you meant this:

?php

$mac=file(mac_temp.txt);

foreach($mac as $mac_addr){
  echo $mac_addr;
}

?

But well, when you have root access to the server, it might be better
to just cheat like i did, and make arp available to the PHP user :)

Tijnema



 
  BTW, have a look at suPHP [1]... =]
 
  [1] - http://www.howtoforge.com/suphp_debian_etch_ispconfig

 That's really a big job to install :(

Yeah!! =P


--
Davi Vidal
[EMAIL PROTECTED]
[EMAIL PROTECTED]
--
Religion, ideology, resources, land,
spite, love or just because...
No matter how pathetic the reason,
it's enough to start a war. 




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Find MAC Address in PHP

2007-04-24 Thread Davi
Em Terça 24 Abril 2007 10:49, Tijnema ! escreveu:
 On 4/24/07, Davi [EMAIL PROTECTED] wrote:
  How you'll type your root pwd? =P

 Something with the proc_* functions as you need bi-directional streams
 (input/output). Something like this: (not tested, partly copied form
 example 1926)
 ?php

 $root_pwd=123456;

 $descriptorspec = array(
0 = array(pipe, r),  // stdin is a pipe that the child will read
 from 1 = array(pipe, w),  // stdout is a pipe that the child will
 write to 2 = array(file, /tmp/error-output.txt, a) // stderr is a
 file to write to
 );

 $process = proc_open('su - -c arp', $descriptorspec, $pipes);

 if (is_resource($process)) {
 fwrite($pipes[0], $root_pwd.\r\n);
 fclose($pipes[0]);

 echo stream_get_contents($pipes[1]);
 fclose($pipes[1]);

 proc_close($process);
 }
 ?


sounds cool... =]
I'll search for it...

 If not, you can't do that.
   
And with a shell-script outputting the MAC to a .txt temp file,
reading it from the PHP script?
 
  #!/bin/bash
 
  if [ ! $# -eq 1 ]; then
 echo Usage: $0 target_ip;
 exit;
  fi;
 
  MAC_ADDR=`sudo arp | grep $1 | cut -d  -f18`
 
  echo ${MAC_ADDR}  /your/html/pub/dir/mac_temp.txt

 Where's the root password? I guess you need it too when using sudo?

trick... =P
correctly configured, sudo doesn't need pwd for some commands...

see Ubuntu... ;)


  ?php
 
  $mac=file(mac_temp.txt);
 
  foreach($mac_addr as $mac){
 echo $mac_addr;
  }
 
  ?

 Uhm, this is really weird code, i guess you meant this:

 ?php

 $mac=file(mac_temp.txt);

 foreach($mac as $mac_addr){
echo $mac_addr;
 }

 ?


Yes... Sorry! =]

 But well, when you have root access to the server, it might be better
 to just cheat like i did, and make arp available to the PHP user :)

I'm some paranoic... =X
I wouldn't do it... =P


-- 
Davi Vidal
[EMAIL PROTECTED]
[EMAIL PROTECTED]
--
Religion, ideology, resources, land,
spite, love or just because...
No matter how pathetic the reason,
it's enough to start a war. 


pgp9WHLICjbd1.pgp
Description: PGP signature


Re: [PHP] Find MAC Address in PHP

2007-04-24 Thread chris smith

On 4/24/07, Tijnema ! [EMAIL PROTECTED] wrote:

On 4/24/07, Davi [EMAIL PROTECTED] wrote:
 Em Terça 24 Abril 2007 10:07, Tijnema ! escreveu:
  On 4/23/07, Davi [EMAIL PROTECTED] wrote:
   Em Domingo 22 Abril 2007 03:12, Richard Lynch escreveu:
On Fri, April 20, 2007 3:00 pm, Nathaniel Hall wrote:
 ?php $MAC = system(arp 192.168.200.254); echo $MAC; ?
 does not give me any
 output. I have copied arp to a place that the apache user can execute
 from and ensured arp is executable.
   
Use exec and the extra args to get error codes.
  
   ARP is a root-command... =]
 
  Ok, maybe it's because i've builded my own Linux, and didn't wanted to
  have any security, but /sbin/arp has chmod value 755 on my system, and
  so, i can execute it with any user.
 

 cheatter... =P

I hate security ;)
Also, i have Apache running as root, so i can execute everything i want :)


I hope you never make your server public then or try to become a
server-administrator.. Wow.

--
Postgresql  php tutorials
http://www.designmagick.com/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Find MAC Address in PHP

2007-04-24 Thread Nathaniel Hall

Richard Lynch wrote:

On Fri, April 20, 2007 3:00 pm, Nathaniel Hall wrote:
  

I am attempting to find the MAC address of systems visiting my page
from
the local LAN.  I have tried several things, but it appears it will
not
let me run system commands.  For example, running ?php $MAC =
system(arp 192.168.200.254); echo $MAC; ? does not give me any
output.  I have copied arp to a place that the apache user can execute
from and ensured arp is executable.



Use exec and the extra args to get error codes.

Can you run 'arp' and get what you want from command line?

Can you 'su' to PHP user and *then* run it and get what you want?

If not, you can't do that.

I dunno what 'arp' is gonna give you, but I wouldn't think you'd in
general have access to the MAC address of a visitor hardware...  Nor
should you, actually...  But if you've got your boxes configured to
let any ol' person run this 'arp' thing and reply with their MAC
addresses, I guess it oughta work...

  
Thanks for the help.  I believe I have narrowed it down to SELinux 
keeping Apache from executing commands.  Anybody had the same problem 
and know a fix?


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Find MAC Address in PHP

2007-04-24 Thread Nathaniel Hall

Davi wrote:

Em Domingo 22 Abril 2007 03:12, Richard Lynch escreveu:
  

On Fri, April 20, 2007 3:00 pm, Nathaniel Hall wrote:


?php $MAC = system(arp 192.168.200.254); echo $MAC; ?
does not give me any 
output.  I have copied arp to a place that the apache user can execute

from and ensured arp is executable.
  

Use exec and the extra args to get error codes.



ARP is a root-command... =]

  

Can you run 'arp' and get what you want from command line?



As web-user? No.

  

Can you 'su' to PHP user and *then* run it and get what you want?



Hum... Not at all... You need to enter the root password... How can you do 
that?

sudo sounds a little better... But... How about security?


I know it can be done because I have a Fedora Core 4 system doing it 
right now.  I didn't have to do anything special for it to work.  The 
system I am working on now is a Fedora Core 6 box.  In /var/log/messages 
I receive:


Apr 24 09:33:51 STUAUTH kernel: audit(1177425231.020:114): avc:  denied  
{ execute } for  pid=31786 comm=httpd name=bash dev=dm-0 ino=916642 
scontext=root:system_r:httpd_t:s0 
tcontext=system_u:object_r:shell_exec_t:s0 tclass=file


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Find MAC Address in PHP

2007-04-24 Thread Puskás Zsolt ( Errotan )
Hi.
Sorry for my bad english. :(

Maybe you could write a simple deamon program in C or even in PHP to be run as 
root. The function of this deamon program is to listen to a port (eg. 1) 
and you could fsockopen it and send the IP address of the client computer and 
the deamon returns the MAC address of that computer. I used this kind a 
scheme for another problem so I guess this works.


2007. április 20. 22.00 dátummal Nathaniel Hall ezt írta:
 Hi all,

 I am attempting to find the MAC address of systems visiting my page from
 the local LAN.  I have tried several things, but it appears it will not
 let me run system commands.  For example, running ?php $MAC =
 system(arp 192.168.200.254); echo $MAC; ? does not give me any
 output.  I have copied arp to a place that the apache user can execute
 from and ensured arp is executable.

 This is on a Fedora Core 6 box running PHP 5.1.6-3.4 and Apache
 2.2.3-5.  Any help is appreciated.

 --
 Nathaniel Hall

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Find MAC Address in PHP

2007-04-24 Thread Lori Lay

Nathaniel Hall wrote:

Davi wrote:

I know it can be done because I have a Fedora Core 4 system doing it 
right now.  I didn't have to do anything special for it to work.  The 
system I am working on now is a Fedora Core 6 box.  In 
/var/log/messages I receive:


Apr 24 09:33:51 STUAUTH kernel: audit(1177425231.020:114): avc:  
denied  { execute } for  pid=31786 comm=httpd name=bash dev=dm-0 
ino=916642 scontext=root:system_r:httpd_t:s0 
tcontext=system_u:object_r:shell_exec_t:s0 tclass=file


The avc: message means its SELinux, as you suspected.  You need to 
temporary disable the firewall by setting it to permissive, then use 
audit2allow to find out what the settings need to be to set up the 
permissions properly.  Look up audit2allow in the man page - they 
describe the process in there.


Lori

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Find MAC Address in PHP

2007-04-24 Thread Tijnema !

On 4/24/07, chris smith [EMAIL PROTECTED] wrote:

On 4/24/07, Tijnema ! [EMAIL PROTECTED] wrote:
 On 4/24/07, Davi [EMAIL PROTECTED] wrote:
  Em Terça 24 Abril 2007 10:07, Tijnema ! escreveu:
   On 4/23/07, Davi [EMAIL PROTECTED] wrote:
Em Domingo 22 Abril 2007 03:12, Richard Lynch escreveu:
 On Fri, April 20, 2007 3:00 pm, Nathaniel Hall wrote:
  ?php $MAC = system(arp 192.168.200.254); echo $MAC; ?
  does not give me any
  output. I have copied arp to a place that the apache user can 
execute
  from and ensured arp is executable.

 Use exec and the extra args to get error codes.
   
ARP is a root-command... =]
  
   Ok, maybe it's because i've builded my own Linux, and didn't wanted to
   have any security, but /sbin/arp has chmod value 755 on my system, and
   so, i can execute it with any user.
  
 
  cheatter... =P

 I hate security ;)
 Also, i have Apache running as root, so i can execute everything i want :)

I hope you never make your server public then or try to become a
server-administrator.. Wow.


It's my development server :)

It's LAN  only, that's why i don't need security...

I AM a server administrator, and yes, i do care about security there ;)

Tijnema


--
Postgresql  php tutorials
http://www.designmagick.com/



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Find MAC Address in PHP

2007-04-24 Thread chris smith

On 4/25/07, Nathaniel Hall [EMAIL PROTECTED] wrote:

Davi wrote:
 Em Domingo 22 Abril 2007 03:12, Richard Lynch escreveu:

 On Fri, April 20, 2007 3:00 pm, Nathaniel Hall wrote:

 ?php $MAC = system(arp 192.168.200.254); echo $MAC; ?
 does not give me any
 output.  I have copied arp to a place that the apache user can execute
 from and ensured arp is executable.

 Use exec and the extra args to get error codes.


 ARP is a root-command... =]


 Can you run 'arp' and get what you want from command line?


 As web-user? No.


 Can you 'su' to PHP user and *then* run it and get what you want?


 Hum... Not at all... You need to enter the root password... How can you do
 that?
 sudo sounds a little better... But... How about security?

I know it can be done because I have a Fedora Core 4 system doing it
right now.  I didn't have to do anything special for it to work.  The
system I am working on now is a Fedora Core 6 box.  In /var/log/messages
I receive:

Apr 24 09:33:51 STUAUTH kernel: audit(1177425231.020:114): avc:  denied
{ execute } for  pid=31786 comm=httpd name=bash dev=dm-0 ino=916642
scontext=root:system_r:httpd_t:s0
tcontext=system_u:object_r:shell_exec_t:s0 tclass=file


If fixing up selinux doesn't work then look in to using 'sudo'. The
manpage(s) show examples about how to set it up to allow specific
commands to be run without a password.

--
Postgresql  php tutorials
http://www.designmagick.com/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Find MAC Address in PHP

2007-04-23 Thread Davi
Em Domingo 22 Abril 2007 03:12, Richard Lynch escreveu:
 On Fri, April 20, 2007 3:00 pm, Nathaniel Hall wrote:
  ?php $MAC = system(arp 192.168.200.254); echo $MAC; ?
  does not give me any 
  output.  I have copied arp to a place that the apache user can execute
  from and ensured arp is executable.

 Use exec and the extra args to get error codes.

ARP is a root-command... =]


 Can you run 'arp' and get what you want from command line?

As web-user? No.


 Can you 'su' to PHP user and *then* run it and get what you want?

Hum... Not at all... You need to enter the root password... How can you do 
that?
sudo sounds a little better... But... How about security?


 If not, you can't do that.

And with a shell-script outputting the MAC to a .txt temp file, reading it 
from the PHP script?

BTW, have a look at suPHP [1]... =]

[1] - http://www.howtoforge.com/suphp_debian_etch_ispconfig

-- 
Davi Vidal
[EMAIL PROTECTED]
[EMAIL PROTECTED]
--

Agora com fortune:
Most people will listen to your unreasonable demands, if you'll consider
their unacceptable offer.


pgp7magXR3qDc.pgp
Description: PGP signature


Re: [PHP] Find MAC Address in PHP

2007-04-22 Thread Richard Lynch
On Fri, April 20, 2007 3:00 pm, Nathaniel Hall wrote:
 I am attempting to find the MAC address of systems visiting my page
 from
 the local LAN.  I have tried several things, but it appears it will
 not
 let me run system commands.  For example, running ?php $MAC =
 system(arp 192.168.200.254); echo $MAC; ? does not give me any
 output.  I have copied arp to a place that the apache user can execute
 from and ensured arp is executable.

Use exec and the extra args to get error codes.

Can you run 'arp' and get what you want from command line?

Can you 'su' to PHP user and *then* run it and get what you want?

If not, you can't do that.

I dunno what 'arp' is gonna give you, but I wouldn't think you'd in
general have access to the MAC address of a visitor hardware...  Nor
should you, actually...  But if you've got your boxes configured to
let any ol' person run this 'arp' thing and reply with their MAC
addresses, I guess it oughta work...

-- 
Some people have a gift link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Find MAC Address in PHP

2007-04-21 Thread Zoltán Németh
The OP said he wants MACs for the machines on his local LAN. In that
case I don't think he would have meet the things you said.

greets
Zoltán Németh

2007. 04. 21, szombat keltezéssel 07.49-kor Satyam ezt írta:
 Don't bother, if you manage to get a MAC, it won't be that of the client 
 machine in the majority of cases since the IP you get for the request is 
 not, in most cases, the one for that machine, but that of the proxy, router 
 and zillion of other things that step in the middle and change the IP.
 
 Satyam
 
 - Original Message - 
 From: Nathaniel Hall [EMAIL PROTECTED]
 To: php-general@lists.php.net
 Sent: Friday, April 20, 2007 10:00 PM
 Subject: [PHP] Find MAC Address in PHP
 
 
  Hi all,
 
  I am attempting to find the MAC address of systems visiting my page from 
  the local LAN.  I have tried several things, but it appears it will not 
  let me run system commands.  For example, running ?php $MAC = system(arp 
  192.168.200.254); echo $MAC; ? does not give me any output.  I have 
  copied arp to a place that the apache user can execute from and ensured 
  arp is executable.
 
  This is on a Fedora Core 6 box running PHP 5.1.6-3.4 and Apache 2.2.3-5. 
  Any help is appreciated.
 
  --
  Nathaniel Hall
 
  -- 
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 
  -- 
  No virus found in this incoming message.
  Checked by AVG Free Edition.
  Version: 7.5.446 / Virus Database: 269.5.5/769 - Release Date: 19/04/2007 
  17:56
 
  
 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Find MAC Address in PHP

2007-04-21 Thread Satyam
I'm sorry, I missed that, you are right, unless there are subnets within the 
company, several offices in distant locations.


Satyam


- Original Message - 
From: Zoltán Németh [EMAIL PROTECTED]

To: Satyam [EMAIL PROTECTED]
Cc: Nathaniel Hall [EMAIL PROTECTED]; php-general@lists.php.net
Sent: Saturday, April 21, 2007 9:10 AM
Subject: Re: [PHP] Find MAC Address in PHP



The OP said he wants MACs for the machines on his local LAN. In that
case I don't think he would have meet the things you said.

greets
Zoltán Németh

2007. 04. 21, szombat keltezéssel 07.49-kor Satyam ezt írta:

Don't bother, if you manage to get a MAC, it won't be that of the client
machine in the majority of cases since the IP you get for the request is
not, in most cases, the one for that machine, but that of the proxy, 
router

and zillion of other things that step in the middle and change the IP.

Satyam

- Original Message - 
From: Nathaniel Hall [EMAIL PROTECTED]

To: php-general@lists.php.net
Sent: Friday, April 20, 2007 10:00 PM
Subject: [PHP] Find MAC Address in PHP


 Hi all,

 I am attempting to find the MAC address of systems visiting my page 
 from

 the local LAN.  I have tried several things, but it appears it will not
 let me run system commands.  For example, running ?php $MAC = 
 system(arp

 192.168.200.254); echo $MAC; ? does not give me any output.  I have
 copied arp to a place that the apache user can execute from and ensured
 arp is executable.

 This is on a Fedora Core 6 box running PHP 5.1.6-3.4 and Apache 
 2.2.3-5.

 Any help is appreciated.

 --
 Nathaniel Hall

 -- 
 PHP General Mailing List (http://www.php.net/)

 To unsubscribe, visit: http://www.php.net/unsub.php



 -- 
 No virus found in this incoming message.

 Checked by AVG Free Edition.
 Version: 7.5.446 / Virus Database: 269.5.5/769 - Release Date: 
 19/04/2007

 17:56







--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.463 / Virus Database: 269.5.6/770 - Release Date: 20/04/2007 
18:43





--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Find MAC Address in PHP

2007-04-20 Thread Nathaniel Hall

Hi all,

I am attempting to find the MAC address of systems visiting my page from 
the local LAN.  I have tried several things, but it appears it will not 
let me run system commands.  For example, running ?php $MAC = 
system(arp 192.168.200.254); echo $MAC; ? does not give me any 
output.  I have copied arp to a place that the apache user can execute 
from and ensured arp is executable.


This is on a Fedora Core 6 box running PHP 5.1.6-3.4 and Apache 
2.2.3-5.  Any help is appreciated.


--
Nathaniel Hall

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Find MAC Address in PHP

2007-04-20 Thread Daniel Brown

   Usually arp on Linux requires the user to be logged in as root.  If you
can run it, try this:

?
 ob_start();
 passthru('arp '.$ip_addr);
 $MAC = ob_get_contents();
 ob_end_clean();
?



On 4/20/07, Nathaniel Hall [EMAIL PROTECTED] wrote:


Hi all,

I am attempting to find the MAC address of systems visiting my page from
the local LAN.  I have tried several things, but it appears it will not
let me run system commands.  For example, running ?php $MAC =
system(arp 192.168.200.254); echo $MAC; ? does not give me any
output.  I have copied arp to a place that the apache user can execute
from and ensured arp is executable.

This is on a Fedora Core 6 box running PHP 5.1.6-3.4 and Apache
2.2.3-5.  Any help is appreciated.

--
Nathaniel Hall

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php





--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107


Re: [PHP] Find MAC Address in PHP

2007-04-20 Thread Satyam
Don't bother, if you manage to get a MAC, it won't be that of the client 
machine in the majority of cases since the IP you get for the request is 
not, in most cases, the one for that machine, but that of the proxy, router 
and zillion of other things that step in the middle and change the IP.


Satyam

- Original Message - 
From: Nathaniel Hall [EMAIL PROTECTED]

To: php-general@lists.php.net
Sent: Friday, April 20, 2007 10:00 PM
Subject: [PHP] Find MAC Address in PHP



Hi all,

I am attempting to find the MAC address of systems visiting my page from 
the local LAN.  I have tried several things, but it appears it will not 
let me run system commands.  For example, running ?php $MAC = system(arp 
192.168.200.254); echo $MAC; ? does not give me any output.  I have 
copied arp to a place that the apache user can execute from and ensured 
arp is executable.


This is on a Fedora Core 6 box running PHP 5.1.6-3.4 and Apache 2.2.3-5. 
Any help is appreciated.


--
Nathaniel Hall

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.446 / Virus Database: 269.5.5/769 - Release Date: 19/04/2007 
17:56





--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php