Î÷ÃÅ×Ó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