Skip to content
This repository was archived by the owner on Aug 24, 2023. It is now read-only.

Commit 0de52de

Browse files
author
root
committed
Updated Replace Downloads
1 parent da67795 commit 0de52de

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+2743
-0
lines changed

1 mac_changer/getmac.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/usr/bin/python2
2+
3+
import subprocess
4+
import re
5+
6+
ifconf = subprocess.check_output(["ifconfig","enp2s0"])
7+
print ifconf
8+
9+
mac = re.search(r"\w\w:\w\w:\w\w:\w\w:\w\w:\w\w",ifconf)
10+
11+
print mac.group(0)

1 mac_changer/macchanger-1.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/python2
2+
3+
import subprocess
4+
5+
subprocess.call("ifconfig enp2s0 down",shell=True)
6+
subprocess.call("ifconfig enp2s0 hw ether 00:11:22:33:44:55",shell=True)
7+
subprocess.call("ifconfig enp2s0 up",shell=True)

1 mac_changer/macchanger-2.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/usr/bin/python2
2+
'''
3+
Storing the interface and mac addr to a variable and
4+
then pass the value to the command directly
5+
'''
6+
7+
import subprocess
8+
9+
interface = "enp2s0"
10+
macaddr = "00:11:22:33:44:55"
11+
12+
print "[+] Changing Mac Address of Interface %s to %s"%(interface,macaddr)
13+
14+
15+
subprocess.call("ifconfig %s down"%interface,shell=True)
16+
subprocess.call("ifconfig %s hw ether %s"%(interface,macaddr),shell=True)
17+
subprocess.call("ifconfig %s up"%interface,shell=True)

1 mac_changer/macchanger-3.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/usr/bin/python2
2+
'''
3+
Getting the value for the interface and mac addr to a variable and
4+
then pass the value to the command directly
5+
'''
6+
7+
import subprocess
8+
9+
interface = raw_input("Interface> ")
10+
macaddr = raw_input("MacAddr> ")
11+
12+
print "[+] Changing Mac Address of Interface %s to %s"%(interface,macaddr)
13+
14+
15+
subprocess.call("ifconfig %s down"%interface,shell=True)
16+
subprocess.call("ifconfig %s hw ether %s"%(interface,macaddr),shell=True)
17+
subprocess.call("ifconfig %s up"%interface,shell=True)

1 mac_changer/macchanger-4.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/usr/bin/python2
2+
'''
3+
Getting the value for the interface and mac addr to a variable and
4+
then pass the value to the command directly
5+
secure code
6+
handling user input if the user put ; or && to execute another command
7+
it will stop by removin the shell=True single string commmand
8+
rather we remove the shell=True and exec the computer and get command
9+
in a list variable one by one which will avoid this user-input manipulation
10+
'''
11+
12+
import subprocess
13+
14+
interface = raw_input("Interface> ")
15+
macaddr = raw_input("MacAddr> ")
16+
17+
print "[+] Changing Mac Address of Interface %s to %s"%(interface,macaddr)
18+
19+
20+
subprocess.call(["ifconfig",interface,"down"])
21+
subprocess.call(["ifconfig",interface,"hw","ether",macaddr])
22+
subprocess.call(["ifconfig",interface,"up"])

1 mac_changer/macchanger-5.py

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#!/usr/bin/python2
2+
'''
3+
Getting the value for the interface and mac addr to a variable and
4+
then pass the value to the command directly
5+
secure code
6+
handling user input if the user put ; or && to execute another command
7+
it will stop by removin the shell=True single string commmand
8+
rather we remove the shell=True and exec the computer and get command
9+
in a list variable one by one which will avoid this user-input manipulation
10+
'''
11+
'''
12+
we can give value in as a argument in a command line using sys modules
13+
or with an option with help and switch we use optparse module
14+
python macchanger.py --interface wlan0 --mac 11:aa:dd:ff:gg:hh
15+
python macchanger.py --help to print help'''
16+
17+
import subprocess
18+
import optparse
19+
20+
parser=optparse.OptionParser() #init the parser object
21+
parser.add_option("-i","--interface",dest="interface",help="Interface to change the mac address")
22+
#adding the options like -i or --interface switches, dest this where the passed values get saved and help display the help msg python macchanger.py --help
23+
24+
parser.add_option("-m","--mac",dest="new_mac",help="add new mac address")
25+
26+
(options,arguments)=parser.parse_args()
27+
#the funtion returns a value to this 2 varible options and arguments
28+
#options is nobut the wlan0 and aa:bb:cc:dd:ee:ff
29+
#arguments is nothingbut --interface and --mac or -i and -m
30+
31+
interface = options.interface
32+
macaddr = options.new_mac
33+
34+
#options contains the value to get the value we call options.interface and options.new_mac
35+
36+
subprocess.call(["ifconfig",interface,"down"])
37+
subprocess.call(["ifconfig",interface,"hw","ether",macaddr])
38+
subprocess.call(["ifconfig",interface,"up"])
39+
40+
print "[+] Changing Mac Address of Interface %s to %s"%(interface,macaddr)

