In PHP, exec is used to obtain the code with the unique identifier of the computer, and the CPU and Nic MAC address information can be obtained.
The code is as follows:
// Obtain the CPU information of the computer
Function OnlyU (){
$ A = '';
$ B = array ();
If (function_exists ('exec ')){
If (mailto :! @ Exec (/all ", $ B )){
Return false;
}
} Elseif (function_exists ('system ')){
Ob_start ();
If (mailto :! @ System (/all ")){
Return false;
} Else {
}
$ B = ob_get_contents ();
Ob_end_clean ();
$ B = explode ("\ n", $ B); // print_r ($ B );
Array_pop ($ B );
} Else {
Return false;
}
$ All = sizeof ($ B );
For ($ I = 0; $ I <$ all; $ I ++ ){
If (strpos ($ B [$ I], "Description ")! = False ){
If (strpos ($ B [$ I + 1], "Physical Address ")! = False ){
$ C = explode (":", $ B [$ I + 1]);
$ A = trim ($ c [1]);
Break;
}
}
} // End
Return empty ($ )? False: $;
} // End function OnlyU
// Obtain the MAC address of the NIC
Function getMAC (){
@ Exec ("ipconfig/all", $ array );
For ($ Tmpa; $ Tmpa If (eregi ("Physical", $ array [$ Tmpa]) {
$ Mac = explode (":", $ array [$ Tmpa]);
Return $ mac [1];
}
}
}