SHARE
TWEET

Untitled

a guest Aug 27th, 2011 85 Never
  1. <?php
  2. $mac="00:1d:92:23:45:d5";
  3. $ip=$_SERVER['REMOTE_ADDR'];
  4. $mac=shell_exec("ping $ip -c 1 1>/dev/null && /usr/sbin/arp | grep $ip | grep -oh [0-9a-f][0-9a-f][:-][0-9a-f][0-9a-f][:-][0-9a-f][0-9a-f][:-][0-9a-f][0-9a-f][:-][0-9a-f][0-9a-f][:-][0-9a-f][0-9a-f]");
  5. $maccheck=shell_exec("cat /var/www/IPs | grep $mac");
  6. echo $ip;
  7. echo $mac;
  8. ob_end_clean();
  9. if ( $maccheck == '' ) {
  10. echo("you may pass! please click the button below");
  11. echo("<form method='post' action='$PORTAL_ACTION$'>
  12. <input type='hidden' name='redirurl' value='$PORTAL_REDIRURL$'>
  13. <input name='accept' type='submit' value='Start browsing the web!'>
  14. </form>");
  15. echo $mac;
  16. $file=fopen("/var/www/IPs", "a");
  17. $output=fwrite($file, $mac);
  18. } else {
  19. echo("YOU MAY NOT PASS!");
  20. }
  21. ?>
RAW Paste Data
Top