SlideShare a Scribd company logo
All pictures are taken from
Dr StrangeLove movie

by Gleb Gritsai (as Alexander Timorin)
and Alexander Tlyapov


Group of security researchers focused on ICS/SCADA

to save Humanity from industrial disaster and to
keep Purity Of Essence
Sergey Gordeychik
Roman Ilin
Artem Chaykin
Dmitry Efanov
Andrey Medov
Alexander Zaitsev
Dmitry Sklyarov
Roman Ilin
Kirill Nesterov

Gleb Gritsai
Ilya Karpov
Yuriy Dyachenko
Yuri Goltsev
Sergey Scherbel
Dmitry Serebryannikov
Alexander Timorin
Alexander Tlyapov

Denis Baranov
Sergey Bobrov
Sergey Drozdov
Vladimir Kochetkov
Timur Yunusov
Dmitry Nagibin
Vyacheslav Egoshin
Evgeny Ermakov


Gleb Gritsai
Penetration tester @ptsecurity
 ICS researcher and expert
 Member of @scadasl




Alexander Tlyapov




Reverse engineer @ptsecurity
ICS researcher
Member of @scadasl


ICS 101




Industrial protocols (Gleb Gritsai)





This 101 is useless
Functions and weakness of protocols
Penetration tester’s view

WinCC architecture (Alexander Tlyapov)




Internal protocols
Authorization process
And how no to pay attention and get to serious stuff
Alexander Timorin, Alexander Tlyapov - SCADA deep inside protocols, security mechanisms, software architecture


HMI




PLC




Programmable Logic Controller

RTU




Human Machine Interface

Remote Telemetry Unit

IED, SCADA,
DSC, Sensor,
Actuator, …


Movinged from Serial to Ethernet




Actually five senses of ICS by







Sometimes to Radio (GSM, ZigBee, WiFi, etc)

Controlling physical processes
Delivering feedback

Available starting from OSI/ISO layer 3
Industry and application specific

Delivering real time data from sensor or configuring
network settings of PLC or reflashing RTU
 Operating in one subnet or providing remote telemetry
and supervisory




Developed without security in mind and in coders


“Times they are a changin‘”, but slowly


Manufacturing Message Specification
 A protocol, but more a specification for messaging




Originally developed at 1980
“Heavy”
 See MODBUS packet: [gw_unit; function; register; value]



Applications
 IED, PLC, SCADA, RTU



Vendors
 GE, Siemens, Schneider, Daimler, ABB


Domains

 Named memory regions for managing data/code blobs
 Abstraction for devices







Program invocations
Journals
Files (Yes, files)
Named variables and lists (groups of vars)
Events
 State machines for alarms and events





Operators station (HMI)
Init semaphores
 Concurrent access


IEC 62351-4 is security for IEC 61850-8-1
 IEC 61850-8-1 is MMS



Application level
 ACSE AARQ and AARE PDUs






Transport level – TLS (62351-3)
Access Control Lists
Original port 102 to 3782 if secured




Application security is in ACSE layer (i.e. Association
Control Service Element) which is rarely implemented
No password requirements defined for software




Welcome to the “123”

Application security is plain password


Bruteforce
 Just try to keep port alive as no locking exist



Interception
 Simple ARP spoofing is still a kill switch for ICS networks (do
this in labs or disconnected SCADAs if you care)


Access must be defined to every object
(according to standard)





Kind of: read, write, delete
Optional

TLS, srsly?



No options to set it up seen in products
Not supported (not even with stubs in code)


Discovery & Fingerprint
 Port 102 is also S7 and … - COTP (Connection Oriented
Transport Protocol) & TPKT (Transport packet)
 “Identify” request for Vendor, Model and Version



Enumeration of objects
 Enumerate everything: Domains, Variables, Files, etc
 Good thing – named variables (no need for db with
tags/registers/etc description) for understanding logic
 Domains: IEDInverter, IEDBattery, IEDPhysical_Measurements
 Variables for IEDBattery: ZBAT1$MX$Vol, ZBAT1$MX$Amp,
ZBAT1$ST$Health
 Better than WriteCoil(coil=X, value=Y)


Open source libs - easy to extract API for better
code coverage while fuzzing PLCs, IEDs, RTUs, …




Ain’t it fun fuzzing embedded devices

Lot’s of open source libs, single DLL APIs and
simulators


libiec61850 is C and free
 http://libiec61850.com



openmuc is java and free
 http://openmuc.org/



