打开附件的流量包

可以发现有很多的tcp协议数据,追踪tcp协议数据看看

可以发现tcp数据流中有很多类似坐标的东西,先把这些数据另存为txt保存,如何用正则表达式提取这些数据,提取脚本如下:
import re
with open("data.txt", "r", encoding="utf-8") as f: data = f.read()
pattern = r'tgPos\{\d+\}\.Value\.\[\d+,\d+,\d+\]' #正则表达式匹配results = re.findall(pattern, data) #findall匹配所有符合的数据,results是匹配到数据的列表形式
if results: with open("output.txt", "w", encoding="utf-8") as f: for result in results: f.write(result + "\n") print("匹配结果已成功写入output.txt文件")else: print(" attern not found")提取到的数据如下: 可以发现,第三个数据始终是0,可以猜测是z轴,然后前面是x轴和y轴,可以根据这个坐标轴来画图,这里可以用两种方式来画图
import reimport matplotlib.pyplot as pltfrom PIL import Imagef=open("output.txt",'r')data=f.read()
pattern=r'\[\d+,\d+,\d+]'results = re.findall(pattern, data)print(results)x=[]y=[]for result in results: pattern=r'\d+' result=re.findall(pattern,result) print(result) x.append(int(result[0])) y.append(int(result[1]))
x_len = 400y_len = 200 # 查看最大坐标得知图片大致大小im = Image.new("RGB", (x_len, y_len))for i in range(len(x)): im.putpixel((x, y), (255, 255, 255)) #可以用像素法画出来im.show()
'''# 创建散点图plt.scatter(x, y) # 设置图表标题和坐标轴标签plt.title('Scatter Plot of XY Coordinates')plt.xlabel('X')plt.ylabel('Y')
# 显示图表plt.show()''' 然后将这个数据进行md5加密
md5:d4f1fb80bc11ffd722861367747c0f10
flag:NSSCTF{d4f1fb80bc11ffd722861367747c0f10}
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作! |