diff --git a/README.md b/README.md index 54b393f..767f072 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,12 @@ ### Supports Platform: Linux, Debain ### How to use: -- Convert the file into executable. +- Convert the setup.sh into executable + > **chmod 755 setup.sh** +- Run setup.sh + > **./setup.sh** + +- Convert the mac_changer into executable. > **chmod u+x mac_changer** - Run the Executable. > **./mac_changer** diff --git a/mac_changer b/mac_changer index cf80b5d..9b223c5 100755 Binary files a/mac_changer and b/mac_changer differ diff --git a/setup.sh b/setup.sh new file mode 100644 index 0000000..8e5e8ff --- /dev/null +++ b/setup.sh @@ -0,0 +1 @@ +sudo apt install net-tools -y diff --git a/source_code/mac_changer.py b/source_code/mac_changer.py index 8a73d17..e919038 100644 --- a/source_code/mac_changer.py +++ b/source_code/mac_changer.py @@ -9,17 +9,17 @@ def mac_change(interface, mac): print(colored("[+] Changing interface (" + interface + ") to down state", 'yellow')) - subprocess.call(["ifconfig", interface, "down"]) + subprocess.call(["sudo","ifconfig", interface, "down"]) print(colored("[+] Changing MAC Address for " + interface + " to " + colored(mac, 'white'), 'yellow')) - subprocess.call(["ifconfig", interface, "hw", "ether", mac]) + subprocess.call(["sudo","ifconfig", interface, "hw", "ether", mac]) print(colored("[+] Changing interface (" + interface + ") to up state\n", 'yellow')) - subprocess.call(["ifconfig", interface, "up"]) + subprocess.call(["sudo","ifconfig", interface, "up"]) def get_current_mac(interface): - result = subprocess.check_output(["ifconfig", interface]) + result = subprocess.check_output(["sudo","ifconfig", interface]) mac_add = re.search("\w\w:\w\w:\w\w:\w\w:\w\w:\w\w", str(result)) if mac_add: @@ -61,7 +61,7 @@ def get_cmd_line_arguments(): parser = argparse.ArgumentParser(prog="MAC Changer", usage="%(prog)s [options]\n\t[-i | --interface] interface_name\n\t[-m | --mac] mac_address", formatter_class=argparse.RawDescriptionHelpFormatter, - description=""">>> | MAC Changer v1.0 by Hack Hunt | <<< + description=""">>> | MAC Changer v1.1 by Hack Hunt | <<< ---------------------------------""", epilog="*** If -m or --mac is not specified MAC will be generated randomly") @@ -88,7 +88,7 @@ def main(): mac = args.mac try: - subprocess.check_call(['ifconfig', interface], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) + subprocess.check_call(['sudo','ifconfig', interface], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) except subprocess.CalledProcessError: print(colored("\n[-] Error! Interface (" + interface + ") not found!\n", 'red')) sys.exit() @@ -106,7 +106,7 @@ def main(): else: print(colored("\n[-] Please enter a valid MAC Address\n", 'red')) else: - print(original_mac) + print(colored("\n[-] MAC Address not found for the Interface (" + interface + ").\n", 'red')) -main() \ No newline at end of file +main()