Smartgridware and others non free, but trial
 http://www.smartgridware.com/
 http://nettedautomation.com/iec61850li/dll/index.html




Is actually IEC 61870-5-104
Master, Slave, Master-Slave
No security mechanisms in standard and in
implementations




Extensible and vice versa by design




Vendors publish checklists with supported functions

Mainly for gathering telemetry in electricity
distribution and power system automation




Except the IP addresses of Masters defined on Slaves

interrogations

Can feature control functions


write, command, execute


Discovery
TCP port 2404
 Application level ASDU broadcast address


 As soon as RTU receives broadcast to enumerate IEC

104 endpoints it sends broadcast itself
 If there is an RTU nearby you’ll get infinite broadcast
 BCR (Binary Counter Reading) hack with frozen binary
counter can mitigate this
 Do it at home unless … don’t do it


Reading data




Writing data




Done by interrogations which provides set of
controlled data
Inspect vendor document on supported protocol
features

Simulators, libraries and fingerprint tool
 https://github.com/atimorin/PoC2013/blob/master/i

ec-60870-5-104/iec-60870-5-104.py
 https://code.google.com/p/mrts-ng/
 https://code.google.com/p/sim104/
IEC 104 travels
over dedicated
network

Remote Control

IEC 104



Power plant 1

Power plant 2

Power Plant N




IEC 104 flows through
RTU to SCADA Server
SCADA Server
reads/writes data
as requested

Power plant 1

FW: IEC 104 port opened
RTU

FW: IEC 104 port opened

SCADA Server
Open/Close
the Door
PLC
Remote Control

IEC 104, SMB,
HTTP, etc

corp.company.loc

Power plant 1

Power plant 2

Power Plant N

office.pp1.company.loc

office.pp2.company.loc

office.ppN.company.loc


corp.company.loc

Now this does
look like
typical pentest

Remote Control

IEC 104, SMB,
HTTP, etc

Internets

E-mail
Sharepoint
Remote applications
Web sites

Power plant 1

Power plant 2

Power Plant N

office.pp1.company.loc

office.pp2.company.loc

office.ppN.company.loc


corp.company.loc

Now this does
look like one of the
pentest attack
vectors

Remote Control

IEC 104, SMB,
HTTP, etc

Internets

E-mail
Sharepoint
Remote applications
Web sites

Power plant 1

Power plant 2

Power Plant N

office.pp1.company.loc

office.pp2.company.loc

office.ppN.company.loc





Internal protocols
Authorization process
And how no to pay attention and get to serious
stuff
WinCC
Web-Client

Internet,
corp lan,
vpn’s

WinCC
DataMonitor

Some
networks
WinCC
SCADA-Clients

LAN

WinCC
Web-Client

WinCC
SCADA-Client
+Web-Server

WinCC
Servers

Engineering station
(TIA portal/PCS7)

PROFINET

PROFIBUS

PLC1

PLC2

WinCC
DataMonitor

PLC3
ActiveX components
for communication
and rendering of
HMI

Another component
of WinCC.
For example,
forwarding
commands to the
PLC via the S7
protocol

IIS extension
SCSWebBridgex.dll
Manages SCS
connection and
converts data to PAL

CCEServer.exe
Yep-Yep, again)

CCEServer.exe
WinCC core:
Manages requests of
components

WebNavigatorRT.exe
Rendering HMI and
command
transmission
•
•
•
•

The POST requests from the client contains the binary data of SCS
protocol
Basic-authorization
Authorization is “two-stage” (we’ll cover this later)
For the real identification of client a specially “generated” ID is
used




SQL query to database (using COM objects)
Verification "special" Windows User
The "hardcode" and etc.

For successful authentication any path will do
Alexander Timorin, Alexander Tlyapov - SCADA deep inside protocols, security mechanisms, software architecture
Authentication of
user in the database
through the COM
object on the server

Getting ServerID
and the “magic”
activity for the
password to
WebBridge

Using received
"magic" password to
work with
SCSWebBridgeX
Oh! En/c(r)ypt[10]n!

ServerID = Base64(RC2(pass, key)), where key
= MD5(dll hardcode)
And forget that before
we entered a another
password...

Not my department password!
Sql injection in Basic-authorization.
It is too hard for me.
Passwords in database is
not plaintext…
CVE-2013-0676
But, it’s just XOR with very secret string.

CVE-2013-0678
This is my
encryptionkey
So, we have another way to get ServerID and later access
SCSWebBridgex.dll
Still not quite ...






