纵横网络靶场社区前四题wp

Modbus协议

黑客通过外网进入一家工厂的控制网络,之后对工控网络中的操作员站系统进行了攻击,最终通过工控协议破坏了正常的业务。我们得到了操作员站在攻击前后的网络流量数据包,我们需要分析流量中的蛛丝马迹,找到FLAG,flag形式为 flag{} 

点击length找到长度最长的包
纵横网络靶场社区前四题wp_第1张图片

flag{TheModbusProtocolIsFunny!}

MMS协议分析

	工业网络中存在的异常,尝试通过分析PACP流量包,分析出流量数据中的异常 点,并拿到FLAG,flag形式为 flag{}。

点击length能看到一个超大长度的tcp包
纵横网络靶场社区前四题wp_第2张图片
发现传输了一张图片,浏览器访问下方内容即可

data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAdAAAABiCAYAAADgKILKAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAABzXSURBVHhe7Z2Js11Fncfn75maqZmaqZkaS0elXAp1GHRUhGFAQHYQFQRFBWQRiBoBWQyyKaBsxo0tCAgkQHayQEL2jSxAyEoSIAHOvM/JPTPn9fv1Od19+9z3bvh+qr5FkXe77z33ntO/7l//fr/+m0IIIYQQ0ciACiGEEAnIgAohhBAJyIAKIYQQCciACiGEEAnIgAohhBAJyIAKIYQQCciACiGEEAnIgAohhBAJyIAKIYQQCciACiGEEAnIgAohhBAJyIAKIYQQCciACiGEEAnIgAohhBAJyIAKIYQQCciACiGEEAnIgAohhBAJyIAKIYQQCciACiGEEAnIgAohhBAJyIAKIYQQCciACiGEEAnIgAohhBAJyIAKIYQQCciACiGEEAnIgAohhBAJyIAKIYQQCciACiGEEAl0ZkDff78oNm/ZV8xfuK2Y8fxrxex5W4vlK3cVe/Ye6L1CCCGEGF6yGtC33n63uOPuNcW/fHJG8bcffsarf/3UjNLAVtz/h/Xm6/h3IYQQYiKSzYBufePt4thT55qG0NXxp8/ttTqIDGj/vP3Oe+VKf/L1y4qTzppffOq/ni/+6bDpxY+ve7n3irHw/VrKzdsjE6tFL24v7p26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DpCv6f7YiOIQsfhOoa/EyQpCCHGo0ZZGeO/UblefIAM6YNiot35sROWiWAhuuOZGf1EBGVAhxKGIz4CyFcbKdBCRxDKgiVAyjvM4if4NgVzDh6Zt9KbbpJwpWocC6Rxv5tbHlQEVQhyKuAaUoMrrp6zoK5MiFhnQROp5n6TO3Dd1fbFw8fbS506VIIozE8zDgbwYzqYi8iT0p6w+LZh1UU2J/las2lVs2jKxz+UUQogUKMlIURxSFHe/OT7ZBzKgCZDXGVK4IVS56moKIYQYHDKgCVDJxDKEKaLgghBCiOFDBjQBcossYxgj/PXzXlCKiRBCDCsyoIlwQjvlrz50uH04s0/Hnjq3DEAa5MHNQggh8iMD2icH3n2/WLlqd1kE/tY7VxdXTV5a1nw9/6JF5X8paECR96dnvDruxcuFEELkQwZUCCGESEAGVAghhEhABlQIIYRIQAZUCCGESEAGVAghhEhABlQIIYRIQAZUCCGESEAGVAghhEhABlQIIYRIQAZUCCGESEAGVAghhEhABlQIIYRIQAZUCCGESEAGVAghhIimKP4XBcAIzFfvoBoAAAAASUVORK5CYII=

纵横网络靶场社区前四题wp_第3张图片

flag{ICS-mms104}

大工UDP协议

	在进行工业企业检查评估工作中,发现了疑似感染恶意软件的上位机。现已提取出上位机通信流量,尝试分析出异常点,获取FLAG,flag形式为 flag{}。 

搜索flag,发现有关于flag的内容
纵横网络靶场社区前四题wp_第4张图片
追踪UDP流,在flag旁边发现一段base16的数据
纵横网络靶场社区前四题wp_第5张图片
解密获得flag
在这里插入图片描述

flag{7FoM2StkhePz}

工控蜜罐日志分析

工控安全分析人员在互联网上部署了工控仿真蜜罐,通过蜜罐可抓取并分析互联网上针对工业资产的扫描行为,将存在高危扫描行为的IP加入防火墙黑名单可有效减少工业企业对于互联网的攻击面。分析出日志中针对西门子私有通信协议扫描最多的IP,分析该扫描组织,Flag为该IP的域名,,flag形式为 flag{}。 

附件是一个log日志,题目给了我们提示,让我们查找针对西门子的协议,百度了下协议为S7

然后写个脚本,思路是先提取协议为S7的数据,然后再从里面提取IP

from os import lseek
import re
from collections import Counter

def extract_honeypot():
    file = open('honeypot.log','r').read()

    file = file.split('\n')

    for i in range(len(file)):
        if "S7" in file[i]:
            b = file[i]
            with open('S7.txt','a') as a:
                a.write(b + '\n')
def extract_S7():
    file = open('S7.txt','r').read()
    file = file.split('\n')
    list = []
    # print(file)
    for i in file:
        ipaddress = re.findall(r"\b(?:[0-9]{1,3}\.){3}[0-9]{1,3}\b", i)
        if ipaddress:
            list.append(ipaddress)
    print(list)


extract_honeypot()
extract_S7()

本来想着用collections处理下看哪个ip最多,但是肉眼直接看就能看出来

['139.162.99.243']

然后ip反查域名

https://site.ip138.com/139.162.99.243/得到

scan-42.security.ipip.net

flag{scan-42.security.ipip.net}

你可能感兴趣的:(misc,web安全)