pstream 0.1.8 → 0.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/pstream.rb +12 -14
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9b5ec9929e9bd48fecc32ce9e9f5ce1703675390
|
4
|
+
data.tar.gz: 95bf28528095b9f9df126d69777411e3f0687a56
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f2fda90d6e63ab41c12c92a6e7f602c5cce20cb335334c09db4d179affeb6d23ba98c94aa742bf32089005ff95284d4eced38b3bfff8036004d1bcda42376975
|
7
|
+
data.tar.gz: ffe879ba24f2b9baec9e6d69b7fe5fc3067986fc0a13cbbc1543fe1aa6845f9c3c1cf065f7d91ed2d990b458c8161acec593b3848f0db5a16361190cf0d0a4ad
|
data/lib/pstream.rb
CHANGED
@@ -6,16 +6,14 @@ class PStream
|
|
6
6
|
|
7
7
|
def cipher_negotiations
|
8
8
|
negotiations = Hash.new
|
9
|
+
negotiation = nil
|
10
|
+
hello = nil
|
9
11
|
|
10
12
|
# List ciphers during ssl handshake
|
11
|
-
|
13
|
+
%x(
|
12
14
|
tshark -r #{@pcap} -Y ssl.handshake.ciphersuite -V 2>&1 \
|
13
15
|
| \grep -E "(Handshake|Internet) Prot|Cipher Suite"
|
14
|
-
)
|
15
|
-
|
16
|
-
negotiation = nil
|
17
|
-
hello = nil
|
18
|
-
out.split("\n").each do |line|
|
16
|
+
).split("\n").each do |line|
|
19
17
|
case line.gsub(/^ +/, "")
|
20
18
|
when /^Cipher Suite:/
|
21
19
|
m = line.match(/Cipher Suite: ([^ ]+) (.*)$/)
|
@@ -154,13 +152,11 @@ class PStream
|
|
154
152
|
|
155
153
|
streams = Array.new
|
156
154
|
|
157
|
-
|
155
|
+
count = 0
|
156
|
+
%x(
|
158
157
|
tshark -r #{@pcap} -z conv,#{prot} 2>&1 | \grep -E "<->" \
|
159
158
|
| awk '{print $1, $2, $3, "|", $8, "Frames"}'
|
160
|
-
)
|
161
|
-
|
162
|
-
count = 0
|
163
|
-
out.split("\n").each do |line|
|
159
|
+
).split("\n").each do |line|
|
164
160
|
desc, frames = line.split(" | ")
|
165
161
|
streams.push(
|
166
162
|
Stream.new(
|
@@ -205,7 +201,7 @@ class PStream
|
|
205
201
|
|
206
202
|
# List streams
|
207
203
|
["tcp", "udp"].each do |prot|
|
208
|
-
ret.push(colorize_header("#{prot} streams:"))
|
204
|
+
ret.push(colorize_header("#{prot.upcase} streams:"))
|
209
205
|
@streams[prot].each do |stream|
|
210
206
|
ret.push(colorize_stream(stream))
|
211
207
|
end
|
@@ -214,8 +210,10 @@ class PStream
|
|
214
210
|
|
215
211
|
# List ciphers that were actually selected
|
216
212
|
ret.push(colorize_header("Ciphers in use:"))
|
217
|
-
cipher_negotiations.
|
218
|
-
|
213
|
+
cipher_negotiations.map do |negotiation|
|
214
|
+
negotiation.suite
|
215
|
+
end.uniq.each do |suite|
|
216
|
+
ret.push(colorize_cipher_suite(suite))
|
219
217
|
end
|
220
218
|
|
221
219
|
return ret.join("\n")
|