"Magic" password = MD5(WNUSR_DC92D7179E29.WinPassword)
Stored in the registry and encrypted with DPAPI. But with no luck.
Wrong flag allows any users (including Guest) on this host to get
password for special Siemens user. BTW, this user is local admin.

Password generation features very good charset, but chars used
uniquely and length is 12 to 14 chars which is not making cracking
MD5 harder




All further communications authorized with
this password
For dispatching requests a special ID is used
that is generated ... in some weird and funny
way
Offset

Description

Size

0

AlwaysNULL

4

4

dwCode

4

8

Unknown

4

12

DataLen

4

16

ID

4

20

DataChunkNum

4

24

CRC

4

28

ChuckLen

4

32

DataChunkStart

…
Transmitted ID represents index and identifier in
the pool of objects which is responsible for storing
the data and dispatching requests

Offset

Description

Size

0

PoolID

2

2

PoolIndex

2
Alexander Timorin, Alexander Tlyapov - SCADA deep inside protocols, security mechanisms, software architecture
HMI

Other
components

CCEServer

PLC
Communication

License
server

To start communication components must call CAL_StartListen in the service
CCEServer. This function is passing all the necessary information about the
component. Such as:
• Component’s GUID
• His PID
• Required callbacks
• Etc


During initial communications SCS packet is transmitted with GUID
describing target component






According to received identifier component's object is looked up

Further communication occurs in the context of an established
connection, through a protocol called CAL
The mechanism of data transmission in the CAL protocol is
based on a global MappedSections
Alexander Timorin, Alexander Tlyapov - SCADA deep inside protocols, security mechanisms, software architecture
For sending data:
Section = ("GlobalSCS%08X%04X%04X%04XSAM", PID, SomeW, MapKey, Null);
ReadyEvent = ("GlobalSCS%08X%04X%04X%04XSAN", PID, SomeW, MapKey, Null);

SendEvent = ("GlobalSCS%08X%04X%04X%04XSAF", PID, SomeW, MapKey, Null);
For receiving data:
Section = ("GlobalSCS%08X%04X%04X%04XASM", PID, SomeW, MapKey, Null);

ReadyEvent = ("GlobalSCS%08X%04X%04X%04XASN", PID, SomeW, MapKey, Null);
ReciveEvent = ("GlobalSCS%08X%04X%04X%04XASF", PID, SomeW, MapKey, Null);


SQLi for retrieving HMI user passwords from db
 And XOR decryption tool








Hardcoded credentials for retrieving ServerID
Crack ServerID for Siemens windows user
Use ServerID for communication WebBridge
Session hijacking for privilege escalation on HMI
Exploiting architecture weakness to use arbitrary
components of WinCC (like PLC comms)
Contact despair:
Gleb Gritsai
ggritsai@ptsecurity.com
@repdet

Alexander Tlyapov
atlyapov@ptsecurity.com
@Rigros1

More Related Content

What's hot (20)

PPTX
Web html table tags
Kainat Ilyas
 
PPT
ASP.NET 10 - Data Controls
Randy Connolly
 
PPTX
Client side scripting and server side scripting
baabtra.com - No. 1 supplier of quality freshers
 
PPTX
[MeetUp][3rd] Prometheus 와 함께하는 모니터링 및 시각화
InfraEngineer
 
PPTX
Domain Driven Design 101
Richard Dingwall
 
PPTX
Web forms in ASP.net
Madhuri Kavade
 
PPTX
Web Server - Internet Applications
sandra sukarieh
 
PDF
JavaScript - Chapter 3 - Introduction
WebStackAcademy
 
DOCX
Lab manual asp.net
Vivek Kumar Sinha
 
PPTX
Android Application Component: BroadcastReceiver Tutorial
Ahsanul Karim
 
PPT
Introduction to JavaScript (1).ppt
MuhammadRehan856177
 
PDF
CSS3 Media Queries
Russ Weakley
 
PPT
Web Publishing: An Overview of Tools and Service
kilmeny21
 
PDF
Understanding Sling Models in AEM
Accunity Software
 
PPT
Jndi
Tulika Singh
 
PDF
Spring MVC Framework
Hùng Nguyễn Huy
 
PPTX
Javascript event handler
Jesus Obenita Jr.
 
PPTX
Recycler view
Sudhanshu Vohra
 
PDF
Package Diagram
University of Texas at Dallas
 
Web html table tags
Kainat Ilyas
 
ASP.NET 10 - Data Controls
Randy Connolly
 
Client side scripting and server side scripting
baabtra.com - No. 1 supplier of quality freshers
 
