Guest User

Untitled

a guest
Sep 25th, 2016
309
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. #packet sniffer using scapy by prometheus
  2. from scapy.all import *
  3.  
  4.  
  5. def sniffPackets(packet):
  6. if packet.haslayer(IP):
  7. pckt_src=packet[IP].src
  8. pckt_dst=packet[IP].dst
  9. pckt_ttl=packet[IP].ttl
  10. print "Packet: %s is going to %s and has ttl value %s" % (pckt_src,pckt_dst,pckt_ttl)
  11.  
  12.  
  13.  
  14.  
  15. def main():
  16. print "custom packet sniffer"
  17. sniff(filter="ip",iface="wlan0",prn=sniffPackets)
  18. if __name__ == '__main__':
  19. main()
Add Comment
Please, Sign In to add comment