results updated
This commit is contained in:
@@ -1,46 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
"""
|
||||
do_line_diff.py - Interactively runs all tests, and on any test where line_diff.py
|
||||
showed an output, lets the user check the output and replace the test file with the output
|
||||
file if they think it's safe to do so (in the sense that the test is actually passing). This
|
||||
script was first used when enhancing the ssl protocol to not immediately stop detection upon
|
||||
only detecting a client certificate. When server certificates were added, the this script
|
||||
was helpful in checking which lines of which tests had appended server certificate info
|
||||
to the line.
|
||||
"""
|
||||
|
||||
import os
|
||||
import sys
|
||||
import time
|
||||
import subprocess
|
||||
|
||||
program_base_args = ["../example/ndpiReader", "-p", "../example/protos.txt", "-q", "-i"]
|
||||
line_diff_base_args = ["./line_diff.py"]
|
||||
temp_output = "/tmp/reader.out"
|
||||
result_folder = "result/"
|
||||
pcap_folder = "pcap/"
|
||||
pcap_file_list = os.listdir(pcap_folder)
|
||||
|
||||
def find_pcap(result_file):
|
||||
for pcap_file in pcap_file_list:
|
||||
if pcap_file == result_file[:-4]:
|
||||
return pcap_file
|
||||
|
||||
for result_file in os.listdir(result_folder):
|
||||
pcap_file = find_pcap(result_file)
|
||||
program_args = program_base_args + [pcap_folder + pcap_file, "-w", temp_output, "-v", "1"]
|
||||
program_output = subprocess.call(program_args)
|
||||
line_diff_args = line_diff_base_args + [result_folder + result_file, temp_output]
|
||||
line_diff_output = subprocess.check_output(line_diff_args, universal_newlines=True)
|
||||
if len(line_diff_output) > 0:
|
||||
print("File output " + result_file + " had line diff output. Here it is:")
|
||||
print(line_diff_output)
|
||||
replace = ""
|
||||
while replace.lower() != 'y' and replace.lower() != 'n':
|
||||
replace = input("Would you like to replace the file? ('y' or 'n') ")
|
||||
if replace == 'y':
|
||||
subprocess.check_output(["cp", temp_output, result_folder + result_file])
|
||||
print("")
|
||||
elif replace == 'n':
|
||||
break
|
||||
@@ -1,45 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
line_diff.py - Simple tool that compares two files with the same number of lines and prints the
|
||||
characters (if any) on the right line (moving left to right) that are present that
|
||||
weren't present in the left line
|
||||
"""
|
||||
|
||||
import sys
|
||||
|
||||
left_file = sys.argv[1]
|
||||
right_file = sys.argv[2]
|
||||
|
||||
left_lines = []
|
||||
right_lines = []
|
||||
|
||||
with open(left_file) as left:
|
||||
for line in left.readlines():
|
||||
left_lines.append(line.strip())
|
||||
with open(right_file) as right:
|
||||
for line in right.readlines():
|
||||
right_lines.append(line.strip())
|
||||
|
||||
if len(left_lines) != len(right_lines):
|
||||
print("Files didn't have the same number of lines, exiting...")
|
||||
sys.exit(0)
|
||||
|
||||
for i in range(len(left_lines)):
|
||||
left_contents = left_lines[i]
|
||||
right_contents = right_lines[i]
|
||||
if len(left_contents) > len(right_contents):
|
||||
print("Line " + str(i) + " has longer left contents than right contents.")
|
||||
print("Left contents: " + left_contents)
|
||||
print("Right contents: " + right_contents)
|
||||
break
|
||||
else:
|
||||
left_list = list(left_contents)
|
||||
right_list = list(right_contents)
|
||||
while len(left_list) > 0:
|
||||
if right_list.pop(0) != left_list.pop(0):
|
||||
print("Line " + str(i) + ": Right contents that are not a prefix of left contents.")
|
||||
print("Left contents: " + left_contents)
|
||||
print("Right contents: " + right_contents)
|
||||
break
|
||||
if len(right_list) > 0:
|
||||
print("Line " + str(i) + ": Right contents have extra characters: " + ''.join(right_list))
|
||||
Executable → Regular
@@ -1,25 +0,0 @@
|
||||
ICMP 30 2100 2
|
||||
Nintendo 890 320242 12
|
||||
Amazon 76 10811 7
|
||||
|
||||
1 UDP 192.168.12.114:52119 <-> 134.3.248.25:56955 [proto: 173/Nintendo][8 pkts/1040 bytes <-> 7 pkts/922 bytes]
|
||||
2 TCP 192.168.12.114:11534 <-> 54.146.242.74:443 [proto: 91.178/SSL.Amazon][1 pkts/54 bytes <-> 1 pkts/54 bytes]
|
||||
3 UDP 192.168.12.114:52119 -> 35.158.74.61:33335 [proto: 173/Nintendo][3 pkts/354 bytes -> 0 pkts/0 bytes]
|
||||
4 UDP 192.168.12.114:55915 -> 35.158.74.61:33335 [proto: 178/Amazon][3 pkts/318 bytes -> 0 pkts/0 bytes]
|
||||
5 UDP 192.168.12.114:52119 -> 52.10.205.177:34343 [proto: 178/Amazon][1 pkts/730 bytes -> 0 pkts/0 bytes]
|
||||
6 UDP 192.168.12.114:51035 <-> 192.168.12.1:53 [proto: 5.173/DNS.Nintendo][1 pkts/110 bytes <-> 1 pkts/281 bytes][Host: e0d67c509fb203858ebcb2fe3f88c2aa.baas.nintendo.com]
|
||||
7 UDP 192.168.12.114:55915 -> 52.10.205.177:34343 [proto: 178/Amazon][1 pkts/298 bytes -> 0 pkts/0 bytes]
|
||||
8 UDP 192.168.12.114:10184 <-> 192.168.12.1:53 [proto: 5.173/DNS.Nintendo][4 pkts/368 bytes <-> 4 pkts/400 bytes][Host: g2df33d01-lp1.p.srv.nintendo.net]
|
||||
9 UDP 192.168.12.114:18874 <-> 192.168.12.1:53 [proto: 5.173/DNS.Nintendo][1 pkts/110 bytes <-> 1 pkts/281 bytes][Host: e0d67c509fb203858ebcb2fe3f88c2aa.baas.nintendo.com]
|
||||
10 UDP 192.168.12.114:55915 <-> 93.237.131.235:56066 [proto: 173/Nintendo][122 pkts/48332 bytes <-> 35 pkts/5026 bytes]
|
||||
11 UDP 192.168.12.114:55915 -> 35.158.74.61:33334 [proto: 178/Amazon][5 pkts/290 bytes -> 0 pkts/0 bytes]
|
||||
12 ICMP 151.6.184.100:0 -> 192.168.12.114:0 [proto: 81/ICMP][21 pkts/1470 bytes -> 0 pkts/0 bytes]
|
||||
13 ICMP 151.6.184.98:0 -> 192.168.12.114:0 [proto: 81/ICMP][9 pkts/630 bytes -> 0 pkts/0 bytes]
|
||||
14 TCP 192.168.12.114:31329 <-> 54.192.27.8:443 [proto: 91.173/SSL.Nintendo][10 pkts/2833 bytes <-> 10 pkts/4866 bytes][client: 5][server: *.baas.nintendo.com]
|
||||
15 TCP 192.168.12.114:41517 <-> 54.192.27.217:443 [proto: 91.173/SSL.Nintendo][11 pkts/2898 bytes <-> 10 pkts/4865 bytes][client: 5][server: *.baas.nintendo.com]
|
||||
16 UDP 192.168.12.114:52119 <-> 91.8.243.35:49432 [proto: 173/Nintendo][23 pkts/2682 bytes <-> 16 pkts/3408 bytes]
|
||||
17 TCP 54.187.10.185:443 <-> 192.168.12.114:48328 [proto: 91.178/SSL.Amazon][34 pkts/4466 bytes <-> 20 pkts/4021 bytes]
|
||||
18 UDP 192.168.12.114:55915 <-> 81.61.158.138:51769 [proto: 173/Nintendo][122 pkts/46476 bytes <-> 38 pkts/5268 bytes]
|
||||
19 UDP 192.168.12.114:52119 <-> 109.21.255.11:50251 [proto: 173/Nintendo][8 pkts/1024 bytes <-> 8 pkts/1024 bytes]
|
||||
20 UDP 192.168.12.114:55915 <-> 185.118.169.65:27520 [proto: 173/Nintendo][169 pkts/61414 bytes <-> 278 pkts/126260 bytes]
|
||||
21 UDP 192.168.12.114:55915 <-> 35.158.74.61:10025 [proto: 178/Amazon][5 pkts/290 bytes <-> 5 pkts/290 bytes]
|
||||
|
||||
@@ -5,9 +5,9 @@ NTP 2 180 1
|
||||
SSDP 101 38156 6
|
||||
ICMP 8 656 1
|
||||
IGMP 5 258 4
|
||||
SSL 96 8876 7
|
||||
SSL 88 8268 6
|
||||
Dropbox 38 17948 5
|
||||
Skype 2139 324409 249
|
||||
Skype 2147 325017 250
|
||||
Apple 15 2045 2
|
||||
AppleiCloud 88 20520 2
|
||||
Spotify 5 430 1
|
||||
@@ -181,7 +181,7 @@ MS_OneDrive 387 198090 1
|
||||
166 TCP 192.168.1.34:50051 <-> 157.55.130.166:443 [proto: 91.125/SSL.Skype][12 pkts/1074 bytes <-> 3 pkts/277 bytes]
|
||||
167 TCP 192.168.1.34:50057 <-> 157.55.130.153:443 [proto: 91.125/SSL.Skype][12 pkts/1102 bytes <-> 3 pkts/247 bytes]
|
||||
168 TCP 192.168.1.34:50091 <-> 157.55.235.146:443 [proto: 91.125/SSL.Skype][13 pkts/1554 bytes <-> 3 pkts/200 bytes]
|
||||
169 TCP 192.168.1.34:50146 -> 157.56.53.51:443 [proto: 91/SSL][8 pkts/608 bytes -> 0 pkts/0 bytes]
|
||||
169 TCP 192.168.1.34:50146 -> 157.56.53.51:443 [proto: 91.125/SSL.Skype][8 pkts/608 bytes -> 0 pkts/0 bytes]
|
||||
170 TCP 192.168.1.34:50069 <-> 157.55.56.160:443 [proto: 91.125/SSL.Skype][11 pkts/1050 bytes <-> 4 pkts/351 bytes]
|
||||
171 TCP 192.168.1.34:50081 <-> 157.55.130.176:443 [proto: 91.125/SSL.Skype][12 pkts/1270 bytes <-> 3 pkts/243 bytes]
|
||||
172 TCP 192.168.1.34:50101 <-> 157.55.235.176:443 [proto: 91.125/SSL.Skype][12 pkts/1305 bytes <-> 3 pkts/285 bytes]
|
||||
|
||||
Reference in New Issue
Block a user