Skip to content

Instantly share code, notes, and snippets.

View ujj-nuvo's full-sized avatar

Ujjwal ujj-nuvo

  • Pepper Tap
  • Gurgaon
View GitHub Profile
import pcapy
from impacket.ImpactDecoder import *
from impacket.ImpactPacket import *
# callback for received packets
def recv_pkts(hdr, data):
packet = EthDecoder().decode(data)
ip_hdr = packet.child()
op_code = ip_hdr.get_ar_op()
src_mac = ip_hdr.as_hrd(ip_hdr.get_ar_sha())
import pcapy
from impacket.ImpactDecoder import *
from impacket.ImpactPacket import *
# callback for received packets
def recv_pkts(hdr, data):
packet = EthDecoder().decode(data)
ip_hdr = packet.child()
op_code = ip_hdr.get_ar_op()
src_mac = ip_hdr.as_hrd(ip_hdr.get_ar_sha())
def recv_pkts(hdr, data):
packet = EthDecoder().decode(data)
ip_hdr = packet.child()
op_code = ip_hdr.get_ar_op()
src_mac = ip_hdr.as_hrd(ip_hdr.get_ar_sha())
dest_ip = ip_hdr.as_pro(ip_hdr.get_ar_spa())
print "ARP Request from Device : " + str(src_mac)
if __name__ == "__main__":
max_bytes = 1024 # number of bytes to capture per packet
import pcapy
from impacket.ImpactDecoder import *
from impacket.ImpactPacket import *
def get_interface():
devs = pcapy.findalldevs()
i=0
for eth in devs:
print " %d - %s" %(i,devs[i])
i+=1