blake-gardner/mac-address 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

blake-gardner/mac-address

最新稳定版本:2.2.0

Composer 安装命令:

composer require blake-gardner/mac-address

包简介

Get, validate and generate MAC addresses.

README 文档

README

This is a PHP class for MAC address manipulation on top of Unix, Linux and Mac OS X operating systems. it was primarily written to help with spoofing for wireless security audits.

Capabilities

  • Verify you are executing it from the command line
  • Verify you are running the script as an administrator
  • Generate new random MAC addresses
  • Validate MAC addresses
  • Get the current system’s MAC address
  • Set or “spoof” any MAC address you want

Usage

// require the class
require_once './src/BlakeGardner/MacAddress.php';

// import the class
use BlakeGardner\MacAddress;

// get the mac address of the eth0 interface
var_dump(MacAddress::getCurrentMacAddress('eth0'));

// generate a random mac address
var_dump(MacAddress::generateMacAddress());

// validate an MAC address
var_dump(MacAddress::validateMacAddress('00-B0-D0-86-BB-F7'));

// set a randomly generated MAC address on the eth0 interface
var_dump(MacAddress::setFakeMacAddress('eth0'));

// set a specific MAC address on the eth0 interface
var_dump(MacAddress::setFakeMacAddress('eth0', '00:E4:01:2C:79:DA'));

// get the mac address of the eth0 interface using the ifconfig path that we define 
var_dump(MacAddress::getCurrentMacAddress('eth0', '/usr/local/sbin/ifconfig'));
echo "\n";

For more see the example.php file. You can run the example on the command line as root. php example.php

Planned Features

  • List all interfaces on the system
  • OS detection
  • Suppress errors on the command line

统计信息

  • 总下载量: 36.1k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 74
  • 点击次数: 0
  • 依赖项目数: 2
  • 推荐数: 0

GitHub 信息

  • Stars: 73
  • Watchers: 9
  • Forks: 57
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2013-05-19