Ejemplo n.º 1
0
    pkt_type = ""
    bullet_count = 0
    for c in packet_string:
        if(c == "|"):
            bullet_count += 1
        if(bullet_count == 1 and c != " " and c != "|"):
            pkt_type += c
        if(bullet_count == 2 and c != " " and c != "|"):
            src_ip += c
        if(bullet_count == 3 and c != " " and c != "|"):
            dest_ip += c
        if(bullet_count == 4 and c != " " and c != "|"):
            content += c
    packet.pkt_type = pkt_type
    packet.src_ip = src_ip
    packet.dest_ip = dest_ip
    packet.content = content
    packet.datetime = datetime.now()
    packet_list.append(packet)
log = ""
udp_flag = True
http_flag = True
f = open("Output.txt", "w")
for p in packet_list:
    if(p.pkt_type == "udp"):
        if udp_flag == True:
            p.server = "udp_1"
            udp_flag = False
        else:
            p.server = "udp_2"
            udp_flag = True