您当前的位置: 首页 > 

暂无认证

  • 22浏览

    0关注

    93978博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

ctf工控 流量题

发布时间:2022-10-17 19:22:53 ,浏览量:22

奇怪的声音

某工控环境中泄露了某些奇怪的声音,你能获取到flag吗?Flag格式为:flag{}。

给了一张jpg 直接binwalk

image-20221003113203786

ICS.mp3打开听一下就是无线电的声音,考虑SSTV来解,要安装声卡应用Virtual Audio Cable

image-20221003112457015

出现默认设备就行了

至于无线电转图像的方式看了wp是robot36,其实应该也可以尝试,打开mp3播放然后用SSTV接收

image-20221003112959404 泄露的信号

安全研究员研究工控设备发出的无线信号进行研究,发现了一些不一样的东西。Flag格式为:flag{}。

image-20221003122805967

就一个这个文件,然后也没分离出啥东西,也看不出是啥文件类型

就莫名其妙直接去Audacity分析频谱图了,需要调节采样率然后很难看,

image-20221003122712428

image-20221003123157259

什么勾八题 放弃了

COTP

某工程师在运维中发现了设备的某些异常,怀疑可能遭受到了黑客的攻击,请您通过数据包帮助运维人员确定出被遭到了攻击的数据包。Flag格式为:flag{hex的data数据包后90位,字母为大写}

image-20221003155442684

为什么是这个包 没搞清楚

flag{31312D31424535312D30584230203B56332E308240001505323B32383882410003000300A20000000072010000}
工业物联网智能网关数据分析

某工控内网环境有台设备环境被破坏了,安全人员想通过当时抓的流量包进行溯源, 你能帮他发现什么东西么?Flag格式为:flag{}。

过滤MQTT数据,后面跟了些public message

image-20221003160723037

[f]包里的message有504B0304开头的数据,一看就是zip的文件头,保存下来但是不全

可以猜测是flag里面的数据组成的zip文件

image-20221003161444793

就是这样将数据组合一下,文件头文件尾都有了 010转存zip

image-20221003161739821

需要密码 在d包里找到了

image-20221003161919024

然后得到png

修改高度 ,LSB最低位隐写

被篡改的数据

某黑客拿到上位机的权限后对工控设备存储的数据进行了大量的修改,请分析其攻击数据,并找到其中的flag信息。

s7西门子流量

# -*- coding: UTF-8 -*- import pyshark def func_s7(): try: captures = pyshark.FileCapture("s702.pcapng")#这里为文件的路径 func_codes = {} for c in captures: for pkt in c: if pkt.layer_name == "s7comm": if hasattr(pkt, "param_func"):#param_func功能码字段 func_code = pkt.param_func if func_code in func_codes: func_codes[func_code] += 1 else: func_codes[func_code] = 1 print(func_codes) except Exception as e: print(e) if __name__ == '__main__': func_s7() 

image-20221003171708594

执行后的如图所示,一共存在三种功能码:0x04(读取值 Read Var)出现3984次、0xf0(建立通信 Setup communication)出现2次、0x05(写入值 Write Var)出现4016次

这里应该是取分析0x05,异常数据应该是黑客写入设备

s7comm.param.func==5

在19987包后面陆续出现flag的字符 ,追踪流就看见了

image-20221003173854181

不过数据还是太多了很不好找,用脚本提取

#encoding:utf-8 import pyshark

captures = pyshark.FileCapture("s702.pcapng") list=[] for c in captures: for pkt in c: if pkt.layer_name == "s7comm" and hasattr(pkt, "param_func"): param_func = pkt.param_func try: if param_func=='0x00000005': list.append(pkt.resp_data) else: continue except Exception as e: print(e) print(list) result='' for i in list: result=result+str(i) print(result) 

image-20221003182300474

image-20221003182343271

S7

工业协议中存在异常数据。请通过流量中的数据找寻 flag,flag形式为 flag{}。提交时请提交括号内内容。

  • 流量分析
  • S7Comm协议

过滤s7comm-plus.data.function == createobject,发现有写操作

image-20221004091301499

添加过滤条件s7comm-plus.data.opcode == 0x31,筛选写操作数据

image-20221004091249118

得到字符串ZmxhZ3s5d3pLc0x0bVdmWVduTk00fQ

Base解密得到flag

flag{9wzKsLtmWfYWnNM4}
Ele

工程师发现电力网络中存在异常流量,尝试通过分析流量包,分析出流量中的异常数据,并拿到FLAG,flag形式为 flag{}。

  • 流量分析
  • GOOSE协议

