Forum Replies Created
- AuthorPosts
- BornrichParticipant
Yes, I did. I am stuck I have no idea what else to do.
BornrichParticipantThank you. I got it to work.
BornrichParticipant`There should be a new tutorial for python 3 because it’s really head scratching trying to figure out things ourselves online. I ran this code exactly as it was taught in the tutoring but it’s giving me error.the error is at the bottom.
#!/usr/bin/env python
import subprocess
import optparsedef get_argument():
parser=optparse.OptionParser()
parser.add_option(“-i”, “–interface”, dest=”interface”, help=”interface to change its Mac address”)
parser.add_option(“-m”, “–mac”, dest=”new mac”, help=”New Mac address” )
return parser.parse_args()def change_mac():
print(“[+] Changing Mac address for” + interface + “to” + new_mac)
subprocess.call([“ifconfig”, interface, “down”])
subprocess.call([“ifconfig”, interface, “hw” “ether”, new_mac])
subprocess.call([“ifconfig”, interface, “up”])(options, arguments) = get_argument()
change_mac(options.interface, options.new_mac)Traceback (most recent call last):
File “main.py”, line 20, in <module>
change_mac(options.interface, options.new_mac)
AttributeError: Values instance has no attribute ‘new_mac’ - AuthorPosts