This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |