Î÷ÃÅ×ÓPLC S7-1500Îó²îÆÊÎöÓ븴ÏÖ

Ðû²¼Ê±¼ä 2020-04-23

Ñо¿Åä¾°


Î÷ÃÅ×ÓPLCÆÕ±éÔËÓÃÔÚ¸÷ÐÐÒµµÄ¹¤Òµ¿ØÖÆϵͳÉÏ £¬ºÃ±È¸ÖÌú¡¢Ê¯ÓÍ¡¢»¯¹¤¡¢µçÁ¦¡¢½¨²Ä¡¢»úеÖÆÔì¡¢Æû³µ¡¢Çá·Ä¡¢½»Í¨ÔËÊä¡¢»·±£¼°ÎÄ»¯ÓéÀÖµÈÐÐÒµ £¬ÆäÇå¾²ÐÔÖ±½Ó¹Øºõ¹ú¼ÒÃñÉúÇå¾²  ¡£


2019 BlackHat USA¾Û»áÉÏ £¬Çå¾²Ñо¿Ô±Sara BitanÖ¸³öÎ÷ÃÅ×ÓPLC×îеÄͨѶЭÒéS7Comm-Plus±£´æÇå¾²ÎÊÌâ  ¡£Îª´Ë £¬ÓÅ·¢¹ú¼ÊÍøÕ¾¹ÙÍøADLab¶ÔÏà¹ØÎó²î¾ÙÐÐÑо¿ £¬²¢ÔÚÎ÷ÃÅ×ÓS7-1500×°±¸Éϸ´ÏÖÁ˹¥»÷Ч¹û  ¡£


Î÷ÃÅ×ÓPLCЭÒé


Î÷ÃÅ×ÓPLC°üÀ¨S7-200¡¢S7-300¡¢S7-400¡¢S7-1200ÒÔ¼°S7-1500µÈ¶à¸öϵÁÐ  ¡£S7-200/300/400ϵÁÐPLC½ÓÄÉÔçÆÚµÄÎ÷ÃÅ×Ó˽ÓÐЭÒéS7comm¾ÙÐÐͨѶ £¬S7-1200/1500ϵÁÐPLC½ÓÄÉÎ÷ÃÅ×ÓS7Comm-PlusЭÒé¾ÙÐÐͨѶ  ¡£


S7Comm-PlusЭÒéÔÚS7comm»ù´¡ÉÏÒýÈëÁËÃÜÔ¿±£»¤»úÖÆ £¬ÒÔ¶Ô¿¹»á»°Ð®ÖÆ¡¢ÖطŹ¥»÷ºÍÖÐÐÄÈ˹¥»÷µÈ  ¡£TIAÓëPLC½»»¥Àú³Ì¿É·ÖΪÒÔÏÂ4¸ö½×¶Î£º


£¨1£©TCP Connection  ¡£

£¨2£©COTP Connection  ¡£

£¨3£©S7Comm-Plus Connection £¬¼´ËÄ´ÎÎÕÊÖÃÜÔ¿ÈÏÖ¤½×¶Î  ¡£

£¨4£©S7Comm-Plus Function £¬¹¦Ð§ÂëÖ´Ðн׶Π ¡£


ÓÅ·¢¹ú¼Ê¡¤ËæÓŶø¶¯Ò»´¥¼´·¢

ͼ1 S7Comm-PlusЭÒé½»»¥Á÷³Ì


ÃÜÔ¿ÈÏÖ¤Àֳɺ󷽿ɽøÈ빦ЧÂëÖ´Ðн׶Π£¬Í¼2ΪËÄ´ÎÎÕÊÖÈÏÖ¤ÏêϸÁ÷³Ì  ¡£


ÓÅ·¢¹ú¼Ê¡¤ËæÓŶø¶¯Ò»´¥¼´·¢

ͼ2 ËÄ´ÎÎÕÊÖÈÏÖ¤


£¨1£©TIAÏòPLC·¢ËÍM1¿ªÆôÒ»¸öеĻỰ  ¡£

£¨2£©PLC½«·µ»Ø¸øTIAÒ»¸öÏìÓ¦°üM2 £¬M2°üÀ¨ PLC¹Ì¼þ°æ±¾ºÍËæ»úÊýServerSessionChallenge £¬³¤¶È20¸ö×Ö½Ú  ¡£


ÓÅ·¢¹ú¼Ê¡¤ËæÓŶø¶¯Ò»´¥¼´·¢

ͼ3 M2ÈÏÖ¤Êý¾Ý°ü


