Results 1 to 4 of 4

Thread: Trouble with bash shell and macchanger

  1. #1
    Just burned their ISO
    Join Date
    Feb 2013
    Posts
    4

    Default Trouble with bash shell and macchanger

    Hello,
    I am trying to write my own script that will pass user input to the macchanger program(I tire of typing ifconfig <interface> up and down over and over).

    So I want to call a script that will close and open the interface for me, but accept user input for a specific mac address and pass it through to the macchanger program.
    This is what I have attempted so far.

    #1
    Code:
    #!/bin/bash
    ifconfig wlan0 down
    read -p "Enter Mac Address: " MACaddress
    macchanger -m $MACaddress
    ifconfig wlan0 up
    #2
    Code:
    #!/bin/bash
    ifconfig wlan0 down
    echo "Enter Mac Address:
    read MACaddress
    macchanger -m $MACaddress
    ifconfig wlan0 up
    #3
    Code:
    #!/bin/bash
    ifconfig wlan0 down
    echo "Enter Mac Address:
    read MACaddress
    macchanger --mac=$MACaddress
    ifconfig wlan0 up
    I get this as a response for everything.
    Code:
    GNU MAC Changer
    Usage: macchanger [options] device
    
    Try `macchanger --help' for more options.
    So there is obviously something I am missing. Either if the shell is just plain wrong, or maybe it has to due with the type of data that is being passed?

    Could someone point me to a good resource that will help me figure this out?

    Thank-you
    anova

  2. #2
    Good friend of the forums zimmaro's Avatar
    Join Date
    Mar 2010
    Location
    milano
    Posts
    407

    Default Re: Trouble with bash shell and macchanger

    hi
    i'm not expert :

    #!/bin/bash
    ifconfig wlan0 down
    echo -n "Enter mac-address ? "
    read mac
    macchanger -m $mac wlan0
    sleep 2
    clear
    echo -e "REMEMBER..your new mac-address is $mac"
    ifconfig wlan0 up
    ifconfig wlan0

    play with it a bit and change it to your liking
    bye

  3. #3
    Very good friend of the forum maverik35's Avatar
    Join Date
    Sep 2009
    Location
    Debian land
    Posts
    734

    Default Re: Trouble with bash shell and macchanger

    Quote Originally Posted by anova View Post
    Hello,
    I am trying to write my own script that will pass user input to the macchanger program(I tire of typing ifconfig <interface> up and down over and over).

    So I want to call a script that will close and open the interface for me, but accept user input for a specific mac address and pass it through to the macchanger program.
    This is what I have attempted so far.

    #1
    Code:
    #!/bin/bash
    ifconfig wlan0 down
    read -p "Enter Mac Address: " MACaddress
    macchanger -m $MACaddress
    ifconfig wlan0 up
    #2
    Code:
    #!/bin/bash
    ifconfig wlan0 down
    echo "Enter Mac Address:
    read MACaddress
    macchanger -m $MACaddress
    ifconfig wlan0 up
    #3
    Code:
    #!/bin/bash
    ifconfig wlan0 down
    echo "Enter Mac Address:
    read MACaddress
    macchanger --mac=$MACaddress
    ifconfig wlan0 up
    I get this as a response for everything.
    Code:
    GNU MAC Changer
    Usage: macchanger [options] device
    
    Try `macchanger --help' for more options.
    So there is obviously something I am missing. Either if the shell is just plain wrong, or maybe it has to due with the type of data that is being passed?

    Could someone point me to a good resource that will help me figure this out?

    Thank-you
    anova

    With zimmaro's permission, brother, the sintaxis to macchanger is : macchanger "options" "your iface"..I think you are missing the iface to which you want to assign the new mac to.
    Options: --mac ---- xx:xx:xx:xx:xx:xx
    --show ---- Print the current mac.
    --ending ---- Don't change the vendor bytes.

    Please refer to "man macchanger".

    Any way, zimmaro posted it the way it should be...

    Something else, after changing mac address, I would place a 2 sec sleep, just like zimmaro propose it. It takes a little bit of time when changing mac...

    Good work Anova.

    Zimmaro, excellent as always.

    Luck.
    Last edited by maverik35; 02-12-2013 at 06:37 PM.

  4. #4
    Just burned their ISO
    Join Date
    Feb 2013
    Posts
    4

    Default Re: Trouble with bash shell and macchanger

    Well - I now feel like an idiot. I got so caught up with assuming I was using the wrong commands that I didn't even see that I forgot to implement an interface.

    Lesson Learned.


    Thank you - works perfectly.

    anova

Similar Threads

  1. Replies: 1
    Last Post: 03-06-2012, 01:42 PM
  2. using proxy while updating in bash shell
    By imported_hackjkp in forum OLD BackTrack 4 Software Related Issues
    Replies: 5
    Last Post: 09-25-2009, 05:42 PM
  3. -=Xploitz=- O|T Tutorial: "E-Z Personalizing Bash Shell Colors"
    By -=Xploitz=- in forum OLD Tutorials and Guides
    Replies: 31
    Last Post: 06-07-2009, 02:13 AM
  4. Trouble with macchanger
    By RainMan0x in forum OLD Newbie Area
    Replies: 0
    Last Post: 10-20-2008, 11:42 PM
  5. Power Shell Usage - Bash Tips & Tricks
    By .lonewolf in forum OLD Tutorials and Guides
    Replies: 0
    Last Post: 04-16-2008, 02:53 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •