Code Monkey home page Code Monkey logo

php-mac-address's Introduction

#PHP MAC Address

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'));

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

php-mac-address's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.