£¨3£©TIAÊÕµ½M2ºó £¬½«ÏòPLC·¢ËÍM3 £¬M3ÖаüÀ¨SecurityKeyEncryptedKey(ͼ4ÖкìÉ«¿òËùʾ)  ¡£ÆäÖÐ £¬Magic×Ö¶ÎΪ0xfee1dead £¬³¤¶È180×Ö½Ú  ¡£SecurityKeyEncryptedKeyÀï°üÀ¨3¸öÒªº¦µÄ¼ÓÃÜ×Ö¶Î(ͼ4ÖÐÀ¶É«¿òËùʾ)  ¡£


ÓÅ·¢¹ú¼Ê¡¤ËæÓŶø¶¯Ò»´¥¼´·¢

ͼ4 M3ÈÏÖ¤Êý¾Ý°ü


£¨4£©PLCÊÕµ½M3ºó £¬¾ÙÐÐÃÜÔ¿ÈÏÖ¤  ¡£ÈôÈÏÖ¤ÀÖ³É £¬ÏòTIA»Ø¸´M4Êý¾Ý°ü  ¡£

ËÄ´ÎÎÕÊÖÈÏÖ¤Íê³Éºó £¬TIAÏòPLC·¢Ë͹¦Ð§ÂëÊý¾Ý°ü £¬¹¦Ð§ÂëÊý¾Ý°üÖаüÀ¨IntergrityPart×ֶΠ£¬Èçͼ5Ëùʾ  ¡£PLCÊÕµ½¹¦Ð§ÂëÊý¾Ý°üºó £¬Ê×ÏÈУÑéIntergrityPart×ֶΠ£¬ÈôУÑéͨ¹ý £¬Ö´ÐÐÏìÓ¦¹¦Ð§Âë  ¡£


ÓÅ·¢¹ú¼Ê¡¤ËæÓŶø¶¯Ò»´¥¼´·¢

ͼ5 stop¹¦Ð§ÂëÊý¾Ý°ü


Ëã·¨ÆÊÎö


ËäÈ»Ö÷»úTIAÓëPLCÖ®¼äµÄÈÏÖ¤ÒýÈëÁ˷ǶԳƼÓÃÜËã·¨ £¬¿ÉÊÇPLCÓëÖ÷»úÖ®¼ä²¢Ã»ÓоÙÐÐ°ó¶¨ £¬Òò´ËÈÔÈ»±£´æÇå¾²ÎÊÌâ £¬¹¥»÷Õß¿ÉÒÔαÔì³ÉÒ»¸ö¶ñÒâµÄÖ÷»ú/ÊÂÇéÕ¾ £¬Ê¹ÓÃÒÑÖªµÄ¹«Ô¿¼°¼ÓÃÜËã·¨ £¬¶ÔPLC¾ÙÐв»·¨¿ØÖÆ»òÕßÖÐÐÄÈ˹¥»÷  ¡£


ÏÂÃæÏÈÈÝÃÜÔ¿ÌìÉúËã·¨Á÷³Ì  ¡£


ÓÅ·¢¹ú¼Ê¡¤ËæÓŶø¶¯Ò»´¥¼´·¢

ͼ6 ÃÜÔ¿ÌìÉúËã·¨


Ö÷»ú(TIA)Ëæ»úÌìÉú20×Ö½ÚµÄPreKey £¬Ê¹ÓÃÀàÍÖÔ²ÇúÏß¼ÓÃÜËã·¨ºÍ¹«Ô¿¼ÓÃÜPreKey £¬×÷ΪKeying materaial 1(¶ÔӦͼ7ÖÐM3Êý¾Ý°üµÄEG1¡¢EG2)  ¡£


Ö÷»ú(TIA)ƾ֤PreKeyÅÌËãKDF £¬²¢ÓɽñÌìÉúCEK(Checksum Encryption Key) £¬CS(Checksum Seed) £¬KEK(Key Encryption Key)  ¡£


Ö÷»ú(TIA)½«ChallengeºÍKDKÏàÍÅ½á £¬Ê¹ÓÃAES-CTR¼ÓÃÜËã·¨ºÍKEK¾ÙÐмÓÃÜ £¬ÆäЧ¹û×÷ΪKeying material 3(¶ÔÓ¦M3Êý¾Ý°üÖеÄEncryptedChallengeºÍEncryptedKDK)  ¡£


Ö÷»ú(TIA)ÓÃCSºÍKeying material 3¾ÙÐйþÏ£ÔËËã(Tabulation Hash),»ñµÃЧ¹ûTB-HASH  ¡£


