@@ -53,12 +53,23 @@ def __init__(
53
53
command += ["-w" , PCAP_FILE_PATH [self .connection .target_os ]]
54
54
55
55
if self .interfaces :
56
- command += ["-i" , "," .join (self .interfaces )]
56
+ if self .connection .target_os != TargetOS .Windows :
57
+ command += ["-i" , "," .join (self .interfaces )]
58
+ else :
59
+ # TODO(gytsto). Windump itself only supports one interface at the time,
60
+ # but it supports multiple instances of Windump without any issues,
61
+ # so there is a workaround we can do for multiple interfaces:
62
+ # - create multiple process of windump for each interface
63
+ # - when finished with dump, just combine the pcap's with `mergecap` or smth
64
+ print (
65
+ "[Warning] Currently tcpdump for windows support only 1 interface"
66
+ )
67
+ command += ["-i" , self .interfaces [0 ]]
57
68
else :
58
69
if self .connection .target_os != TargetOS .Windows :
59
70
command += ["-i" , "any" ]
60
71
else :
61
- command += ["-i" , "1" , "-i" , "2" ]
72
+ command += ["-i" , "1" ]
62
73
63
74
if self .count :
64
75
command += ["-c" , str (self .count )]
@@ -77,6 +88,9 @@ def __init__(
77
88
78
89
self .process = self .connection .create_process (
79
90
command ,
91
+ # xterm type is needed here, because Mac on default term type doesn't
92
+ # handle signals properly while `tcpdump -w file` is running, without writing
93
+ # to file, everything works fine
80
94
term_type = "xterm" if self .connection .target_os == TargetOS .Mac else None ,
81
95
)
82
96
0 commit comments