当前位置: 首页 > news >正文

202009_风二西_USB鼠标流量

Tags:流量分析,USB鼠标,gnuplot

0x00. 题目

附件路径:https://pan.baidu.com/s/1GyH7kitkMYywGC9YJeQLJA?pwd=Zmxh#list/path=/CTF附件

附件名称:202009_风二西_USB鼠标

0x01. WP

1. 脚本解析USB鼠标流量,导出点击轨迹

getUSBMouse.py

# -*- coding: utf-8 -*-
import pyshark, os# 尝试合并http响应的所有TCP包# 初始化pyshark参数
strTsharkPath = "D:\\=Green=\\Wireshark\\App\\Wireshark\\"
strCapPath = "test2.pcapng"
strFomula=""
strlog="output.log"
blnLog=Truedef file_remove(filepath):try:os.remove(filepath)except:passdef log_write(filecontent):# print(filecontent)if blnLog:file = open(strlog, "a", encoding='utf-8')file.write(filecontent + "\n")file.close()#清空日志文件
file_remove(strlog)cap= pyshark.FileCapture(strCapPath,display_filter=strFomula,tshark_path=strTsharkPath)
intTmp=0
strResult=""
posx = 0
posy = 0
result=open('result.txt','w')for pkt in cap:intRequestNumber=pkt.numberlog_write("="*32)log_write("Frame No.: %d"%int(intRequestNumber))for layer in pkt.layers:log_write("layer name: "+layer.layer_name)log_write("\t"+str(layer.field_names))# log_write(str(layer))strUSBData=""blnButton=0 #左键1右键2无键0if str(layer.layer_name)=="DATA":   # 监控鼠标滑动流量协议try:strUSBData=str(layer.usbhid_data)print(strUSBData)lUSBData=strUSBData.split(":")# 01:00:fa:ff:ff:00blnButton=int(lUSBData[1],16)   # 1左键2右键0无键x=int(lUSBData[2],16)   # 横向位移y=int(lUSBData[3],16)   # 纵向位移if x > 127:x -= 256if y > 120:y -= 264posx += xposy += yif blnButton == 1:  #先过滤左键滑动轨迹result.write(str(posx) + ' ' + str(-posy) + '\n')#print(result)except:passintTmp+=1print(strResult)result.close()log_write("共分析出%d个请求。"%intTmp)

2. 解析坐标轨迹

gnuplot.exe -e "plot 'result.txt'" -p

图片

0x02. 附 gnuplot安装简易教程

下载地址:https://sourceforge.net/projects/gnuplot/files/gnuplot/

http://www.wxhsa.cn/company.asp?id=2240

相关文章:

  • virtuoso默认设置
  • CF547D Mike and Fish
  • Tarjan vDCC 缩点
  • ABC_419_F - All Included
  • 软件工程第一次作业-自我介绍
  • DIFY 与 LangChain
  • VMware CentOS 7 `yum` 修复及 VMware Tools 安装问题复盘
  • 接口测试---Requests
  • LangChain大模型应用开发介绍
  • [豪の学习笔记] 软考中级备考 基础复习#8
  • lc1025-除数博弈
  • 漏洞解析--文件包含漏洞究竟怎么用?
  • 办公室装修 暂存
  • 博客更新公告
  • 爆:GitHub Copilot支持包括Anthropic、Azure、Google Gemini、Groq、OpenAI 和 OpenRouter等供应商API
  • JavaWeb05 - 详解
  • CF182C
  • CF185D
  • Python计算文件md5
  • CF201C
  • CF1774D
  • CF23C
  • CF37C
  • CF33D
  • 支持类 Unix 语法 ``:Windows 下用 PowerShell 7 优化 npm 和 VS Code
  • 初赛程序阅读做题要点
  • 模拟堆(手写堆 的五大操作)
  • 【A】杂题悬桨
  • 使用Osquery进行远程取证:NTFS取证扩展实战指南
  • 完整教程:简单介绍一下Clickhouse及其引擎