Esempio n. 1
0
    def __write_icmp_verbose_output__(self, packet_data):
        '''
        Formats the verbose terminal output for ICMP Packet Data (only going to be exectuted in espionage.py conditional)
        @param (packet_data) - Contents of the ICMP packet
        @return None
        '''
        pk = Packet()
        cfg = Config()
        esp = Espionage()
        try:
            icmp_packet_type, icmp_packet_code, icmp_check_summation, icmp_packet_data = pk.handle_icmp_packet(packet_data)

            esp.print_espionage_message("ICMP Contents {}".format(cfg.ESPI_ASCII_DOWN_ARROW))
            esp.print_espionage_notab("ICMP Checksum: {}, ICMP Type: {}, ICMP Code: {}".format(icmp_check_summation, icmp_packet_type,
            icmp_packet_code))
            esp.print_espionage_notab("\t\tICMP Data: {}".format(icmp_packet_data))
        except: pass
Esempio n. 2
0
    def __write_icmp_normal_output__(self, packet_data):
        '''
        Formats the terminal output for ICMP Packet Data
        @param (packet_data) - Contents of the ICMP packet
        @return None
        '''
        pk = Packet()
        cfg = Config()
        esp = Espionage()

        icmp_packet_type, icmp_packet_code, icmp_check_summation, icmp_packet_data = pk.handle_icmp_packet(
            packet_data)

        esp.print_espionage_message("ICMP Contents {}".format(
            cfg.ESPI_ASCII_DOWN_ARROW))
        esp.print_espionage_notab(
            "ICMP Checksum: {}, ICMP Type: {}, ICMP Code: {}".format(
                icmp_check_summation, icmp_packet_type, icmp_packet_code))
Esempio n. 3
0
    def __write_ipv4_normal_output__(self, packet_data):
        '''
        Formats the terminal output for IPv4 Packet Data
        @param (packet_data) - Contents of the IPv4 packet
        @return None
        '''
        pk = Packet()
        cfg = Config()
        esp = Espionage()

        try:
            (packet_version, packet_header_length, packet_ttl, packet_protocol, packet_source, packet_destination,
            packet_data) = pk.handle_ipv4_packet(packet_data)

            esp.print_espionage_message("IPv4 Packet Contents {}".format(cfg.ESPI_ASCII_DOWN_ARROW))
            esp.print_espionage_notab("\t <-- Protocol: {}, Source: {}, Destination: {}".format(packet_protocol, packet_source, packet_destination))

        except: pass
Esempio n. 4
0
    def __write_ipv4_verbose_output__(self, packet_data):
        '''
        Formats the verbose terminal output for IPv4 Packet Data
        @param (packet_data) - Contents of the IPv4 packet
        @return None
        '''
        pk = Packet()
        cfg = Config()
        esp = Espionage()

        (packet_version, packet_header_length, packet_ttl, packet_protocol,
         packet_source, packet_destination,
         packet_data) = pk.handle_ipv4_packet(packet_data)

        esp.print_espionage_message("IPv4 Packet Contents {}".format(
            cfg.ESPI_ASCII_DOWN_ARROW))
        esp.print_espionage_notab("Version: " + str(packet_version) +
                                  ", TTL: " + str(packet_ttl) + ", Header: " +
                                  str(packet_header_length))
        esp.print_espionage_notab("\tProtocol: " + str(packet_protocol) +
                                  ", Source: " + str(packet_source) +
                                  ", Destination: " + str(packet_destination))