Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #packet sniffer using scapy by prometheus
- from scapy.all import *
- def sniffPackets(packet):
- if packet.haslayer(IP):
- pckt_src=packet[IP].src
- pckt_dst=packet[IP].dst
- pckt_ttl=packet[IP].ttl
- print "Packet: %s is going to %s and has ttl value %s" % (pckt_src,pckt_dst,pckt_ttl)
- def main():
- print "custom packet sniffer"
- sniff(filter="ip",iface="wlan0",prn=sniffPackets)
- if __name__ == '__main__':
- main()
Add Comment
Please, Sign In to add comment