SlideShare une entreprise Scribd logo
1  sur  45
Industrial
protocols
for pentesters
AlexanderTimorin
Dmitry Efanov
Positive Technologies
PHDays III
Who We Are
Timorin Alexander
• Lead specialist of the penetration testing team at Positive
Technologies
• Main interests: penetration testing, SCADA systems,
industrial protocols, password cracking
• atimorin@ptsecurity.ru
Who We Are
Efanov Dmitry
• Lead specialist of the security development team at Positive
Technologies
• Main interests: penetration testing, network protocols and
hex-numbers
• defanov@ptsecurity.ru
ICS
Industrial Control System
ICS in the World
ICS in the World
ICS in the World
What will we talk about ?
• Modbus
• Mystical S7
• Authentication and protection
• PROFINET
Industrial Protocols
• CIP
• BACnet
• CC-Link
• Ethernet/IP
• Modbus
• PROFINET
• S3 / S5 / S7
• DNP3
Old Modbus
• Published by Modicon (now Schneider Electric) in 1979.
• Widely used for connecting industrial electronic devices
• Schneider Electric
• Advanced Micro Controls
• ABB
• Emerson
• Chinese NONAME
• and other vendors
Modbus in XX
Modbus in XXI
Modbus TCP
Standard port – 502/tcp
Modbus request packet:
• No authentication
• No encryption
• No security
Modbus Functions
• Data access
• Read/Write Coils and Registers
• Read/Write File Records
• Diagnostics
• Device Identification
• …
• + User Defined Functions
Modbus Device Identification
Standard Function (opcode 0x2B, subcode 0x0E)
• VendorName
• ProductCode
• MajorMinorRevision
• VendorUrl
• ProductName
• ModelName
• UserApplicationName
Modbus Device Identification
Modbus Tools
• Emulators:
• http://www.modbustools.com/download.asp
• Device Discovery:
• https://code.google.com/p/plcscan/
• https://code.google.com/p/modscan/
• …
• Wireshark
• Python
Modbus Demo
Mystic S7
Standard port – 102/tcp
In Siemens docs – ISO-on-TCP, RFC 1006
S7 Materials
• Exploiting Siemens SIMATIC S7 PLCs (by Dillon Beresford)
http://media.blackhat.com/bh-us-11/Beresford/BH_US11_Beresford_S7_PLCs_Slides.pdf
• Wireshark dissector
http://sourceforge.net/projects/s7commwireshark/
• Libnodave – free communication library
http://sourceforge.net/projects/libnodave/
ISO-on-TCP (RFC 1006)
• Transport layer only
• Require source and destination TSAP (Transport Service
Access Point) for connection
• TSAP (2 bytes)
• Connection type (PG – 0x01, OP– 0x02)
• Rack/Slot ID
What is under ISO-on-TCP?
What is under ISO-on-TCP?
S5 Communication
aka
FETCH / WRITE
aka
Sinec H1
S7 Communication
Another
S7 Communication
S7 Communication
S7 packet:
PDU-types:
• 0x01 – Request
• 0x02 – Acknowledgement
• 0x03 – Response
• 0x07– User Data
What We Can Do
• Read / Write data
• Start / Stop CPU
• Upload / Download Blocks
• List blocks
• Get blocks info
• Read SZL (System Status List)
• Module Identification
• Component Identification
• LED’s status
Device Identification
• PLC scan (https://code.google.com/p/plcscan/)
• For S7-300:
Module : 6ES7 151-8AB01-0AB0 v.2
Basic Hardware : 6ES7 151-8AB01-0AB0 v.2
Basic Firmware : v.3.2.6
PLC Name : SIMATIC 300(Bla_bla_name)
Module Name : IM151-8 PN/DP CPU
Plant ID :
Copyright : Original Siemens Equipment
Module Serial Number : S C-BOUV49xxxxx1
Module Type Name : IM151-8 PN/DP CPU
Memory Card Serial Number : MMC 6CAxxxx0
Module OEM ID :
Module Location :
• For S7-1200:
Module : 6ES7 212-1BD30-0XB0 v.2
Basic Hardware : 6ES7 212-1BD30-0XB0 v.2
Basic Firmware : 6ES7 212-1BD30-0XB0 v.2.2.0
S7-300 Password Protection
Password (8 bytes)
«Encryption»:
S7comm on S7-1200
S7-300 S7-1200
Read/Write Vars + +
Device Identification + +/-
Start/Stop CPU + -
Upload/Download Blocks + -
Blocks Info + -
LED’s status + -
«Another S7 Communication»
Simple S7 packet (connection establishment)
72 01 – S7 data delimiter
TIA Portal Read/Write Protection
PLC read/write password protection for main operations:
CPU start/stop/data change, project upload, firmware
update, etc.
TIA Portal PEData.plf passwords history
Simple SHA-1 passwords:
456e6372797074656450617373776f72[a-f0-9]{240,360}000101000000[a-f0-9]{40}
redbox value: password_length * 2 + 1
S7 Password Hashes Extractor
source: http://code.google.com/p/scada-tools/source/browse/s7_password_hashes_extractor.py
Extracting all password SHA1 hashes from a TIA Portal project file and simple bruteforce
It’s also possible to intercept password hashes when uploading a new project to PLC. It’s easy.
Know-how protection:
• prevent code blocks (OB, FB, FC, DB) from unauthorized access
• base64( sha1(password-in-unicode) )
SCADA <-> PLC S7 Authentication
1. SCADA-> PLC : auth request
2. SCADA <- PLC : challenge
3. SCADA-> PLC : response = HMAC( SHA1(password), challenge )
4. SCADA <- PLC : auth result
Sending an authentication challenge from a PLC to a SCADA workstation
SCADA <-> PLC S7 Authentication
Sending an authentication response from the SCADA workstation to the PLC
SCADA <-> PLC S7 Authentication
• ICS-CERT alert: https://ics-cert.us-cert.gov/alerts/ICS-ALERT-13-016-02
• John the Ripper Jumbo patch:
https://github.com/magnumripper/JohnTheRipper/pull/193
• http://www.digitalbond.com/blog/2013/05/10/john-the-ripper-s7-password-
cracking/
S7 Challenge-Response Extractor
source: http://code.google.com/p/scada-tools/source/browse/s7_brute_offline.py
Extracting challenge-response values from a pcap file and simple bruteforce
pckt_len+14 == 84 and hexlify(r[pckt_indx].load)[14:24] == '7202000f32‘ -> auth ok
pckt_len+14 == 92 and hexlify(r[pckt_indx].load)[14:24] == '7202001732‘ -> auth bad
Other researches/materials:
• Dillon Beresford: http://scadahacker.com/exploits/exploits-dillonbh2011.html
PROFINET Family
2003: IEC 61158, IEC 61784
• PROFINET CBA (Component Based Automation)
• PROFINET IO
PROFINET IO
• Master–slave communications
• RT (~ 10 ms), IRT (~ 1 ms)
• PROFINET PTCP (Precision Time Control Protocol)
• PROFINET DCP (Discovery and Basic Configuration Protocol)
profinet dcp identify response
PROFINET DCP Scanner
Source: http://code.google.com/p/scada-tools/source/browse/profinet_scanner.py
Discovering all SCADA devices (PC, HMI, PLC) in a subnet
PROFINET DCP Scanner
payload = 'fefe05000401000200800004ffff0000'
pp = Ether(type=0x8892, src=src_mac, dst=01:0e:cf:00:00:00)/payload.decode('hex')
fefe 2b: DCP multicast header
05 1b: Identify service
00 1b: Request type
04010002 4b: Xid (request identificator)
0080 2b: Response delay
0004 2b: DCP data length
ffff0000 4b: dcp dataOption(All), Suboption(All)
Also we can:
• change the name of the station
• change IP and gateway
• request network info
• LED flashing: PLC, HMI (is something wrong with PLC or devices ?)
• and much more …
profinet video demo
How to analyze protocols ?
• search-analyze-search-analyze-search …
• Rob Savoye: “Believe it or not, if you stare at the hex dumps
long enough, you start to see the patterns.”
• Rob Savoye: FOSDEM 2009 Reverse Engineering of
Proprietary Protocols, Tools and Techniques:
http://youtu.be/t3s-mG5yUjY
• Netzob: http://www.netzob.org
• Fuzzing
• Wireshark
tcpdump
Python
Scapy
Hex viewer
Outro
• Positive Technologies SCADA analytics:
http://www.ptsecurity.com/download/SCADA_analytics_english.pdf
• Findings
• Recommendations:
• http://scadastrangelove.org
• http://www.scadahacker.com
• http://www.digitalbond.com
• http://ics-cert.us-cert.gov
• Releases:
https://code.google.com/p/scada-tools/
https://code.google.com/p/plcscan/
• Greetz to: SCADASTRANGELOVE TEAM
• QA
• And now …
S7-300. Live Demo
Thanks to all…. To be continued
Alexander Timorin atimorin@ptsecurity.ru
Dmitry Efanov defanov@ptsecurity.ru
Stay in touch and feel free …
Industrial protocols for pentesters

Contenu connexe

Tendances

Programmable Logic Controllers Industrial Control by Khaled Kamel, Eman Kamel...
Programmable Logic Controllers Industrial Control by Khaled Kamel, Eman Kamel...Programmable Logic Controllers Industrial Control by Khaled Kamel, Eman Kamel...
Programmable Logic Controllers Industrial Control by Khaled Kamel, Eman Kamel...
Mahamad Jawhar
 
Pre-Si Verification for Post-Si Validation
Pre-Si Verification for Post-Si ValidationPre-Si Verification for Post-Si Validation
Pre-Si Verification for Post-Si Validation
DVClub
 

Tendances (20)

Using Asterisk and Kamailio for Reliable, Scalable and Secure Communication S...
Using Asterisk and Kamailio for Reliable, Scalable and Secure Communication S...Using Asterisk and Kamailio for Reliable, Scalable and Secure Communication S...
Using Asterisk and Kamailio for Reliable, Scalable and Secure Communication S...
 
I2C-Bus Design and Verification Specs
I2C-Bus Design and Verification SpecsI2C-Bus Design and Verification Specs
I2C-Bus Design and Verification Specs
 
Verification challenges and methodologies - SoC and ASICs
Verification challenges and methodologies - SoC and ASICsVerification challenges and methodologies - SoC and ASICs
Verification challenges and methodologies - SoC and ASICs
 
Programmable Logic Controllers Industrial Control by Khaled Kamel, Eman Kamel...
Programmable Logic Controllers Industrial Control by Khaled Kamel, Eman Kamel...Programmable Logic Controllers Industrial Control by Khaled Kamel, Eman Kamel...
Programmable Logic Controllers Industrial Control by Khaled Kamel, Eman Kamel...
 
PCIe BUS: A State-of-the-Art-Review
PCIe BUS: A State-of-the-Art-ReviewPCIe BUS: A State-of-the-Art-Review
PCIe BUS: A State-of-the-Art-Review
 
Siprotec 5 v7.9 v8.0 DigitalTwin
Siprotec 5 v7.9 v8.0  DigitalTwinSiprotec 5 v7.9 v8.0  DigitalTwin
Siprotec 5 v7.9 v8.0 DigitalTwin
 
FireSIGHT Management Center (FMC) slides
FireSIGHT Management Center (FMC) slidesFireSIGHT Management Center (FMC) slides
FireSIGHT Management Center (FMC) slides
 
SPI Protocol
SPI ProtocolSPI Protocol
SPI Protocol
 
ACI MultiPod Config Guide
ACI MultiPod Config GuideACI MultiPod Config Guide
ACI MultiPod Config Guide
 
Pci express technology 3.0
Pci express technology 3.0Pci express technology 3.0
Pci express technology 3.0
 
High availability deep dive high-end srx series
High availability deep dive high-end srx seriesHigh availability deep dive high-end srx series
High availability deep dive high-end srx series
 
7SJ62 Multifunction Over Current Protection Relay
7SJ62 Multifunction Over Current Protection Relay7SJ62 Multifunction Over Current Protection Relay
7SJ62 Multifunction Over Current Protection Relay
 
Pre-Si Verification for Post-Si Validation
Pre-Si Verification for Post-Si ValidationPre-Si Verification for Post-Si Validation
Pre-Si Verification for Post-Si Validation
 
Spi drivers
Spi driversSpi drivers
Spi drivers
 
Identity management and single sign on - how much flexibility
Identity management and single sign on - how much flexibilityIdentity management and single sign on - how much flexibility
Identity management and single sign on - how much flexibility
 
SIP & TLS - Security in a peer to peer world
SIP & TLS - Security in a peer to peer worldSIP & TLS - Security in a peer to peer world
SIP & TLS - Security in a peer to peer world
 
Embedded linux network device driver development
Embedded linux network device driver developmentEmbedded linux network device driver development
Embedded linux network device driver development
 
PROFIBUS frame analysis - Peter Thomas of Control Specialists
PROFIBUS frame analysis - Peter Thomas of Control SpecialistsPROFIBUS frame analysis - Peter Thomas of Control Specialists
PROFIBUS frame analysis - Peter Thomas of Control Specialists
 
Segment Routing for Dummies
Segment Routing for DummiesSegment Routing for Dummies
Segment Routing for Dummies
 
CommScope RUCKUS ICX Switching Configuration
CommScope RUCKUS ICX Switching ConfigurationCommScope RUCKUS ICX Switching Configuration
CommScope RUCKUS ICX Switching Configuration
 

Similaire à Industrial protocols for pentesters

Industrial protocols for pentesters
Industrial protocols for pentestersIndustrial protocols for pentesters
Industrial protocols for pentesters
Positive Hack Days
 
SCADA Strangelove: Hacking in the Name
SCADA Strangelove: Hacking in the NameSCADA Strangelove: Hacking in the Name
SCADA Strangelove: Hacking in the Name
Positive Hack Days
 
SCADA Strangelove: взлом во имя
SCADA Strangelove: взлом во имяSCADA Strangelove: взлом во имя
SCADA Strangelove: взлом во имя
Ekaterina Melnik
 
Scada Strangelove - 29c3
Scada Strangelove - 29c3Scada Strangelove - 29c3
Scada Strangelove - 29c3
qqlan
 
CONFidence 2015: SCADA and mobile: security assessment of the applications th...
CONFidence 2015: SCADA and mobile: security assessment of the applications th...CONFidence 2015: SCADA and mobile: security assessment of the applications th...
CONFidence 2015: SCADA and mobile: security assessment of the applications th...
PROIDEA
 
SCADA StrangeLove: Too Smart Grid in da Cloud [31c3]
SCADA StrangeLove: Too Smart Grid in da Cloud [31c3]SCADA StrangeLove: Too Smart Grid in da Cloud [31c3]
SCADA StrangeLove: Too Smart Grid in da Cloud [31c3]
qqlan
 
BRKDCT-3144 - Advanced - Troubleshooting Cisco Nexus 7000 Series Switches (20...
BRKDCT-3144 - Advanced - Troubleshooting Cisco Nexus 7000 Series Switches (20...BRKDCT-3144 - Advanced - Troubleshooting Cisco Nexus 7000 Series Switches (20...
BRKDCT-3144 - Advanced - Troubleshooting Cisco Nexus 7000 Series Switches (20...
aaajjj4
 

Similaire à Industrial protocols for pentesters (20)

Industrial protocols for pentesters
Industrial protocols for pentestersIndustrial protocols for pentesters
Industrial protocols for pentesters
 
CONFidence 2014: Alexander Timorin: SCADA deep inside: protocols and security...
CONFidence 2014: Alexander Timorin: SCADA deep inside: protocols and security...CONFidence 2014: Alexander Timorin: SCADA deep inside: protocols and security...
CONFidence 2014: Alexander Timorin: SCADA deep inside: protocols and security...
 
SCADA Strangelove: Hacking in the Name
SCADA Strangelove: Hacking in the NameSCADA Strangelove: Hacking in the Name
SCADA Strangelove: Hacking in the Name
 
SCADA Strangelove: взлом во имя
SCADA Strangelove: взлом во имяSCADA Strangelove: взлом во имя
SCADA Strangelove: взлом во имя
 
Attacking SCADA systems: Story Of SCADASTRANGELOVE
Attacking SCADA systems: Story Of SCADASTRANGELOVEAttacking SCADA systems: Story Of SCADASTRANGELOVE
Attacking SCADA systems: Story Of SCADASTRANGELOVE
 
Safety vs Security: How to Create Insecure Safety-Critical System
Safety vs Security: How to Create Insecure Safety-Critical SystemSafety vs Security: How to Create Insecure Safety-Critical System
Safety vs Security: How to Create Insecure Safety-Critical System
 
Securing your supply chain from counterfeit parts through real time electroni...
Securing your supply chain from counterfeit parts through real time electroni...Securing your supply chain from counterfeit parts through real time electroni...
Securing your supply chain from counterfeit parts through real time electroni...
 
OT Security - h-c0n 2020
OT Security - h-c0n 2020OT Security - h-c0n 2020
OT Security - h-c0n 2020
 
Man in the middle attacks on IEC 60870-5-104
Man in the middle attacks on IEC 60870-5-104Man in the middle attacks on IEC 60870-5-104
Man in the middle attacks on IEC 60870-5-104
 
S4x19 Stage 2 Making Power System Cybersecurity Part of the Engineering Process
S4x19 Stage 2 Making Power System Cybersecurity Part of the Engineering ProcessS4x19 Stage 2 Making Power System Cybersecurity Part of the Engineering Process
S4x19 Stage 2 Making Power System Cybersecurity Part of the Engineering Process
 
Scada Strangelove - 29c3
Scada Strangelove - 29c3Scada Strangelove - 29c3
Scada Strangelove - 29c3
 
CONFidence 2015: SCADA and mobile: security assessment of the applications th...
CONFidence 2015: SCADA and mobile: security assessment of the applications th...CONFidence 2015: SCADA and mobile: security assessment of the applications th...
CONFidence 2015: SCADA and mobile: security assessment of the applications th...
 
Shameful Secrets of Proprietary Network Protocols - OWASP AppSec EU 2014
Shameful Secrets of Proprietary Network Protocols - OWASP AppSec EU 2014Shameful Secrets of Proprietary Network Protocols - OWASP AppSec EU 2014
Shameful Secrets of Proprietary Network Protocols - OWASP AppSec EU 2014
 
Confidence 2017: SCADA and mobile in the IoT times (Ivan Yushkievich, Alexand...
Confidence 2017: SCADA and mobile in the IoT times (Ivan Yushkievich, Alexand...Confidence 2017: SCADA and mobile in the IoT times (Ivan Yushkievich, Alexand...
Confidence 2017: SCADA and mobile in the IoT times (Ivan Yushkievich, Alexand...
 
CONFidence 2014: Jakub Kałużny: Shameful secrets of proprietary protocols
CONFidence 2014: Jakub Kałużny: Shameful secrets of proprietary protocolsCONFidence 2014: Jakub Kałużny: Shameful secrets of proprietary protocols
CONFidence 2014: Jakub Kałużny: Shameful secrets of proprietary protocols
 
SCADA StrangeLove: Too Smart Grid in da Cloud [31c3]
SCADA StrangeLove: Too Smart Grid in da Cloud [31c3]SCADA StrangeLove: Too Smart Grid in da Cloud [31c3]
SCADA StrangeLove: Too Smart Grid in da Cloud [31c3]
 
BSides London 2015 - Proprietary network protocols - risky business on the wire.
BSides London 2015 - Proprietary network protocols - risky business on the wire.BSides London 2015 - Proprietary network protocols - risky business on the wire.
BSides London 2015 - Proprietary network protocols - risky business on the wire.
 
BRKDCT-3144 - Advanced - Troubleshooting Cisco Nexus 7000 Series Switches (20...
BRKDCT-3144 - Advanced - Troubleshooting Cisco Nexus 7000 Series Switches (20...BRKDCT-3144 - Advanced - Troubleshooting Cisco Nexus 7000 Series Switches (20...
BRKDCT-3144 - Advanced - Troubleshooting Cisco Nexus 7000 Series Switches (20...
 
Cisco IOS shellcode: All-in-one
Cisco IOS shellcode: All-in-oneCisco IOS shellcode: All-in-one
Cisco IOS shellcode: All-in-one
 
Labs_BT_20221017.pptx
Labs_BT_20221017.pptxLabs_BT_20221017.pptx
Labs_BT_20221017.pptx
 

Plus de Positive Hack Days

Мастер-класс «Трущобы Application Security»
Мастер-класс «Трущобы Application Security»Мастер-класс «Трущобы Application Security»
Мастер-класс «Трущобы Application Security»
Positive Hack Days
 
Эвристические методы защиты приложений
Эвристические методы защиты приложенийЭвристические методы защиты приложений
Эвристические методы защиты приложений
Positive Hack Days
 
Уязвимое Android-приложение: N проверенных способов наступить на грабли
Уязвимое Android-приложение: N проверенных способов наступить на граблиУязвимое Android-приложение: N проверенных способов наступить на грабли
Уязвимое Android-приложение: N проверенных способов наступить на грабли
Positive Hack Days
 
Механизмы предотвращения атак в ASP.NET Core
Механизмы предотвращения атак в ASP.NET CoreМеханизмы предотвращения атак в ASP.NET Core
Механизмы предотвращения атак в ASP.NET Core
Positive Hack Days
 

Plus de Positive Hack Days (20)

Инструмент ChangelogBuilder для автоматической подготовки Release Notes
Инструмент ChangelogBuilder для автоматической подготовки Release NotesИнструмент ChangelogBuilder для автоматической подготовки Release Notes
Инструмент ChangelogBuilder для автоматической подготовки Release Notes
 
Как мы собираем проекты в выделенном окружении в Windows Docker
Как мы собираем проекты в выделенном окружении в Windows DockerКак мы собираем проекты в выделенном окружении в Windows Docker
Как мы собираем проекты в выделенном окружении в Windows Docker
 
Типовая сборка и деплой продуктов в Positive Technologies
Типовая сборка и деплой продуктов в Positive TechnologiesТиповая сборка и деплой продуктов в Positive Technologies
Типовая сборка и деплой продуктов в Positive Technologies
 
Аналитика в проектах: TFS + Qlik
Аналитика в проектах: TFS + QlikАналитика в проектах: TFS + Qlik
Аналитика в проектах: TFS + Qlik
 
Использование анализатора кода SonarQube
Использование анализатора кода SonarQubeИспользование анализатора кода SonarQube
Использование анализатора кода SonarQube
 
Развитие сообщества Open DevOps Community
Развитие сообщества Open DevOps CommunityРазвитие сообщества Open DevOps Community
Развитие сообщества Open DevOps Community
 
Методика определения неиспользуемых ресурсов виртуальных машин и автоматизаци...
Методика определения неиспользуемых ресурсов виртуальных машин и автоматизаци...Методика определения неиспользуемых ресурсов виртуальных машин и автоматизаци...
Методика определения неиспользуемых ресурсов виртуальных машин и автоматизаци...
 
Автоматизация построения правил для Approof
Автоматизация построения правил для ApproofАвтоматизация построения правил для Approof
Автоматизация построения правил для Approof
 
Мастер-класс «Трущобы Application Security»
Мастер-класс «Трущобы Application Security»Мастер-класс «Трущобы Application Security»
Мастер-класс «Трущобы Application Security»
 
Формальные методы защиты приложений
Формальные методы защиты приложенийФормальные методы защиты приложений
Формальные методы защиты приложений
 
Эвристические методы защиты приложений
Эвристические методы защиты приложенийЭвристические методы защиты приложений
Эвристические методы защиты приложений
 
Теоретические основы Application Security
Теоретические основы Application SecurityТеоретические основы Application Security
Теоретические основы Application Security
 
От экспериментального программирования к промышленному: путь длиной в 10 лет
От экспериментального программирования к промышленному: путь длиной в 10 летОт экспериментального программирования к промышленному: путь длиной в 10 лет
От экспериментального программирования к промышленному: путь длиной в 10 лет
 
Уязвимое Android-приложение: N проверенных способов наступить на грабли
Уязвимое Android-приложение: N проверенных способов наступить на граблиУязвимое Android-приложение: N проверенных способов наступить на грабли
Уязвимое Android-приложение: N проверенных способов наступить на грабли
 
Требования по безопасности в архитектуре ПО
Требования по безопасности в архитектуре ПОТребования по безопасности в архитектуре ПО
Требования по безопасности в архитектуре ПО
 
Формальная верификация кода на языке Си
Формальная верификация кода на языке СиФормальная верификация кода на языке Си
Формальная верификация кода на языке Си
 
Механизмы предотвращения атак в ASP.NET Core
Механизмы предотвращения атак в ASP.NET CoreМеханизмы предотвращения атак в ASP.NET Core
Механизмы предотвращения атак в ASP.NET Core
 
SOC для КИИ: израильский опыт
SOC для КИИ: израильский опытSOC для КИИ: израильский опыт
SOC для КИИ: израильский опыт
 
Honeywell Industrial Cyber Security Lab & Services Center
Honeywell Industrial Cyber Security Lab & Services CenterHoneywell Industrial Cyber Security Lab & Services Center
Honeywell Industrial Cyber Security Lab & Services Center
 
Credential stuffing и брутфорс-атаки
Credential stuffing и брутфорс-атакиCredential stuffing и брутфорс-атаки
Credential stuffing и брутфорс-атаки
 

Dernier

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Dernier (20)

EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 

Industrial protocols for pentesters

  • 2. Who We Are Timorin Alexander • Lead specialist of the penetration testing team at Positive Technologies • Main interests: penetration testing, SCADA systems, industrial protocols, password cracking • atimorin@ptsecurity.ru
  • 3. Who We Are Efanov Dmitry • Lead specialist of the security development team at Positive Technologies • Main interests: penetration testing, network protocols and hex-numbers • defanov@ptsecurity.ru
  • 5. ICS in the World
  • 6. ICS in the World
  • 7. ICS in the World
  • 8. What will we talk about ? • Modbus • Mystical S7 • Authentication and protection • PROFINET
  • 9. Industrial Protocols • CIP • BACnet • CC-Link • Ethernet/IP • Modbus • PROFINET • S3 / S5 / S7 • DNP3
  • 10. Old Modbus • Published by Modicon (now Schneider Electric) in 1979. • Widely used for connecting industrial electronic devices • Schneider Electric • Advanced Micro Controls • ABB • Emerson • Chinese NONAME • and other vendors
  • 13. Modbus TCP Standard port – 502/tcp Modbus request packet: • No authentication • No encryption • No security
  • 14. Modbus Functions • Data access • Read/Write Coils and Registers • Read/Write File Records • Diagnostics • Device Identification • … • + User Defined Functions
  • 15. Modbus Device Identification Standard Function (opcode 0x2B, subcode 0x0E) • VendorName • ProductCode • MajorMinorRevision • VendorUrl • ProductName • ModelName • UserApplicationName
  • 17. Modbus Tools • Emulators: • http://www.modbustools.com/download.asp • Device Discovery: • https://code.google.com/p/plcscan/ • https://code.google.com/p/modscan/ • … • Wireshark • Python
  • 19. Mystic S7 Standard port – 102/tcp In Siemens docs – ISO-on-TCP, RFC 1006
  • 20. S7 Materials • Exploiting Siemens SIMATIC S7 PLCs (by Dillon Beresford) http://media.blackhat.com/bh-us-11/Beresford/BH_US11_Beresford_S7_PLCs_Slides.pdf • Wireshark dissector http://sourceforge.net/projects/s7commwireshark/ • Libnodave – free communication library http://sourceforge.net/projects/libnodave/
  • 21. ISO-on-TCP (RFC 1006) • Transport layer only • Require source and destination TSAP (Transport Service Access Point) for connection • TSAP (2 bytes) • Connection type (PG – 0x01, OP– 0x02) • Rack/Slot ID
  • 22. What is under ISO-on-TCP?
  • 23. What is under ISO-on-TCP? S5 Communication aka FETCH / WRITE aka Sinec H1 S7 Communication Another S7 Communication
  • 24. S7 Communication S7 packet: PDU-types: • 0x01 – Request • 0x02 – Acknowledgement • 0x03 – Response • 0x07– User Data
  • 25. What We Can Do • Read / Write data • Start / Stop CPU • Upload / Download Blocks • List blocks • Get blocks info • Read SZL (System Status List) • Module Identification • Component Identification • LED’s status
  • 26. Device Identification • PLC scan (https://code.google.com/p/plcscan/) • For S7-300: Module : 6ES7 151-8AB01-0AB0 v.2 Basic Hardware : 6ES7 151-8AB01-0AB0 v.2 Basic Firmware : v.3.2.6 PLC Name : SIMATIC 300(Bla_bla_name) Module Name : IM151-8 PN/DP CPU Plant ID : Copyright : Original Siemens Equipment Module Serial Number : S C-BOUV49xxxxx1 Module Type Name : IM151-8 PN/DP CPU Memory Card Serial Number : MMC 6CAxxxx0 Module OEM ID : Module Location : • For S7-1200: Module : 6ES7 212-1BD30-0XB0 v.2 Basic Hardware : 6ES7 212-1BD30-0XB0 v.2 Basic Firmware : 6ES7 212-1BD30-0XB0 v.2.2.0
  • 27. S7-300 Password Protection Password (8 bytes) «Encryption»:
  • 28. S7comm on S7-1200 S7-300 S7-1200 Read/Write Vars + + Device Identification + +/- Start/Stop CPU + - Upload/Download Blocks + - Blocks Info + - LED’s status + -
  • 29. «Another S7 Communication» Simple S7 packet (connection establishment) 72 01 – S7 data delimiter
  • 30. TIA Portal Read/Write Protection PLC read/write password protection for main operations: CPU start/stop/data change, project upload, firmware update, etc.
  • 31. TIA Portal PEData.plf passwords history Simple SHA-1 passwords: 456e6372797074656450617373776f72[a-f0-9]{240,360}000101000000[a-f0-9]{40} redbox value: password_length * 2 + 1
  • 32. S7 Password Hashes Extractor source: http://code.google.com/p/scada-tools/source/browse/s7_password_hashes_extractor.py Extracting all password SHA1 hashes from a TIA Portal project file and simple bruteforce It’s also possible to intercept password hashes when uploading a new project to PLC. It’s easy. Know-how protection: • prevent code blocks (OB, FB, FC, DB) from unauthorized access • base64( sha1(password-in-unicode) )
  • 33. SCADA <-> PLC S7 Authentication 1. SCADA-> PLC : auth request 2. SCADA <- PLC : challenge 3. SCADA-> PLC : response = HMAC( SHA1(password), challenge ) 4. SCADA <- PLC : auth result Sending an authentication challenge from a PLC to a SCADA workstation
  • 34. SCADA <-> PLC S7 Authentication Sending an authentication response from the SCADA workstation to the PLC
  • 35. SCADA <-> PLC S7 Authentication • ICS-CERT alert: https://ics-cert.us-cert.gov/alerts/ICS-ALERT-13-016-02 • John the Ripper Jumbo patch: https://github.com/magnumripper/JohnTheRipper/pull/193 • http://www.digitalbond.com/blog/2013/05/10/john-the-ripper-s7-password- cracking/
  • 36. S7 Challenge-Response Extractor source: http://code.google.com/p/scada-tools/source/browse/s7_brute_offline.py Extracting challenge-response values from a pcap file and simple bruteforce pckt_len+14 == 84 and hexlify(r[pckt_indx].load)[14:24] == '7202000f32‘ -> auth ok pckt_len+14 == 92 and hexlify(r[pckt_indx].load)[14:24] == '7202001732‘ -> auth bad Other researches/materials: • Dillon Beresford: http://scadahacker.com/exploits/exploits-dillonbh2011.html
  • 37. PROFINET Family 2003: IEC 61158, IEC 61784 • PROFINET CBA (Component Based Automation) • PROFINET IO
  • 38. PROFINET IO • Master–slave communications • RT (~ 10 ms), IRT (~ 1 ms) • PROFINET PTCP (Precision Time Control Protocol) • PROFINET DCP (Discovery and Basic Configuration Protocol) profinet dcp identify response
  • 39. PROFINET DCP Scanner Source: http://code.google.com/p/scada-tools/source/browse/profinet_scanner.py Discovering all SCADA devices (PC, HMI, PLC) in a subnet
  • 40. PROFINET DCP Scanner payload = 'fefe05000401000200800004ffff0000' pp = Ether(type=0x8892, src=src_mac, dst=01:0e:cf:00:00:00)/payload.decode('hex') fefe 2b: DCP multicast header 05 1b: Identify service 00 1b: Request type 04010002 4b: Xid (request identificator) 0080 2b: Response delay 0004 2b: DCP data length ffff0000 4b: dcp dataOption(All), Suboption(All) Also we can: • change the name of the station • change IP and gateway • request network info • LED flashing: PLC, HMI (is something wrong with PLC or devices ?) • and much more … profinet video demo
  • 41. How to analyze protocols ? • search-analyze-search-analyze-search … • Rob Savoye: “Believe it or not, if you stare at the hex dumps long enough, you start to see the patterns.” • Rob Savoye: FOSDEM 2009 Reverse Engineering of Proprietary Protocols, Tools and Techniques: http://youtu.be/t3s-mG5yUjY • Netzob: http://www.netzob.org • Fuzzing • Wireshark tcpdump Python Scapy Hex viewer
  • 42. Outro • Positive Technologies SCADA analytics: http://www.ptsecurity.com/download/SCADA_analytics_english.pdf • Findings • Recommendations: • http://scadastrangelove.org • http://www.scadahacker.com • http://www.digitalbond.com • http://ics-cert.us-cert.gov • Releases: https://code.google.com/p/scada-tools/ https://code.google.com/p/plcscan/ • Greetz to: SCADASTRANGELOVE TEAM • QA • And now …
  • 44. Thanks to all…. To be continued Alexander Timorin atimorin@ptsecurity.ru Dmitry Efanov defanov@ptsecurity.ru Stay in touch and feel free …