[MeetUp][3rd] Prometheus 와 함께하는 모니터링 및 시각화
InfraEngineer
 
Domain Driven Design 101
Richard Dingwall
 
Web forms in ASP.net
Madhuri Kavade
 
Web Server - Internet Applications
sandra sukarieh
 
JavaScript - Chapter 3 - Introduction
WebStackAcademy
 
Lab manual asp.net
Vivek Kumar Sinha
 
Android Application Component: BroadcastReceiver Tutorial
Ahsanul Karim
 
Introduction to JavaScript (1).ppt
MuhammadRehan856177
 
CSS3 Media Queries
Russ Weakley
 
Web Publishing: An Overview of Tools and Service
kilmeny21
 
Understanding Sling Models in AEM
Accunity Software
 
Spring MVC Framework
Hùng Nguyễn Huy
 
Javascript event handler
Jesus Obenita Jr.
 
Recycler view
Sudhanshu Vohra
 

Viewers also liked (6)

PPTX
Cybersecurity of SmartGrid by Sergey Gordeychik & Alexander Timorin - CODE BL...
CODE BLUE
 
PDF
SCADA deep inside: protocols and security mechanisms
Aleksandr Timorin
 
PPTX
Alexander Timorin, Dmitry Efanov. Industrial protocols for pentesters
Positive Hack Days
 
PDF
Scada Strangelove - 29c3
qqlan
 
PPTX
Attacking SCADA systems: Story Of SCADASTRANGELOVE
Aleksandr Timorin
 
PDF
SCADA deep inside:protocols and software architecture
qqlan
 
Cybersecurity of SmartGrid by Sergey Gordeychik & Alexander Timorin - CODE BL...
CODE BLUE
 
SCADA deep inside: protocols and security mechanisms
Aleksandr Timorin
 
Alexander Timorin, Dmitry Efanov. Industrial protocols for pentesters
Positive Hack Days
 
Scada Strangelove - 29c3
qqlan
 
Attacking SCADA systems: Story Of SCADASTRANGELOVE
Aleksandr Timorin
 
SCADA deep inside:protocols and software architecture
qqlan
 
Ad

Similar to Alexander Timorin, Alexander Tlyapov - SCADA deep inside protocols, security mechanisms, software architecture (20)

PPTX
ICS Security 101 by Sandeep Singh
OWASP Delhi
 
PPTX
Safety vs Security: How to Create Insecure Safety-Critical System
Aleksandr Timorin
 
PDF
Man in the middle attacks on IEC 60870-5-104
pgmaynard
 
PDF
SCADA StrangeLove 2: We already know
qqlan
 
