[TIP] Generating 1024 Macs/vlan(urgent help)
mla at lausch.at
Mon Mar 22 01:17:10 PDT 2010
The python program itself contains at least one error:
str(r) does not do hex conversion.
>>> print str(10)
but it should be '0A'
the % formatting takes care of this
destmac = '00:0D:03:00:00:01'
for lastbyte in range(0, 80):
srcmac = "00:20:11:11:22:%02X" % lastbyte
frame = scapy.Ether(dst=destmac,src=srcmac)/scapy.IP(dst="220.127.116.11",src="18.104.22.168")
this works (verifyed with wireshark)
On Mon, 2010-03-22 at 09:21 +0530, Jishnu Banerjee (jbanerje) wrote:
> Hi Folks,
> I am new to this forum and a novice in Python/Scapy.
> Can anybody help me out with a script which will generate 1024 MACs/vlan
> spanning over 32 vlans.
> I have done this:
> scmac = '00:20:11:11:22:'
> lastbyte = 1
> eth = sys.argv
> destmac = '00:0D:03:00:00:01'
> while (r<80):
> print 'r='
> print r
> srcmac = scmac + str(r)
> print srcmac
> p =
> r= r+1
> It seems to me that my above script is not generating Unique MACs, I am
> yet to capture those packets.
> Any help is sppreciated.
> testing-in-python mailing list
> testing-in-python at lists.idyll.org
More information about the testing-in-python