[Python] python/scapy RandMAC() issue

Discussão em 'Python' iniciado por Stack, Novembro 27, 2024.

  1. Stack

    Stack Membro Participativo

    I have a really annoying problem that I tried to solve for a few days. I can't find any information on the net.

    I tried to solve it myself, consulted with the documentations. But nothing works.

    My problem is

    When I assign a variable X with RandMAC() function, X should be the same every time I use it.

    Like, X = RandMAC(), and let say X is now AA:BB:CC:DD:EE:FF and when I print X for 3 times, it should be something like this.

    X = AA:BB:CC:DD:EE:FF
    X = AA:BB:CC:DD:EE:FF
    X = AA:BB:CC:DD:EE:FF


    But what the code actually does is

    X = AA:BB:CC:DD:EE:FF
    X = 00:0A:0B:0C:0D:0E:0F
    X = 11:22:33:44:55:66


    So it changed every time I call print X.

    How can I solve this issue ?

    My code is as follow.

    from scapy.all import *

    X = RandMAC()

    print X
    print X
    print X


    Thank you all in advance.

    Continue reading...

Compartilhe esta Página