Upload files to ''

improvements and wipri-list ready to use generating first mac on install.sh
master
RightToPrivacy 2022-04-23 18:13:12 -04:00
parent a0800398dd
commit 20fdcf9332
2 changed files with 63 additions and 15 deletions

35
wipri
View File

@ -148,7 +148,7 @@ checktime=".5" # seconds between mac addr checks: lower = more frequent check
hightime="600" # Make this number higher if you want randomization times longer
lowtime="300" # Make this number lower to lower min time randomized
rando=$((RANDOM%$hightime+$lowtime)) # Create Random time
kernmit="on" # Turn on to mitigate kernel (warning: passes changes to kernel)
kernmit="on" # Turn on to mitigate kernel (warning: passes changes to kernel) - it's optional
oui_file='/etc/wipri/final.OUI' # Valid OUI list required for verifiable MAC addresses
phoui_file='/etc/wipri/phone.OUI' # phone OUI file
@ -172,21 +172,26 @@ function hostn {
array[4]="Owner-iPhone"
array[5]="PC"
array[6]="Toshiba"
groupnum=$[ $RANDOM % 7 ]
array[7]="WORKGROUP"
array[8]="macbook"
array[9]="mac"
array[10]="phone"
groupnum=$[ $RANDOM % 11 ]
hostbase=${array[$groupnum]}
if [ $hostbase == "localhost" ]; then
hostnamectl set-hostname localhost
echo -e "$BLUE hostname is $RED'localhost'$ENDCOLOR, $BLUE a fine generic Linux hostname. $ENDCOLOR"
elif [ $hostbase == "My-iPhone" ]; then
randhostname="My-iPhone"
hostnamectl set-hostname My-iPhone
/bin/echo -e "$BLUE Hostname (logged by router/network) is now $ENDCOLOR $RED My-iPhone $ENDCOLOR"
elif [ $hostbase != "localhost" ]; then
randhostname="$hostbase-$RANDOM"
hostnamectl set-hostname $randhostname
/bin/echo -e "$BLUE Hostname (logged by router/network) is now $ENDCOLOR$RED$randhostname $ENDCOLOR"
fi
hostnamectl set-hostname $hostbase
### Below commented out for now
# if [ $hostbase == "localhost" ]; then
# hostnamectl set-hostname localhost
# echo -e "$BLUE hostname is $RED'localhost'$ENDCOLOR, $BLUE a fine generic Linux hostname. $ENDCOLOR"
# elif [ $hostbase == "My-iPhone" ]; then
# randhostname="My-iPhone"
# hostnamectl set-hostname My-iPhone
# /bin/echo -e "$BLUE Hostname (logged by router/network) is now $ENDCOLOR $RED My-iPhone $ENDCOLOR"
# elif [ $hostbase != "localhost" ]; then
# randhostname="$hostbase-$RANDOM"
# hostnamectl set-hostname $randhostname
# /bin/echo -e "$BLUE Hostname (logged by router/network) is now $ENDCOLOR$RED$randhostname $ENDCOLOR"
# fi
dhclient -r $netdev
dhclient $netdev

43
wipri-eth0.service Normal file
View File

@ -0,0 +1,43 @@
# Contents of /etc/systemd/system/wipri.service
# This is an example file used for adding 2nd service for wipri for ethernet
#
# Instructions to use this file:
#
# 1.) Install wipri either as command or boot (for wifi for example)
# 2.) Edit this file to change flag (-i is all brands) and eth0 to your ethernet device (eth0 most common)
# 3.) Copy this wipri-eth0.service file using command below:
# sudo cp wipri-eth0.service /etc/systemd/system/wipri-eth0.service
# 4.) Run the following commands to load and enable eth0 randomization at boot:
# sudo systemctl daemon-reload
# sudo systemctl enable wipri-eth0.service
# 5.) Now next time you boot, your eth0 device should be using wipri!
#
# STOP WIPRI ETHERNET SERVICE: sudo systemctl stop wipri-eth0
# DISABLE WIPRI ETHERNET SERVICE: sudo systemctl disable wipri-eth0
#
# DISABLING wipri-eth0 will prevent it from starting next boot.
# If you have problems, follow above command to STOP wipri-eth0 to end process
#
# Have fun!
# righttoprivacy[at]tutanota.com
# Tutorials / Support: https://buymeacoffee.com/politictech
#
[Unit]
Description=WiPri eth0 Privacy Enhancement
# Change mac
Before=basic.target
After=boot.mount
DefaultDependencies=no
# Feel free to change wipri commands below to meet your needs/wants
[Service]
Type=simple
ExecStart=wipri -d eth0 -i
ExecReload=killall -9 wipri;wipri -d eth0 -i
ExecStop=killall -9 wipri
Restart=on-failure
RemainAfterExit=no
[Install]
WantedBy=basic.target