tls 流量画像——直接使用图像处理的思路探索,待进一步观察

Posted bonelee

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了tls 流量画像——直接使用图像处理的思路探索,待进一步观察相关的知识,希望对你有一定的参考价值。

代码,示意了一个tls的数据内容:

import numpy as np
import matplotlib.pyplot as pyplot
# !!! If on the server, use following, comment show and you can just save figure !!!
# pyplot.switch_backend(‘agg‘)


a = np.array([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12])
b = np.reshape(a, (2, -1))
c = a.reshape(2, -1)
print(a)
print(c)

tls_data = "9f008200430081004e00340066002e002400230030003e002f0031001e0022002b001e0027002f0022001e002b0030002700240011002800190032001a00230037001c00180021001b001f001d001c0025001c0026002b0017001e007c002d008b003e002e00170018001f001d0024001f0021001d001f001900160013001a001c0027001b002c001e0023001800280020001b00280012001d001c001f001f00190019002b001e001b00370017001b002000230027001d001a001f00220016001c0032002200560043005000190035002300520026002b003d00380032003f003300210034003300400053001b003e0018001c00160017001e0019001c0017001b00210049002300170021002b001a00100024001b00220013001f001c001a001f001f0022000f0012001f001c001d001900210019001e00240020002100190025002000160020002c001d00180017002100210018001a00200014001e001900170026001b00170022001500250016001d002100200020001b001e001a001b002a00200020001d00230022001f00170017001b0017001d0015001f001a001900180022001a00170017001c001900180021001b001a0018002a001e001d001d00280022001f00180023001e001f001b0018001f001c0023002a00230016001d001a001f00180017001d001c00170026001c002200190019001c001f0018002600"
# tls_data = tls_data[:512]
print(len(tls_data))
tls_data = [ord(c) for c in tls_data]
#np.reshape(tls_data[:32*32], (32, 32))

tls_data = np.array(tls_data)
# padding with 0
tls_data.resize(32*32)
c = tls_data.reshape(32, 32)

# print(c)
# pyplot.imshow(c, cmap="gray")
pyplot.imshow(c)
pyplot.gray()
pyplot.show()
# pyplot.savefig("xxx.jpg") # not work
pyplot.imsave(test.png, c)

"""
data = "6^f7905bd00a47187f00000000^46.229.168.130^115.27.245.2^62560^443^6^2732^30^21312^24^1540360775^1540360778^^^^^^^^^^^^^SSL^HTTPS^Network^Infrastructure^^^^0:24;203:2;126:2;249:2-0:6;1448:12;798:2;274:2;264:2^+0eb-5c8-5c8-33e+09e-132+119-5c8-5c8-5c8-128^5223def45223def75223def75223def75223e59d5223e59e5223e6f05223e6f35223e6f35223e6f35223e6f3^9f008200430081004e00340066002e002400230030003e002f0031001e0022002b001e0027002f0022001e002b0030002700240011002800190032001a00230037001c00180021001b001f001d001c0025001c0026002b0017001e007c002d008b003e002e00170018001f001d0024001f0021001d001f001900160013001a001c0027001b002c001e0023001800280020001b00280012001d001c001f001f00190019002b001e001b00370017001b002000230027001d001a001f00220016001c0032002200560043005000190035002300520026002b003d00380032003f003300210034003300400053001b003e0018001c00160017001e0019001c0017001b00210049002300170021002b001a00100024001b00220013001f001c001a001f001f0022000f0012001f001c001d001900210019001e00240020002100190025002000160020002c001d00180017002100210018001a00200014001e001900170026001b00170022001500250016001d002100200020001b001e001a001b002a00200020001d00230022001f00170017001b0017001d0015001f001a001900180022001a00170017001c001900180021001b001a0018002a001e001d001d00280022001f00180023001e001f001b0018001f001c0023002a00230016001d001a001f00180017001d001c00170026001c002200190019001c001f0018002600^^^^^^^^^^^"
arr = data.split("^")
print(arr[-12])
"""

技术分享图片

感觉还是有内在规律可以遵循的。

以上是关于tls 流量画像——直接使用图像处理的思路探索,待进一步观察的主要内容,如果未能解决你的问题,请参考以下文章

查找谁在使用过时的 TLS 处理 SMTP 流量

2021年科大讯飞 基于用户画像的商品推荐挑战赛前三名队伍分享

nginx流量分割和加header

nginx流量分割和加header

TD数据应用——基于地理信息和时间序列的人群画像探索

性能提升一倍,云原生网关支持 TLS 硬件加速