Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

scapy get packet source ip address python

from scapy.all import *
from scapy.layers.inet import IP

pkts = rdpcap("path/to/pcap_file")
pkt1 = pkts[0]			# Get first packet
ip_hdr = pkt1[IP]

src_ip = ip_hdr.src		# Get source ip
dst_p = ip_hdr.dst		# Get destination ip
Comment

PREVIOUS NEXT
Code Example
Python :: horizontal line to the y axis in matplotlib 
Python :: django pass list of fields to values 
Python :: update matplotlib params 
Python :: numpy variance 
Python :: plt grid linestyles options 
Python :: how do i get auth user model dynamically in django? 
Python :: combinations 
Python :: array slicing python 
Python :: sudo in python 
Python :: convert file dta in csv 
Python :: argparse parse path 
Python :: pd calculations between columns 
Python :: turtle screen 
Python :: executing a python script interactively 
Python :: minio python make an object 
Python :: number length python 
Python :: convert to string in python 
Python :: statsmodels fitted values 
Python :: pandas get highest values column 
Python :: python get dir from path 
Python :: python regex find single character 
Python :: pytest for loop 
Python :: management command in django 
Python :: groupbycolumn 
Python :: set method in python 
Python :: convert string to float python 
Python :: stock market python 
Python :: how to take an input in python 
Python :: decorators in python 
Python :: scroll to top selenium python 
ADD CONTENT
Topic
Content
Source link
Name
4+2 =