- May 9, 2020 at 7:20 pm #36348Jay2thaworldParticipant
I was following along with writing variables, when I updated the new mac address variable and ran the script to assign, I can see that the print displayed the correct new mac address, but it did not update.
I ran the process manually in terminator and got a message stating “Cannot assign requested address”.
I’ve tried a few different strings with no results. Any idea why this is happening?
After the first initial change it will not let me change it again…May 9, 2020 at 8:10 pm #36353Jay2thaworldParticipant
This is the message that displays:
interface > eth0
new_mac > 00:11:22:33:44:55
[+] Changing MAC Address for eth0 to 00:11:22:33:44:55
ifconfig [-a] [-v] [-s] <interface> [[<AF>] <address>]
[[-]broadcast [<address>]] [[-]pointopoint [<address>]]
[netmask <address>] [dstaddr <address>] [tunnel <address>]
[outfill <NN>] [keepalive <NN>]
[hw <HW> <address>] [mtu <NN>]
[[-]trailers] [[-]arp] [[-]allmulti]
[mem_start <NN>] [io_addr <NN>] [irq <NN>] [media <type>]
List of possible hardware types:
loop (Local Loopback) slip (Serial Line IP) cslip (VJ Serial Line IP)
slip6 (6-bit Serial Line IP) cslip6 (VJ 6-bit Serial Line IP) adaptive (Adaptive Serial Line IP)
ash (Ash) ether (Ethernet) ax25 (AMPR AX.25)
netrom (AMPR NET/ROM) rose (AMPR ROSE) tunnel (IPIP Tunnel)
ppp (Point-to-Point Protocol) hdlc ((Cisco)-HDLC) lapb (LAPB)
arcnet (ARCnet) dlci (Frame Relay DLCI) frad (Frame Relay Access Device)
sit (IPv6-in-IPv4) fddi (Fiber Distributed Data Interface) hippi (HIPPI)
irda (IrLAP) ec (Econet) x25 (generic X.25)
eui64 (Generic EUI-64)
<AF>=Address family. Default: inet
List of possible address families:
unix (UNIX Domain) inet (DARPA Internet) inet6 (IPv6)
ax25 (AMPR AX.25) netrom (AMPR NET/ROM) rose (AMPR ROSE)
ipx (Novell IPX) ddp (Appletalk DDP) ec (Econet)
ash (Ash) x25 (CCITT X.25)May 10, 2020 at 6:29 am #36392
This looks like a syntax error.
Can you share your code please?
DiegoJune 4, 2020 at 1:07 pm #39024BornrichParticipant
`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.
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” )
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()
Traceback (most recent call last):
File “main.py”, line 20, in <module>
AttributeError: Values instance has no attribute ‘new_mac’June 5, 2020 at 5:22 am #39095
You are missing a comma between “hw” and “ether”.
Change it and let me know how it goes!
DiegoJune 5, 2020 at 11:18 am #39120BornrichParticipant
Thank you. I got it to work.June 6, 2020 at 4:27 am #39173
Cool you got it!
- You must be logged in to reply to this topic.