Ö÷»ú(TIA)ʹÓÃAES-ECBËã·¨ºÍCEKÀ´¼ÓÃÜTB-HASH²¢»ñµÃЧ¹ûKeying material 2(¶ÔÓ¦M3Êý¾Ý°üÖеÄEncryptedChecksum)  ¡£


ÓÅ·¢¹ú¼Ê¡¤ËæÓŶø¶¯Ò»´¥¼´·¢

ͼ7 M3Êý¾Ý°ü½á¹¹


Îó²î¸´ÏÖ


ÎÒÃǶÔOMSp_core_managed.dll¾ÙÐÐÄæÏòÆÊÎö £¬Í¨¹ýŲÓÃÒªº¦½Ó¿Úº¯Êý £¬½á¹¹ËÄ´ÎÎÕÊÖ¼ÓÃÜÈÏÖ¤Êý¾Ý°ü  ¡£¹¥»÷¶ËÊ×ÏÈ·¢ËÍÈÏÖ¤Êý¾Ý°ü £¬ÃÜÔ¿ÈÏÖ¤Íê³Éºó·¢ËÍstop¹¦Ð§Âë £¬ÀÖ³ÉʹµÃÎ÷ÃÅ×ÓPLC S7-1500×èÖ¹ÔËÐÐ  ¡£


Õý³£ÔËÐÐʱ £¬PLC S7-1500ÔËÐÐָʾµÆΪÂÌÉ«  ¡£ÔËÐÐ״̬Èçͼ£¸Ëùʾ  ¡£


ÓÅ·¢¹ú¼Ê¡¤ËæÓŶø¶¯Ò»´¥¼´·¢

ͼ£¸ ¹¥»÷Ç°PLCÕý³£ÔËÐÐ


·¢Ë͹¥»÷¾ç±¾ºó £¬PLC S7-1500ÔËÐÐָʾµÆ±äΪ»ÆÉ« £¬PLC×èÖ¹ÔËÐÐ £¬PLC״̬Èçͼ£¹Ëùʾ  ¡£


ÓÅ·¢¹ú¼Ê¡¤ËæÓŶø¶¯Ò»´¥¼´·¢

ͼ£¹ ¹¥»÷ºóPLC×èÖ¹ÔËÐÐ


Çå¾²½¨Òé


Î÷ÃÅ×Ó¹Ù·½ÒÑÐû²¼Çå¾²²¹¶  ¡£º


https://cert-portal.siemens.com/productcert/pdf/ssa-232418.pdf

https://cert-portal.siemens.com/productcert/pdf/ssa-273799.pdf


С ½á


ÔÚ±¾´ÎÑо¿ÖÐ £¬ÎÒÃÇÆÊÎöÁËÎ÷ÃÅ×ÓS7ϵÁÐ×îеÄͨѶЭÒéS7Comm-Plus  ¡£ËäÈ»Ö÷»úÓëPLCÖ®¼äµÄͨѶЭÒé½ÓÄÉÁËÇ¿Ê¢µÄ¼ÓÃÜËã·¨ £¬¿ÉÊÇPLC²¢Ã»ÓжÔTIA¾ÙÐÐÈÏÖ¤ £¬Ê¹µÃ¹¥»÷Õß¿ÉÒÔαװ³ÉÒ»¸ö¶ñÒâµÄTIA £¬ÔÚÆäͨѶÀú³ÌÖвåÈëí§ÒâÖ¸Áî £¬ÈçPLCµÄÆôÍ£Ö¸Áî £¬¼´¿ÉµÖ´ïÔ¶³Ì¿ØÖÆPLCµÄЧ¹û  ¡£³ý´ËÖ®Íâ £¬ÏàͬÐͺÅ/¹Ì¼þ°æ±¾µÄPLC £¬Æä˽ԿÍêÈ«Ïàͬ £¬ÕâÒâζ×ÅͬÑùµÄ¹¥»÷ÒªÁìÊÊÓÃÓÚËùÓÐÏàͬµÄPLC  ¡£


²Î¿¼Á´½Ó£º

[1]https://i.blackhat.com/USA-19/Thursday/us-19-Bitan-Rogue7-Rogue-Engineering-Station-Attacks-On-S7-Simatic-PLCs.pdf

[2]https://i.blackhat.com/USA-19/Thursday/us-19-Bitan-Rogue7-Rogue-Engineering-Station-Attacks-On-S7-Simatic-PLCs-wp.pdf

[3]https://www.secshi.com/30290.html