Last active
          March 26, 2020 17:25 
        
      - 
      
 - 
        
Save dustyfresh/f75940029d5b60214dd0aa8507d6ecab to your computer and use it in GitHub Desktop.  
    Sniff packets for secrets with python scapy
  
        
  
    
      This file contains hidden or 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
    
  
  
    
  | #!/usr/bin/env python3 | |
| from scapy.all import * | |
| import logging | |
| logging.getLogger("scapy.runtime").setLevel(logging.ERROR) | |
| import re | |
| def packet_callback(packet): | |
| if packet[TCP].payload: | |
| pkt = str(packet[TCP].payload) | |
| if packet[IP].dport == 80: | |
| print("\n{} ----HTTP----> {}:{}:\n{}".format(packet[IP].src, packet[IP].dst, packet[IP].dport, str(bytes(packet[TCP].payload)))) | |
| sniff(filter="tcp", prn=packet_callback, store=0) | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
            
Thank you so much for this tool! It is so useful