1 mac_changer/macchanger-6.py

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#!/usr/bin/python2
2+
'''
3+
Getting the value for the interface and mac addr to a variable and
4+
then pass the value to the command directly
5+
secure code
6+
handling user input if the user put ; or && to execute another command
7+
it will stop by removing the shell=True single string commmand
8+
rather we remove the shell=True and exec the computer and get command
9+
in a list variable one by one which will avoid this user-input manipulation
10+
11+
we can give value in as a argument in a command line using sys modules
12+
or with an option with help and switch we use optparse module
13+
python macchanger.py --interface wlan0 --mac 11:aa:dd:ff:gg:hh
14+
python macchanger.py --help to print help
15+
#init the parser object
16+
#adding the options like -i or --interface switches, dest this where the passed values get saved and help display the help msg python macchanger.py --help
17+
#the funtion returns a value to this 2 varible options and arguments
18+
#options is nobut the wlan0 and aa:bb:cc:dd:ee:ff
19+
#arguments is nothingbut --interface and --mac or -i and -m
20+
#options contains the value to get the value we call options.interface and options.new_mac
21+
'''
22+
23+
import subprocess
24+
import optparse
25+
26+
27+
def macchanger(interface,macaddr):
28+
29+
subprocess.call(["ifconfig",interface,"down"])
30+
subprocess.call(["ifconfig",interface,"hw","ether",macaddr])
31+
subprocess.call(["ifconfig",interface,"up"])
32+
33+
print "[+] Changing Mac Address of Interface %s to %s"%(interface,macaddr)
34+
35+
parser=optparse.OptionParser()
36+
parser.add_option("-i","--interface",dest="interface",help="Interface to change the mac address")
37+
parser.add_option("-m","--mac",dest="new_mac",help="add new mac address")
38+
(options,arguments)=parser.parse_args()
39+
40+
macchanger(options.interface,options.new_mac)
41+

1 mac_changer/macchanger-7.py

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#!/usr/bin/python2
2+
'''
3+
Getting the value for the interface and mac addr to a variable and
4+
then pass the value to the command directly
5+
secure code
6+
handling user input if the user put ; or && to execute another command
7+
it will stop by removing the shell=True single string commmand
8+
rather we remove the shell=True and exec the computer and get command
9+
in a list variable one by one which will avoid this user-input manipulation
10+
11+
we can give value in as a argument in a command line using sys modules
12+
or with an option with help and switch we use optparse module
13+
python macchanger.py --interface wlan0 --mac 11:aa:dd:ff:gg:hh
14+
python macchanger.py --help to print help
15+
#init the parser object
16+
#adding the options like -i or --interface switches, dest this where the passed values get saved and help display the help msg python macchanger.py --help
17+
#the funtion returns a value to this 2 varible options and arguments
18+
#options is nobut the wlan0 and aa:bb:cc:dd:ee:ff
19+
#arguments is nothingbut --interface and --mac or -i and -m
20+
#options contains the value to get the value we call options.interface and options.new_mac
21+
'''
22+
23+
import subprocess
24+
import optparse
25+
26+
27+
def macchanger(interface,macaddr):
28+
29+
subprocess.call(["ifconfig",interface,"down"])
30+
subprocess.call(["ifconfig",interface,"hw","ether",macaddr])
31+
subprocess.call(["ifconfig",interface,"up"])
32+
33+
print "[+] Changing Mac Address of Interface %s to %s"%(interface,macaddr)
34+
35+
def get_argument():
36+
parser=optparse.OptionParser()
37+
parser.add_option("-i","--interface",dest="interface",help="Interface to change the mac address")
38+
parser.add_option("-m","--mac",dest="new_mac",help="add new mac address")
39+
return parser.parse_args()
40+
41+
(options,arguments) = get_argument()
42+
macchanger(options.interface,options.new_mac)
43+

