Does Puppy have a spoofing of hardware address for WiFi?

For discussions about security.
Message
Author
User avatar
perdido
Posts: 1528
Joined: Mon 09 Dec 2013, 16:29
Location: ¿Altair IV , Just north of Eeyore Junction.?

#31 Post by perdido »

stemsee wrote:So from your post I see that something does not behave the same on bionic/precise as it does on fatdog ... . I use yad version 42.
Hi stemsee,
I will try and find a 32-bit yad 42 to upgrade with, might make a difference.

I satrted with yad 33 in precise and that worked when manually choosing interface but failed when the mouse-click method was implemented. Upgrading to yad 40 fixed that so maybe upgrading again could be the solution.

Will report back on this if I test with yad 42.

Thanks for building this utility!

.

stemsee

#32 Post by stemsee »

The problem is the ifconfig behaves differently.
try this

Code: Select all

#!/bin/sh
# by stemsee (C) 2019
#
[[ $(whoami) != "root" ]] && exec sudo -A ${0} ${@} 
export PROG=$(basename $0)
running=$(ps -e | grep -w "$PROG" | wc -l)
[[ "$running" -gt 2 ]] && exit  # run only one instance
export track=/tmp/rmac
[[ -d $track ]] && rm -rf $track
mkdir -p $track
mkfifo $track/rmp
exec 1<> $track/rmp
export OS=$(uname -a | awk '{print $2}')
case $OS in
fatdog*|Fatdog*|fd64*|FD64*) export hwether=$(ifconfig $int | grep -e 'ether' | awk '{print $2}');;
*) export hwether=$(ifconfig $int | grep -e 'HWaddr' | awk '{print $5}');;
esac
echo "hwether=$hwether" > $track/hweth

function restore (){
[[ -f "$track"/int ]] && int="$(cat $track/int)"
[[ -f $track/hweth ]] && . $track/hweth
	    ifconfig $int down
		ifconfig $int hw ether $hwether
		ifconfig $int up
		echo -e '\f'
		echo -e '\f'
		echo ""
		echo "$hwether"
		echo "$hwether"
		[[ ! -z $int ]] && echo "$int selected" || echo "NO iface Selected"	
}; export -f restore

function ranmacfn (){  #code found on net, set random mac
case $OS in
fatdog*|Fatdog*|fd64*|FD64*) export hwether=$(ifconfig $int | grep -e 'ether' | awk '{print $2}');;
*) export hwether=$(ifconfig $int | grep -e 'HWaddr' | awk '{print $5}');;
esac
echo "hwether=$hwether" > "$track"/hwethRM
[[ -f "$track"/int ]] && int="$(cat $track/int)"
OUI="/usr/sbin/RanMacList"
OUI_LEN=24931
        R=$(((RANDOM % ${OUI_LEN})+1))
        PREFIX=$(head -$R $OUI | tail -1)
        CMD="ifconfig ${int} hw ether ${PREFIX}:"
        for i in $(seq 1 6); do
            R=$(((RANDOM % 15)+1))
            C=$(echo "obase=16; $R" | bc)
            CMD="${CMD}${C}"
            if [ $((i % 2)) = 0 ] && [ $i != 6 ]; then
                CMD="$CMD:"
            fi
        done
        RESULT=$($CMD)
       	export CMD=$(echo $CMD | cut -f5 -d' ')
       	ifconfig $int down
       	ifconfig $int hw ether $CMD
		ifconfig $int up
echo -e '\f'
echo -e '\f'
echo "$hwether"
echo "$CMD"
[[ ! -z $int ]] && echo "$int selected" || echo "NO iface Selected"
}; export -f ranmacfn

function showfn (){
[[ -f "$track"/int ]] && int="$(cat $track/int)"
echo -e '\f'
echo -e '\f'
echo "$hwether"
echo "$CMD"
[[ ! -z $int ]] && echo "$int selected" || echo "NO iface Selected"
}; export -f showfn

function on_exit (){
	rm -rf $track
}; export -f on_exit
trap 'bash -c on_exit' EXIT

yad --plug=$$ --tabnum=1 --item-separator='\n' --list --column="Interface" $(ls /sys/class/net | grep -v 'lo') \
--select-action="bash -c 'printf "%s" > $track/int; bash -c showfn > $track/rmp'" --dclick-action="bash -c ranmacfn" &

yad --plug=$$ --tabnum=2 \
--form --cycle-read --field="Selected Interface:RO" --field="Start Mac:RO" --field="This Mac:RO" <&1 &

bash -c showfn

yad --paned --splitter="-140" --height="200" --key=$$ --orient=vert --tab=iface --tab=MAc --title="    Random Mac Generator" \
--window-icon="/usr/share/pixmaps/configure.png" --button="New Mac:bash -c ranmacfn > $track/rmp" \
--button="Saved Mac:bash -c 'restore > $track/rmp'" --button="gtk-cancel:1"

stemsee

#33 Post by stemsee »

duplicate

User avatar
perdido
Posts: 1528
Joined: Mon 09 Dec 2013, 16:29
Location: ¿Altair IV , Just north of Eeyore Junction.?

#34 Post by perdido »

Hi stemsee,
Tested in bionic32 18.05 & precise 5.7.1 using yad 40
Latest script output using 32-bit precise in pics
Attachments
mac1_2020-01-05_003728.jpg
Start-up window, no user input yet
(19.3 KiB) Downloaded 82 times
mac2_2020-01-05_003825.jpg
Hilite &quot;Interface&quot; choice
(19.13 KiB) Downloaded 82 times
mac3_2020-01-05_004032.jpg
After double mouse click &quot;Interface&quot; choice
(20.13 KiB) Downloaded 82 times
mac4_2020-01-05_004301.jpg
After mouse click on &quot;New Mac&quot; button
(20.67 KiB) Downloaded 82 times
mac5_2020-01-05_004322.jpg
After mouse click on &quot;Saved Mac&quot; button
(20.68 KiB) Downloaded 79 times

Post Reply