ctfsolver.managers.manager_files_pcap¶
manager_files_pcap.py
This module provides the ManagerFilePcap class for handling and analyzing PCAP files using Scapy. It offers methods to open PCAP files, filter ICMP packets, extract TTL values, and search for specific text within packet payloads.
- Classes:
ManagerFilePcap: Manages PCAP file operations and packet analysis.
- Typical usage example:
manager = ManagerFilePcap() packets = manager.pcap_open(file=path_to_pcap) icmp_packets = manager.get_packets_icmp(packets) ttl_values = manager.get_packet_ttl(icmp_packets) found_text = manager.searching_text_in_packets(“flag”, packets)
Classes¶
ManagerFilePcap provides methods for handling and analyzing PCAP files using Scapy. |
Module Contents¶
- class ManagerFilePcap(*args, **kwargs)[source]¶
ManagerFilePcap provides methods for handling and analyzing PCAP files using Scapy. This class allows you to open PCAP files, filter packets by protocol (such as ICMP), extract specific packet attributes (like TTL), and search for text within packet payloads. .. attribute:: packets
List of packets loaded from a PCAP file.
- type:
list[scapy.packet.Packet]
- pcap_open(file=None, save=False) list[scapy.packet.Packet] | None[source]¶
Opens a PCAP file and loads packets using Scapy.
- Return type:
list[scapy.all.packet.Packet] | None
- searching_text_in_packets(text, packets=None, display=False) str[source]¶
Searches for a specific text in packet payloads and optionally displays matching packets.
- initializing_all_ancestors(*args, **kwargs)[source]¶
- Description:
Initializes all the ancestors of the class Placeholder for overwrite
- pcap_open(file=None, save=False)[source]¶
- Description:
Open the pcap file with scapy and saves it in self.packets