1 mac_changer/macchanger-8.py

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#!/usr/bin/python2
2+
'''
3+
Getting the value for the interface and mac addr to a variable and
4+
then pass the value to the command directly
5+
secure code
6+
handling user input if the user put ; or && to execute another command
7+
it will stop by removing the shell=True single string commmand
8+
rather we remove the shell=True and exec the computer and get command
9+
in a list variable one by one which will avoid this user-input manipulation
10+
11+
we can give value in as a argument in a command line using sys modules
12+
or with an option with help and switch we use optparse module
13+
python macchanger.py --interface wlan0 --mac 11:aa:dd:ff:gg:hh
14+
python macchanger.py --help to print help
15+
#init the parser object
16+
#adding the options like -i or --interface switches, dest this where the passed values get saved and help display the help msg python macchanger.py --help
17+
#the funtion returns a value to this 2 varible options and arguments
18+
#options is nobut the wlan0 and aa:bb:cc:dd:ee:ff
19+
#arguments is nothingbut --interface and --mac or -i and -m
20+
#options contains the value to get the value we call options.interface and options.new_mac
21+
'''
22+
23+
import subprocess
24+
import optparse
25+
26+
27+
def macchanger(interface,macaddr):
28+
29+
subprocess.call(["ifconfig",interface,"down"])
30+
subprocess.call(["ifconfig",interface,"hw","ether",macaddr])
31+
subprocess.call(["ifconfig",interface,"up"])
32+
33+
print "[+] Changing Mac Address of Interface %s to %s"%(interface,macaddr)
34+
35+
def get_argument():
36+
parser=optparse.OptionParser()
37+
parser.add_option("-i","--interface",dest="interface",help="Interface to change the mac address")
38+
parser.add_option("-m","--mac",dest="new_mac",help="add new mac address")
39+
(options,arguments) = parser.parse_args()
40+
if not options.interface:
41+
parser.error("[-] Specify an Interface use python macchanger --help for more details")
42+
elif not options.new_mac:
43+
parser.error("[-] Specify an MacAddr use python macchanger --help for more details")
44+
return options
45+
46+
options= get_argument()
47+
macchanger(options.interface,options.new_mac)
48+

1 mac_changer/macchanger-9.py

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
#!/usr/bin/python2
2+
'''
3+
Getting the value for the interface and mac addr to a variable and
4+
then pass the value to the command directly
5+
secure code
6+
handling user input if the user put ; or && to execute another command
7+
it will stop by removing the shell=True single string commmand
8+
rather we remove the shell=True and exec the computer and get command
9+
in a list variable one by one which will avoid this user-input manipulation
10+
11+
we can give value in as a argument in a command line using sys modules
12+
or with an option with help and switch we use optparse module
13+
python macchanger.py --interface wlan0 --mac 11:aa:dd:ff:gg:hh
14+
python macchanger.py --help to print help
15+
#init the parser object
16+
#adding the options like -i or --interface switches, dest this where the passed values get saved and help display the help msg python macchanger.py --help
17+
#the funtion returns a value to this 2 varible options and arguments
18+
#options is nobut the wlan0 and aa:bb:cc:dd:ee:ff
19+
#arguments is nothingbut --interface and --mac or -i and -m
20+
#options contains the value to get the value we call options.interface and options.new_mac
21+
'''
22+
23+
import subprocess
24+
import optparse
25+
import re
26+
27+
28+
def macchanger(interface,macaddr):
29+
30+
subprocess.call(["ifconfig",interface,"down"])
31+
subprocess.call(["ifconfig",interface,"hw","ether",macaddr])
32+
subprocess.call(["ifconfig",interface,"up"])
33+
34+
print "[+] Changing Mac Address of Interface %s to %s"%(interface,macaddr)
35+
36+
def get_argument():
37+
38+
parser=optparse.OptionParser()
39+
parser.add_option("-i","--interface",dest="interface",help="Interface to change the mac address")
40+
parser.add_option("-m","--mac",dest="new_mac",help="add new mac address")
41+
(options,arguments) = parser.parse_args()
42+
43+
if not options.interface:
44+
parser.error("[-] Specify an Interface use python macchanger --help for more details")
45+
elif not options.new_mac:
46+
parser.error("[-] Specify an MacAddr use python macchanger --help for more details")
47+
48+
return options
49+
50+
def getmac(interface):
51+
52+
ifconfig_result = subprocess.check_output(["ifconfig",interface])
53+
current_mac = re.search(r"\w\w:\w\w:\w\w:\w\w:\w\w:\w\w",ifconfig_result)
54+
55+
if current_mac:
56+
return current_mac.group(0)
57+
else:
58+
return None
59+
60+
options= get_argument()
61+
macchanger(options.interface,options.new_mac)
62+
final_mac = getmac(options.interface)
63+
64+
if final_mac == options.new_mac :
65+
print "Mac Address Successfully Chaged with new one %r"%final_mac
66+
else:
67+
print "Error Occured Fix It"

0 commit comments

Comments
 (0)