PDF
Introduction to Industrial Control Systems : Pentesting PLCs 101 (BlackHat Eu...
arnaudsoullie
 
PPTX
Recon: Hopeless relay protection for substation automation
Sergey Gordeychik
 
PDF
Techniques of attacking ICS systems
qqlan
 
PDF
IEEE Standard for Securing Legacy Scada Protocols (Sequi, Inc)
sequi_inc
 
PDF
BruCON 2015 - Pentesting ICS 101
Wavestone
 
PDF
Project Basecamp: News From Camp 4
Digital Bond
 
PPTX
SCADA Strangelove: Hacking in the Name
Positive Hack Days
 
PPTX
SCADA Strangelove: взлом во имя
Ekaterina Melnik
 
PPTX
CONFidence 2015: SCADA and mobile: security assessment of the applications th...
PROIDEA
 
PDF
Industrial Control Systems Security - A Perspective on Product Design (Sequi,...
sequi_inc
 
PDF
Positive Technologies - S4 - Scada under x-rays
qqlan
 
PPTX
Scada strange love.
Positive Hack Days
 
PPTX
Scada strange love uwn-stuxnet
Positive Hack Days
 
PDF
CONFidence 2014: Alexander Timorin: SCADA deep inside: protocols and security...
PROIDEA
 
PDF
Taking a closer look at level 0 and level 1 security
Matt Loong
 
PPT
Power Grid Communications & Control Systems
fajjarrehman
 
ICS Security 101 by Sandeep Singh
OWASP Delhi
 
Safety vs Security: How to Create Insecure Safety-Critical System
Aleksandr Timorin
 
Man in the middle attacks on IEC 60870-5-104
pgmaynard
 
SCADA StrangeLove 2: We already know
qqlan
 
Introduction to Industrial Control Systems : Pentesting PLCs 101 (BlackHat Eu...
arnaudsoullie
 
Recon: Hopeless relay protection for substation automation
Sergey Gordeychik
 
Techniques of attacking ICS systems
qqlan
 
IEEE Standard for Securing Legacy Scada Protocols (Sequi, Inc)
sequi_inc
 
BruCON 2015 - Pentesting ICS 101
Wavestone
 
Project Basecamp: News From Camp 4
Digital Bond
 
SCADA Strangelove: Hacking in the Name
Positive Hack Days
 
SCADA Strangelove: взлом во имя
Ekaterina Melnik
 
CONFidence 2015: SCADA and mobile: security assessment of the applications th...
PROIDEA
 
Industrial Control Systems Security - A Perspective on Product Design (Sequi,...
sequi_inc
 
Positive Technologies - S4 - Scada under x-rays
qqlan
 
Scada strange love.
Positive Hack Days
 
Scada strange love uwn-stuxnet
Positive Hack Days
 
CONFidence 2014: Alexander Timorin: SCADA deep inside: protocols and security...
PROIDEA
 
Taking a closer look at level 0 and level 1 security
Matt Loong
 
Power Grid Communications & Control Systems
fajjarrehman
 
Ad

More from DefconRussia (20)

PPTX
[Defcon Russia #29] Борис Савков - Bare-metal programming на примере Raspber...
DefconRussia
 
PDF
[Defcon Russia #29] Александр Ермолов - Safeguarding rootkits: Intel Boot Gua...
DefconRussia
 
PPTX
[Defcon Russia #29] Алексей Тюрин - Spring autobinding
DefconRussia
 
PDF
[Defcon Russia #29] Михаил Клементьев - Обнаружение руткитов в GNU/Linux
DefconRussia
 
PDF
Георгий Зайцев - Reversing golang
DefconRussia
 
PDF
[DCG 25] Александр Большев - Never Trust Your Inputs or How To Fool an ADC
DefconRussia
 
PPTX
Cisco IOS shellcode: All-in-one
DefconRussia
 
PPT
Олег Купреев - Обзор и демонстрация нюансов и трюков из области беспроводных ...
DefconRussia
 
PPTX
HTTP HOST header attacks
DefconRussia
 
PPTX
Attacks on tacacs - Алексей Тюрин
DefconRussia
 
PPTX
Weakpass - defcon russia 23
DefconRussia
 
PDF
nosymbols - defcon russia 20
DefconRussia
 
PDF
static - defcon russia 20
DefconRussia
 
PDF
Zn task - defcon russia 20
DefconRussia
 
PDF
Vm ware fuzzing - defcon russia 20
DefconRussia
 
PDF
Nedospasov defcon russia 23
DefconRussia
 
PDF
Advanced cfg bypass on adobe flash player 18 defcon russia 23
DefconRussia
 
PDF
Miasm defcon russia 23
DefconRussia
 
PDF
Andrey Belenko, Alexey Troshichev - Внутреннее устройство и безопасность iClo...
DefconRussia
 
PDF
Sergey Belov - Покажите нам Impact! Доказываем угрозу в сложных условиях
DefconRussia
 
[Defcon Russia #29] Борис Савков - Bare-metal programming на примере Raspber...
DefconRussia
 
[Defcon Russia #29] Александр Ермолов - Safeguarding rootkits: Intel Boot Gua...
DefconRussia
 
[Defcon Russia #29] Алексей Тюрин - Spring autobinding
DefconRussia
 
[Defcon Russia #29] Михаил Клементьев - Обнаружение руткитов в GNU/Linux
DefconRussia
 
Георгий Зайцев - Reversing golang
DefconRussia
 
[DCG 25] Александр Большев - Never Trust Your Inputs or How To Fool an ADC
DefconRussia
 
Cisco IOS shellcode: All-in-one
DefconRussia
 
Олег Купреев - Обзор и демонстрация нюансов и трюков из области беспроводных ...
DefconRussia
 
HTTP HOST header attacks
DefconRussia
 
Attacks on tacacs - Алексей Тюрин
DefconRussia
 
Weakpass - defcon russia 23
DefconRussia
 
nosymbols - defcon russia 20
DefconRussia
 
static - defcon russia 20
DefconRussia
 
Zn task - defcon russia 20
DefconRussia
 
Vm ware fuzzing - defcon russia 20
DefconRussia
 
Nedospasov defcon russia 23
DefconRussia
 
Advanced cfg bypass on adobe flash player 18 defcon russia 23
DefconRussia
 
Miasm defcon russia 23
DefconRussia
 
Andrey Belenko, Alexey Troshichev - Внутреннее устройство и безопасность iClo...
DefconRussia
 
Sergey Belov - Покажите нам Impact! Доказываем угрозу в сложных условиях
DefconRussia
 

Recently uploaded (20)

PDF
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
PPTX
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
PDF
Windsurf Meetup Ottawa 2025-07-12 - Planning Mode at Reliza.pdf
Pavel Shukhman
 
PDF
Empowering Cloud Providers with Apache CloudStack and Stackbill
ShapeBlue
 
PPTX
✨Unleashing Collaboration: Salesforce Channels & Community Power in Patna!✨
SanjeetMishra29
 
PPTX
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
PDF
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
PPTX
MSP360 Backup Scheduling and Retention Best Practices.pptx
MSP360
 
PPTX
UiPath Academic Alliance Educator Panels: Session 2 - Business Analyst Content
DianaGray10
 
PDF
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
PDF
Why Orbit Edge Tech is a Top Next JS Development Company in 2025
mahendraalaska08
 
PDF
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
PDF
Wojciech Ciemski for Top Cyber News MAGAZINE. June 2025
Dr. Ludmila Morozova-Buss
 
PDF
The Builder’s Playbook - 2025 State of AI Report.pdf
jeroen339954
 
PDF
Human-centred design in online workplace learning and relationship to engagem...
Tracy Tang
 
PPTX
Building and Operating a Private Cloud with CloudStack and LINBIT CloudStack ...
ShapeBlue
 
PDF
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
PDF
CloudStack GPU Integration - Rohit Yadav
ShapeBlue
 
PDF
Français Patch Tuesday - Juillet
Ivanti
 
PPT
Interview paper part 3, It is based on Interview Prep
SoumyadeepGhosh39
 
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
Windsurf Meetup Ottawa 2025-07-12 - Planning Mode at Reliza.pdf
Pavel Shukhman
 
Empowering Cloud Providers with Apache CloudStack and Stackbill
ShapeBlue
 
✨Unleashing Collaboration: Salesforce Channels & Community Power in Patna!✨
SanjeetMishra29
 
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
MSP360 Backup Scheduling and Retention Best Practices.pptx
MSP360
 
UiPath Academic Alliance Educator Panels: Session 2 - Business Analyst Content
DianaGray10
 
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
Why Orbit Edge Tech is a Top Next JS Development Company in 2025
mahendraalaska08
 
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
Wojciech Ciemski for Top Cyber News MAGAZINE. June 2025
Dr. Ludmila Morozova-Buss
 
The Builder’s Playbook - 2025 State of AI Report.pdf
jeroen339954
 
Human-centred design in online workplace learning and relationship to engagem...
Tracy Tang
 
Building and Operating a Private Cloud with CloudStack and LINBIT CloudStack ...
ShapeBlue
 
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
CloudStack GPU Integration - Rohit Yadav
ShapeBlue
 
Français Patch Tuesday - Juillet
Ivanti
 
Interview paper part 3, It is based on Interview Prep
SoumyadeepGhosh39
 

Alexander Timorin, Alexander Tlyapov - SCADA deep inside protocols, security mechanisms, software architecture

  • 1. All pictures are taken from Dr StrangeLove movie by Gleb Gritsai (as Alexander Timorin) and Alexander Tlyapov
  • 2.  Group of security researchers focused on ICS/SCADA to save Humanity from industrial disaster and to keep Purity Of Essence Sergey Gordeychik Roman Ilin Artem Chaykin Dmitry Efanov Andrey Medov Alexander Zaitsev Dmitry Sklyarov Roman Ilin Kirill Nesterov Gleb Gritsai Ilya Karpov Yuriy Dyachenko Yuri Goltsev Sergey Scherbel Dmitry Serebryannikov Alexander Timorin Alexander Tlyapov Denis Baranov Sergey Bobrov Sergey Drozdov Vladimir Kochetkov Timur Yunusov Dmitry Nagibin Vyacheslav Egoshin Evgeny Ermakov
  • 3.  Gleb Gritsai Penetration tester @ptsecurity  ICS researcher and expert  Member of @scadasl   Alexander Tlyapov    Reverse engineer @ptsecurity ICS researcher Member of @scadasl
  • 4.  ICS 101   Industrial protocols (Gleb Gritsai)    This 101 is useless Functions and weakness of protocols Penetration tester’s view WinCC architecture (Alexander Tlyapov)    Internal protocols Authorization process And how no to pay attention and get to serious stuff
  • 6.  HMI   PLC   Programmable Logic Controller RTU   Human Machine Interface Remote Telemetry Unit IED, SCADA, DSC, Sensor, Actuator, …
  • 7.  Movinged from Serial to Ethernet   Actually five senses of ICS by     Sometimes to Radio (GSM, ZigBee, WiFi, etc) Controlling physical processes Delivering feedback Available starting from OSI/ISO layer 3 Industry and application specific Delivering real time data from sensor or configuring network settings of PLC or reflashing RTU  Operating in one subnet or providing remote telemetry and supervisory   Developed without security in mind and in coders  “Times they are a changin‘”, but slowly
  • 8.  Manufacturing Message Specification  A protocol, but more a specification for messaging   Originally developed at 1980 “Heavy”  See MODBUS packet: [gw_unit; function; register; value]  Applications  IED, PLC, SCADA, RTU  Vendors  GE, Siemens, Schneider, Daimler, ABB
  • 9.  Domains  Named memory regions for managing data/code blobs  Abstraction for devices      Program invocations Journals Files (Yes, files) Named variables and lists (groups of vars) Events  State machines for alarms and events   Operators station (HMI) Init semaphores  Concurrent access
  • 10.  IEC 62351-4 is security for IEC 61850-8-1  IEC 61850-8-1 is MMS  Application level  ACSE AARQ and AARE PDUs    Transport level – TLS (62351-3) Access Control Lists Original port 102 to 3782 if secured
  • 11.   Application security is in ACSE layer (i.e. Association Control Service Element) which is rarely implemented No password requirements defined for software   Welcome to the “123” Application security is plain password  Bruteforce  Just try to keep port alive as no locking exist  Interception  Simple ARP spoofing is still a kill switch for ICS networks (do this in labs or disconnected SCADAs if you care)
  • 12.  Access must be defined to every object (according to standard)    Kind of: read, write, delete Optional TLS, srsly?   No options to set it up seen in products Not supported (not even with stubs in code)
  • 13.  Discovery & Fingerprint  Port 102 is also S7 and … - COTP (Connection Oriented Transport Protocol) & TPKT (Transport packet)  “Identify” request for Vendor, Model and Version  Enumeration of objects  Enumerate everything: Domains, Variables, Files, etc  Good thing – named variables (no need for db with tags/registers/etc description) for understanding logic  Domains: IEDInverter, IEDBattery, IEDPhysical_Measurements  Variables for IEDBattery: ZBAT1$MX$Vol, ZBAT1$MX$Amp, ZBAT1$ST$Health  Better than WriteCoil(coil=X, value=Y)
  • 14.  Open source libs - easy to extract API for better code coverage while fuzzing PLCs, IEDs, RTUs, …   Ain’t it fun fuzzing embedded devices Lot’s of open source libs, single DLL APIs and simulators  libiec61850 is C and free  http://libiec61850.com  openmuc is java and free  http://openmuc.org/  Smartgridware and others non free, but trial  http://www.smartgridware.com/  http://nettedautomation.com/iec61850li/dll/index.html
  • 15.    Is actually IEC 61870-5-104 Master, Slave, Master-Slave No security mechanisms in standard and in implementations   Extensible and vice versa by design   Vendors publish checklists with supported functions Mainly for gathering telemetry in electricity distribution and power system automation   Except the IP addresses of Masters defined on Slaves interrogations Can feature control functions  write, command, execute
  • 16.  Discovery TCP port 2404  Application level ASDU broadcast address   As soon as RTU receives broadcast to enumerate IEC 104 endpoints it sends broadcast itself  If there is an RTU nearby you’ll get infinite broadcast  BCR (Binary Counter Reading) hack with frozen binary counter can mitigate this  Do it at home unless … don’t do it
  • 17.  Reading data   Writing data   Done by interrogations which provides set of controlled data Inspect vendor document on supported protocol features Simulators, libraries and fingerprint tool  https://github.com/atimorin/PoC2013/blob/master/i ec-60870-5-104/iec-60870-5-104.py  https://code.google.com/p/mrts-ng/  https://code.google.com/p/sim104/
  • 18. IEC 104 travels over dedicated network Remote Control IEC 104  Power plant 1 Power plant 2 Power Plant N
  • 19.   IEC 104 flows through RTU to SCADA Server SCADA Server reads/writes data as requested Power plant 1 FW: IEC 104 port opened RTU FW: IEC 104 port opened SCADA Server Open/Close the Door PLC
  • 20. Remote Control IEC 104, SMB, HTTP, etc corp.company.loc Power plant 1 Power plant 2 Power Plant N office.pp1.company.loc office.pp2.company.loc office.ppN.company.loc
  • 21.  corp.company.loc Now this does look like typical pentest Remote Control IEC 104, SMB, HTTP, etc Internets E-mail Sharepoint Remote applications Web sites Power plant 1 Power plant 2 Power Plant N office.pp1.company.loc office.pp2.company.loc office.ppN.company.loc
  • 22.  corp.company.loc Now this does look like one of the pentest attack vectors Remote Control IEC 104, SMB, HTTP, etc Internets E-mail Sharepoint Remote applications Web sites Power plant 1 Power plant 2 Power Plant N office.pp1.company.loc office.pp2.company.loc office.ppN.company.loc
  • 23.    Internal protocols Authorization process And how no to pay attention and get to serious stuff
  • 25. ActiveX components for communication and rendering of HMI Another component of WinCC. For example, forwarding commands to the PLC via the S7 protocol IIS extension SCSWebBridgex.dll Manages SCS connection and converts data to PAL CCEServer.exe Yep-Yep, again) CCEServer.exe WinCC core: Manages requests of components WebNavigatorRT.exe Rendering HMI and command transmission
  • 26. • • • • The POST requests from the client contains the binary data of SCS protocol Basic-authorization Authorization is “two-stage” (we’ll cover this later) For the real identification of client a specially “generated” ID is used
  • 27.    SQL query to database (using COM objects) Verification "special" Windows User The "hardcode" and etc. For successful authentication any path will do
  • 29. Authentication of user in the database through the COM object on the server Getting ServerID and the “magic” activity for the password to WebBridge Using received "magic" password to work with SCSWebBridgeX
  • 30. Oh! En/c(r)ypt[10]n! ServerID = Base64(RC2(pass, key)), where key = MD5(dll hardcode)
  • 31. And forget that before we entered a another password... Not my department password!
  • 32. Sql injection in Basic-authorization. It is too hard for me.
  • 33. Passwords in database is not plaintext… CVE-2013-0676
  • 34. But, it’s just XOR with very secret string. CVE-2013-0678
  • 36. So, we have another way to get ServerID and later access SCSWebBridgex.dll
  • 38.     "Magic" password = MD5(WNUSR_DC92D7179E29.WinPassword) Stored in the registry and encrypted with DPAPI. But with no luck. Wrong flag allows any users (including Guest) on this host to get password for special Siemens user. BTW, this user is local admin. Password generation features very good charset, but chars used uniquely and length is 12 to 14 chars which is not making cracking MD5 harder
  • 39.   All further communications authorized with this password For dispatching requests a special ID is used that is generated ... in some weird and funny way
  • 41. Transmitted ID represents index and identifier in the pool of objects which is responsible for storing the data and dispatching requests Offset Description Size 0 PoolID 2 2 PoolIndex 2
  • 43. HMI Other components CCEServer PLC Communication License server To start communication components must call CAL_StartListen in the service CCEServer. This function is passing all the necessary information about the component. Such as: • Component’s GUID • His PID • Required callbacks • Etc
  • 44.  During initial communications SCS packet is transmitted with GUID describing target component
  • 45.    According to received identifier component's object is looked up Further communication occurs in the context of an established connection, through a protocol called CAL The mechanism of data transmission in the CAL protocol is based on a global MappedSections
  • 47. For sending data: Section = ("GlobalSCS%08X%04X%04X%04XSAM", PID, SomeW, MapKey, Null); ReadyEvent = ("GlobalSCS%08X%04X%04X%04XSAN", PID, SomeW, MapKey, Null); SendEvent = ("GlobalSCS%08X%04X%04X%04XSAF", PID, SomeW, MapKey, Null); For receiving data: Section = ("GlobalSCS%08X%04X%04X%04XASM", PID, SomeW, MapKey, Null); ReadyEvent = ("GlobalSCS%08X%04X%04X%04XASN", PID, SomeW, MapKey, Null); ReciveEvent = ("GlobalSCS%08X%04X%04X%04XASF", PID, SomeW, MapKey, Null);
  • 48.  SQLi for retrieving HMI user passwords from db  And XOR decryption tool      Hardcoded credentials for retrieving ServerID Crack ServerID for Siemens windows user Use ServerID for communication WebBridge Session hijacking for privilege escalation on HMI Exploiting architecture weakness to use arbitrary components of WinCC (like PLC comms)