Skip to content

Instantly share code, notes, and snippets.

@floatingstatic
Created January 12, 2018 20:44
Show Gist options
  • Select an option

  • Save floatingstatic/fba432aa21d99d310cb677854253e014 to your computer and use it in GitHub Desktop.

Select an option

Save floatingstatic/fba432aa21d99d310cb677854253e014 to your computer and use it in GitHub Desktop.
Scapy IGMP Scripts
#!/usr/bin/env python
from scapy.all import *
from scapy.contrib.igmp import IGMP
eth = Ether()
iph = IP(src='1.1.1.1', dst='224.0.0.1', proto=2)
igmp = IGMP(type=0x11, gaddr='0.0.0.0', mrtime=10)
igmp.igmpize(iph,eth)
sendp(eth/iph/igmp, iface="vlan0")
print "IGMP General Query Packet Sent"
#!/usr/bin/env python
import sys
from scapy.all import *
from scapy.contrib.igmp import IGMP
try:
group_addr = sys.argv[1]
except:
print "ERROR: No multicast address passed to this script"
sys.exit()
eth = Ether(src="00:11:22:33:44:55")
iph = IP(src='1.1.1.1', dst=group_addr, proto=2)
igmp = IGMP(type=0x11, gaddr=group_addr, mrtime=1)
igmp.igmpize(iph,eth)
sendp(eth/iph/igmp, iface="vlan0")
print "Rest in peace %s!!!" % group_addr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment