Jump to content

jjd

Active Members
  • Posts

    169
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by jjd

  1. ok script updated

    it no longer supports using macchanger so you now need to have the maclist.lst downloaded although it seems most people have installed with the install command so that should not be an issue

    I removed the macchanger function because it was so painfully slow!

    the update now uses arrays for the number of wlan interfaces available and changes all their mac's (so if you have a usb wireless card it gets changed as well)

    the update also fixes an issue where it could generate a single character segment of a mac address and bring down the interface

    if you want to use a usb wifi card you will need to update you wireless config file first by running

    wifi detect > /etc/config/wireless && reboot

    or

    changemac -reset
    

    the new code:

    #!/bin/bash
     
    FILE=/usr/share/changemac/maclist.lst
    # Set location of maclist.lst
     
    function randmac {
    let "n=${RANDOM}%$(wc -l < $FILE)"
    RANDMACF=$(head -n $n $FILE | tail -1)
    octets=${RANDMACF:7:8}
    RANGE=255
    #generate random numbers
    number=$(($RANDOM%255+16))
    numbera=$(($RANDOM%255+16))
    numberb=$(($RANDOM%255+16))
    #ensure they are less than ceiling
    let "number %= $RANGE"
    let "numbera %= $RANGE"
    let "numberb %= $RANGE"
    #hec conversion
    octeta=`echo "obase=16;$number" | bc`
    octetb=`echo "obase=16;$numbera" | bc`
    octetc=`echo "obase=16;$numberb" | bc`
    #checks that each section of mac contains two characters if not adds 0 to the end
    if [ ${#octeta} = "1" ]; then
    octeta=$octeta"0"
    fi
    if [ ${#octetb} = "1" ]; then
    octetb=$octetb"0"
    fi
    if [ ${#octetc} = "1" ]; then
    octetc=$octetc"0"
    fi 
    #generate mac
    macadd="${octets}:${octeta}:${octetb}:${octetc}"
    echo $macadd 
    }
     
    function changeset {
    for i in `seq 0 $numbint`
    do
    uci set wireless.@wifi-iface[$i].macaddr=${arrmac[$i]};uci commit wireless 
    done
    wifi>/dev/null 2>&1 
    }
     
    function outputinfo {
    for i in `seq 0 $numbint`
    do
    echo "===========wlan"$i"==========="
    echo "New mac address: " ${arrmac[$i]}
    echo ""===========================""
    done
    }
     
     
    arrint=($(iwconfig | grep -o "\w*wlan\w*")) # Read number of wifi interfaces to array
    numbintf=${#arrint[@]}
    numbint=$((${#arrint[@]}-1)) #creates variable for array position from items in array -1
    arrmac=() # define mac address array
    clear
     
    if [ "$1" = "-r" ]; then
    # clear
    if [ -f $FILE ];then
    echo "Found "${#arrint[@]}" WiFi Devices"
    echo ""
    echo "Changing mac"
    for i in `seq 0 $numbint`
    do
    arrmac+=($(randmac)) 
    done
    changeset 
    outputinfo
    else
    #usemc
    echo "Please run 'changemac -d' to downlaod the required dependencies"
    fi
     
     
    elif [ "$1" = "-m" ]; then
     
    args=("$@")
    for i in `seq 1 $#`
    do
      arrmac+=(${args[$i]})
    done
    changeset
    outputinfo
     
    elif [ "$1" = "-c" ]; then
    echo "Reseting mac addresses to default"
    for i in `seq 0 $numbint`
    do
    arrmac+=("") 
    done
    changeset
    echo "all mac addresses reset to default" 
     
     
    elif [ "$1" = "-reset" ]; then
    wifi detect > /etc/config/wireless && reboot
     
    elif [ "$1" = "-u" ]; then
    wget -P /tmp/ http://trtsgc.com/changemac/install.sh
    chmod +x /tmp/install.sh
    sh /tmp/install.sh
     
    elif [ "$1" = "-d" ]; then
    opkg update
    opkg install bc
    mkdir /usr/share/changemac
    wget -P /usr/share/changemac/ http://trtsgc.com/changemac/maclist.lst
    else
    echo ""
    echo "WiFi Pineapple MK5 mac address changer."
    echo ""
    echo "Usage: changemac [options]"
    echo "" 
    echo "changemac -r Set random mac addresses"
    echo "changemac -c Set mac addresses back to default"
    echo "changemac -m [wlan0 mac] [wlan1 mac]  Set specific mac addresses"
    echo "changemac -reset Reset wireless config to default"
    echo "changemac -d Install changemac dependencies*"
    echo "changemac -u Update changemac*"
    echo " *Needs internet access"
    echo ""
    fi
    
    

    You can still install with

    wget -P /tmp/ http://trtsgc.com/changemac/install.sh; chmod +x install.sh; sh /tmp/install.sh
    

    or if you already have the script installed you can update using

    changemac -u
    

    btw if anyone still wants to download the previous version its available from @ http://trtsgc.com/ch...hangemac-old-v1

  2. Progress? it works fine for me... always has...

    Create two adapters in the vm. assign one bridged to your internet (in my case wifi) and the other bridged to your ethernet (in my case thunderbolt).

    then you should have internet on your vm (in my case kali) from your eth0 interface (wifi). at this point you can run the wp5.sh script and just enter the questions asked and you should be good!

    let me know if you have any issues and I will create a tutorial with screen shots

  3. Looks right except

    uci set wireless.@wifi-iface[1].macaddr=$wlan2_MAC;uci commit wireless

    Should be

    uci set wireless.@wifi-iface[2].macaddr=$wlan2_MAC;uci commit wireless

    And you will need to reset the /etc/conf/wireless when you plug in your wlan2 so it includes that in the config other than that it should work.

    I'll try to update thr script to search for a wlan2 and change that Mac only if it finds one. It will probably take me a day or two to get around to it though

  4. Hi, ive noticed a few people talk about wireless degradation since the update, and I've found the same.

    I was using the Mk5 without any problems, updated some of the infusions and generally surfing through the mk5 without problems.

    Then i spotted the upgrade, and upgraded.

    Then i went to set everything up and noticed really bad wireless connection from the mk5 to my access point.

    I tried to connect directly to the access point with no problem.

    As soon as i tried to download anything, or at random times i would loose ping to the internet from the pineapple and to the access point ip.

    You can see below, massive chunks of missing pings.

    So just to check i reset the pineapple and did a fresh install with the same experience.

    Then i put the backup of the card i got with 1.0.0 back in, and all was well again.

    No complaints, just thought I would share my

    No matter what, still love it.

    Same issue here. I noticed it because when Internet sharing from wlan0 to wlan1 my client machine was timing out trying to load google. Same result when I did a Ping test. It does not seem to happen to me on every boot however but most.
×
×
  • Create New...