Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(9)  |  Call(8)  |  Derive(0)  |  Import(1)
Generate the fake hardware address

        def get_fake_hwaddr():
    """
      Generate the fake hardware address
    """
    hwaddr = [ 0x00,
	     random.randint(0x00, 0xff),
	     random.randint(0x00, 0xff),
	     random.randint(0x00, 0xff),
	     random.randint(0x00, 0xff),
	     random.randint(0x00, 0xff) ]
    return ':'.join(map(lambda x: "%02x" % x, hwaddr))
        


src/e/t/etherwall-HEAD/ObtainGwHwAddr.py   etherwall(Download)
import threading
from scapy.all import *
from NetMod import get_fake_hwaddr
 
hw_list1 = [] # list of a hardware reply 
		# randomized to prevent your mac address is detected by a malicious host
		if (random.randint(0,1) == 1):
			sendp(Ether(src=get_fake_hwaddr(),dst="ff:ff:ff:ff:ff:ff")/ARP(psrc=self.psrc,hwsrc=get_fake_hwaddr(),pdst=self.pdst,hwdst="00:00:00:00:00:00"))
			sendp(Ether(dst="ff:ff:ff:ff:ff:ff")/ARP(psrc=self.psrc,pdst=self.pdst,hwdst="00:00:00:00:00:00")) 
			sendp(Ether(src=get_fake_hwaddr(),dst="ff:ff:ff:ff:ff:ff")/ARP(psrc=self.psrc,hwsrc=get_fake_hwaddr(),pdst=self.pdst,hwdst="00:00:00:00:00:00"))