分离出goose包,发现所有PDU 的data值都是VBfMWV

image-20221004093534466

当goose.appid==8时,Data有变化

image-20221004093547374

提取得到字符串:MZWGCZ33MZNDSV2SKZYGGMCGJQYFQ5DMKV6Q,解三次base32就可以得到flag了

Flag
flag{fZ9WRVPC0FL0XTlU}
黑客的Fuzz

某黑客拿到上位机的权限后对工控设备进行扫描fuzz攻击,请分析其攻击数据,并找到其中的flag信息。flag格式为:flag{}

S7协议

脚本跑一下S7的功能码

image-20221004102649285

  • 0x00- CPU services CPU服务
  • 0xf0- Setup communication 建立通信
  • 0x04- Read Var 读取值
  • 0x05- Write Var 写入值
  • 0x1a- Request download 请求下载
  • 0x1b- Download block 下载块
  • 0x1c- Download ended 下载结束
  • 0x1d- Start upload 开始上传
  • 0x1e- Upload 上传
  • 0x1f- End upload 上传结束
  • 0x28- PI-Service 程序调用服务
  • 0x29- PLC Stop 关闭PLC

05写入 04读取,数据都比较多,用脚本提取04的数据

#encoding:utf-8 import pyshark

captures = pyshark.FileCapture("s7.pcapng") list=[] for c in captures: for pkt in c: if pkt.layer_name == "s7comm" and hasattr(pkt, "param_func"): param_func = pkt.param_func try: if param_func=='0x00000004': list.append(pkt.param_item_address) #print (list) else: continue except Exception as e: print(e) print(list) result='' for i in list: result=result+str(i) print(result) 

image-20221004162540451

FFD8FFE0是jpg文件头,想着会不会提取出jpg文件。确实是可以构造出jpg,但是后面出现了直接666c6167

image-20221004162705542

解hex就是flag了

image-20221004163501608

不安全的组件

工控生产环境内网中使用了不安全的组件,致使黑客突破隔离内网进入工控环境,安全员捕获到相关流量,请分析相关流量。flag格式为:flag{}。

过滤http协议

image-20221004170937151

image-20221004170945065

发现有modbus

然后导出对象里面搜modbus

image-20221004170837323

导出modbus2和modbus3,然后去各自分析

modbus2 过滤,发现功能码全是5

modbus3 功能码全是6 ,跑一下脚本

# -*- coding: UTF-8 -*- import pyshark def find_flag(): cap = pyshark.FileCapture("modbus3.pcapng") #设置Modbus流量包路径 idx = 1 for c in cap: for pkt in c: if pkt.layer_name == "modbus": func_code = int(pkt.func_code) if func_code == 6: #查看对应功能码寄存器下写入的值 payload = str(c["TCP"].payload).replace(":", "") print(hex_to_ascii(payload)) #print("{0} *".format(idx)) idx += 1 def hex_to_ascii(payload): data = payload
 flags = [] for d in data: _ord = ord(d) if (_ord > 0) and (_ord < 128): flags.append(chr(_ord)) return ''.join(flags) if __name__ == '__main__': find_flag() 

有重复的数据 去重

readDir = "file.txt" writeDir = "new_file.txt" outfile = open(writeDir, "w") f = open(readDir, "r") lines_seen = set() # Build an unordered collection of unique elements. for line in f: line = line.strip('\n') if line not in lines_seen: outfile.write(line + '\n') lines_seen.add(line) 

这里理解错了,要过滤出写入成功的数据包,modbus.response_time>0

image-20221004182816851

剩下的包也不多了,直接手打

逐个转10进制
3433
0928
4338
0001
8445
6228
7119
5029
8777
7431
8527
4044
9263
3948
3215
0897
9
合并所有数据
34330928433800018445622871195029877774318527404492633948321508979
转hex
537430705f616c315f6d616368696e655f657870316f7369306e73
转字符串
St0p_al1_machine_exp1osi0ns

我不理解作者的心理状态

隐藏的木马文件

小明在工业生产现场的数控机床上发现了一个插着的U盘,u盘中都是些图片和文档,细心的小明总觉得这个文件好像有点异常,作为安全运营人员你能发现这个u盘中是否蕴藏着什么秘密呢?flag格式为:flag{}

注意:这里解压的时候使用Win RAR解压,涉及NTFS流的都需要Win RAR解压

image-20221004191804205

TJ协议

按 长度排序,看见199感觉有点怪

666C61677B64616C616F6166646461617D

flag{dalaoafddaa}

关注
打赏
1655516835
查看更多评论
立即登录/注册

微信扫码登录

0.0509s