dotfiles

configuration files for shell, text editor, graphical environment, etc.
git clone git://src.adamsgaard.dk/dotfiles
Log | Files | Refs | README | LICENSE Back to index

commit cadffe6ea6ef1f63d80152afe7e06d85ea18b49a
parent f2604bddffc967328b7e19f75ec9816da8bd2caa
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date:   Mon, 20 May 2019 08:33:29 +0200

Use macchanger for mac address spoofing

Diffstat:
M.local/bin/spoof-mac-address.sh | 10++++------
1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/.local/bin/spoof-mac-address.sh b/.local/bin/spoof-mac-address.sh @@ -18,15 +18,13 @@ sleepduration=$(echo 10 + $RANDOM/1000 | bc) echo -e "${yellow}Sleeping $sleepduration seconds...${reset}" sleep "$sleepduration" -echo "Bringing $device up" -sudo ip link set $device up +echo "Spoofing MAC address for $device" +sudo macchanger -r "$device" sleep 1 -fakemac=$(od -An -N6 -tx1 /dev/urandom | \ - sed -e 's/^ *//' -e 's/ */:/g' -e 's/:$//' -e 's/^\(.\)[13579bdf]/\10/') -echo "Spoofing MAC address for $device to $fakemac" -sudo ip link set $device address "$fakemac" # TODO: check with internet +echo "Bringing $device up" +sudo ip link set $device up echo -en "${yellow}Mac address of $device after:${reset}\t" printmac