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

20250626_黔西南网信杯_wireshark

Tags:流量分析,文件分离,pyshark,SQL注入,正则匹配

0x00. 题目

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

附件名称:20250626_黔西南网信杯_wireshark.zip

0x01. WP

1. 解压附件,FOREMOST分离出流量附件

图片

2. 浏览流量包http请求

发现为常规SQL注入的GET请求,直接对目标字段逐位进行爆破

图片

3. 使用通用协议解析代码,利用正则匹配进行数据提取

分析爆破数据,发现爆破成功后http.data字节长度为704,并包含You are in关键词

图片

整理过滤表达式提取爆破成功的响应包数据:http.request.uri contains "http://127.0.0.1/Less-5/" && http.request.full_uri contains "((select%20flag%20from%20answer)" && http.file_data contains "You are in"

图片

exp.py

# -*- coding: utf-8 -*-
import pyshark, os, re,time# Author: Jason.J.Hu
# Create : 2023/12/11# 初始化全局参数
strCapPath = "wireshark.pcapng"
strTsharkPath = "D:\\=Green=\\Wireshark\\App\\Wireshark\\"strFomula='http.request.uri contains "http://127.0.0.1/Less-5/"'
strFomula+=' && http.request.full_uri contains "((select%20flag%20from%20answer)"'
strFomula+=' && http.file_data contains "You are in"'
tFlag=""cap = pyshark.FileCapture(strCapPath, display_filter=strFomula,tshark_path=strTsharkPath)print(time.strftime("%H:%M:%S", time.localtime()), "HTTP分析开始 ... ...")# 协议结构分析开始
print("协议结构分析开始...")
i=0
for layer in cap[0].layers:print("第",i+1,"层:",layer.layer_name)print(layer.field_names)i+=1
print("协议结构分析完成。")
print("=" * 16)lstResult=['','','','']
sFlag=""
for pkt in cap:intRequestNumber = pkt.numberprint("\r\tFrame Number: %s ..." % str(intRequestNumber), end="")sRequestURI=pkt.http.request_uri# print(sRequestURI)# http://127.0.0.1/Less-5/?id=0'%20or%20ascii(substr((select%20flag%20from%20answer),3,1))=71--+lstRE=re.search(r'''select%20flag%20from%20answer\),(.*?),1\)\)=(.*?)--+''', sRequestURI)print(lstRE[1],lstRE[2])if len(lstResult)<(int(lstRE[1])+1):lstResult.append("")lstResult[int(lstRE[1])]=chr(int(lstRE[2]))# print(lstResult)print("\r")
sFlag="".join(lstResult)
print(sFlag)    
print("\r")
print(time.strftime("%H:%M:%S", time.localtime()), "HTTP分析结束。")# flag{W1re_Sha4k_and_SQLi}
http://www.jsqmd.com/news/5323/

相关文章:

  • Ubuntu STA+AP 开机自启完整方案
  • PDE和CFD的区别?
  • MCU的闪存(FLASH)按机制结构划分区域
  • T2
  • 负载均衡式在线OJ工程复盘
  • 题解:CF1930I Counting Is Fun
  • AI百炼大模型接入钉钉,实现在群中免@交互式新闻推送
  • K8S-Service 学习
  • 第05周 预习、实验与作业:继承与多态
  • 深入解析:ShardingSphere 与分库分表:分布式数据库中间件实战指南
  • 纸浆2511
  • electron38-admin桌面端后台|Electron38+Vue3+ElementPlus管理系统
  • 长江中游干流河道崩岸特征与机理研究综述
  • 漫谈《数字图像处理》之最大稳定极值区域(MSER) - 实践
  • 基于 Python Keras 建立 猫狗图像的精准分类
  • 【变量与数据类型】让自动化拥有“记忆”
  • 《ESP32-S3使用指南—IDF版 V1.6》第四十章 图片显示实验
  • QCOW2: A Virtual Disk Format Designed for Modern Virtualization
  • 鸿蒙应用开发从入门到实战(十六):线性布局案例
  • SQL注入流程
  • Spring Boot 3.x + Security + OpenFeign:如何避免内部服务调用被重复拦截? - 详解
  • 完整的GLFW应用程序示例
  • 物理笔记
  • 基于Python+Vue开发的商城管理系统源码+运行步骤
  • HTML5-和-CSS3-迁移即时入门-全-
  • HTML5-多人游戏开发-全-
  • HTML5-地理位置即时操作指南-全-
  • [Kernel] - Heterogeneous Memory Management (HMM)
  • GreenPlum - Get field types
  • 搭建环境