Giter Site home page Giter Site logo

spoof_mac_nick3499's Introduction

spoof_mac_nick3499

Python3: Spoof MAC Address: datetime.date(), subprocess.run()

Caution

spoof_mac.py can break a network connection, so users should avoid negative outcomes.

Bang Line

#! /snap/bin/pypy3 starts with a shebang (#!), which functions as a magic number:

Unix or Linux scripts may start with a shebang (#!, 23 21) followed by the path to an interpreter, if the interpreter is likely to be different from the one from which the script was invoked.1

PyPy3 Snap

In Ubuntu, /snap/bin/pypy3 can be installed in the CLI: $ snap install pypy3. python3 can be used otherwise.

Index Daily MAC Address

datetime.date.today().weekday() returns an integer used to index the MAC address of the day from mac_list.

mac_list = [
    "9A:E9:30:BF:99:3E",
    "AA:F4:25:C5:0E:2E",
    "9E:FF:D2:A5:B4:6C",
    "9E:FF:D2:A5:B4:6D",
    "CA:F2:6D:CF:15:67",
    "02:4D:64:22:FE:70",
    "7E:AE:18:B4:32:19"
]

On Saturday, value returned by datetime.date.today().weekday() is 5, which indexes mac_list[5] which returns '02:4D:64:22:FE:70', the MAC address for Saturday MAC address.

Run the Script

$ python3 ~/Applications/py/spoof_mac/spoof_mac.py

Alternative: Shell Script

#! /bin/sh
# spoof MAC address
$HOME/scripts/spoof_mac/./spoof_mac.py

# check network device name with spoofed MAC address
sudo lshw -class network | egrep 'serial|logical name'

gen_mac

gen_mac.py generates a pseudo-random MAC address. The first part of the spoofed MAC address comes from a list of organizationally unique identifiers.

  1. Magic_number_(programming): In_files

ko-fi

spoof_mac_nick3499's People

Contributors

nick3499 avatar

Watchers

 avatar  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.