homepage
Open menu
Go one level top
  • Train and Certify
    Train and Certify

    Immediately apply the skills and techniques learned in SANS courses, ranges, and summits

    • Overview
    • Courses
      • Overview
      • Full Course List
      • By Focus Areas
        • Cloud Security
        • Cyber Defense
        • Cybersecurity and IT Essentials
        • DFIR
        • Industrial Control Systems
        • Offensive Operations
        • Management, Legal, and Audit
      • By Skill Levels
        • New to Cyber
        • Essentials
        • Advanced
        • Expert
      • Training Formats
        • OnDemand
        • In-Person
        • Live Online
      • Course Demos
    • Training Roadmaps
      • Skills Roadmap
      • Focus Area Job Roles
        • Cyber Defence Job Roles
        • Offensive Operations Job Roles
        • DFIR Job Roles
        • Cloud Job Roles
        • ICS Job Roles
        • Leadership Job Roles
      • NICE Framework
        • Security Provisionals
        • Operate and Maintain
        • Oversee and Govern
        • Protect and Defend
        • Analyze
        • Collect and Operate
        • Investigate
        • Industrial Control Systems
      • European Skills Framework
    • GIAC Certifications
    • Training Events & Summits
      • Events Overview
      • Event Locations
        • Asia
        • Australia & New Zealand
        • Latin America
        • Mainland Europe
        • Middle East & Africa
        • Scandinavia
        • United Kingdom & Ireland
        • United States & Canada
      • Summits
    • OnDemand
    • Get Started in Cyber
      • Overview
      • Degree and Certificate Programs
      • Scholarships
    • Cyber Ranges
  • Manage Your Team
    Manage Your Team

    Build a world-class cyber team with our workforce development programs

    • Overview
    • Why Work with SANS
    • Group Purchasing
    • Build Your Team
      • Team Development
      • Assessments
      • Private Training
      • Hire Cyber Professionals
      • By Industry
        • Health Care
        • Industrial Control Systems Security
        • Military
    • Leadership Training
  • Security Awareness
    Security Awareness

    Increase your staff’s cyber awareness, help them change their behaviors, and reduce your organizational risk

    • Overview
    • Products & Services
      • Security Awareness Training
        • EndUser Training
        • Phishing Platform
      • Specialized
        • Developer Training
        • ICS Engineer Training
        • NERC CIP Training
        • IT Administrator
      • Risk Assessments
        • Knowledge Assessment
        • Culture Assessment
        • Behavioral Risk Assessment
    • OUCH! Newsletter
    • Career Development
      • Overview
      • Training & Courses
      • Professional Credential
    • Blog
    • Partners
    • Reports & Case Studies
  • Resources
    Resources

    Enhance your skills with access to thousands of free resources, 150+ instructor-developed tools, and the latest cybersecurity news and analysis

    • Overview
    • Webcasts
    • Free Cybersecurity Events
      • Free Events Overview
      • Summits
      • Solutions Forums
      • Community Nights
    • Content
      • Newsletters
        • NewsBites
        • @RISK
        • OUCH! Newsletter
      • Blog
      • Podcasts
      • Summit Presentations
      • Posters & Cheat Sheets
    • Research
      • White Papers
      • Security Policies
    • Tools
    • Focus Areas
      • Cyber Defense
      • Cloud Security
      • Digital Forensics & Incident Response
      • Industrial Control Systems
      • Cyber Security Leadership
      • Offensive Operations
  • Get Involved
    Get Involved

    Help keep the cyber community one step ahead of threats. Join the SANS community or begin your journey of becoming a SANS Certified Instructor today.

    • Overview
    • Join the Community
    • Work Study
    • Teach for SANS
    • CISO Network
    • Partnerships
    • Sponsorship Opportunities
  • About
    About

    Learn more about how SANS empowers and educates current and future cybersecurity practitioners with knowledge and skills

    • SANS
      • Overview
      • Our Founder
      • Awards
    • Instructors
      • Our Instructors
      • Full Instructor List
    • Mission
      • Our Mission
      • Diversity
      • Scholarships
    • Contact
      • Contact Customer Service
      • Contact Sales
      • Press & Media Enquiries
    • Frequent Asked Questions
    • Customer Reviews
    • Press
    • Careers
  • Contact Sales
  • SANS Sites
    • GIAC Security Certifications
    • Internet Storm Center
    • SANS Technology Institute
    • Security Awareness Training
  • Search
  • Log In
  • Join
    • Account Dashboard
    • Log Out
  1. Home >
  2. Blog >
  3. Collecting Serial Data for ICS Network Security Monitoring
370x370_Mark-Bristow.jpg
Mark Bristow

Collecting Serial Data for ICS Network Security Monitoring

March 29, 2016

Adversaries across the capability spectrum are increasingly targeting Industrial Control System (ICS) environments. Malware such as BlackEnergy2, Havex, and Stuxnet have been developed with specific capabilities against different control system targets. As exemplified by BlackEnergy2 and Havex even today's advanced adversaries typically target the commodity IT hardware, software, and communications protocols in use as part of our ICS systems. While this is the common tactic today, as the ICS community improves its cybersecurity posture adversaries will have to change their tactics and may turn to harder to access but more insecure communications mechanisms such as serial communications.

Why does serial data matter?

Serial data is critical to the functionality of most ICS environments. Even more modern installations rely heavily in serial data communications for critical operational communications. While technologies built on IP protocol stacks are becoming more common, even in these environments serial is the prevalent communication mechanism for the "last mile" to field devices. The criticality of the operational data sent via serial makes it an opportune target for an adversary who is interested in having physical consequences.

What is the issue?

While many ICS facilities have begun to adopt Network Security Monitoring (NSM) techniques on their corporate and control networks, few facilities are monitoring serial communications. Part of the challenge is that there are few open source or commercially available options that will allow for basic serial communication logging or forwarding. The tools that are available typically convert serial to IP and vice versa permitting two-way communications (not ideal for NSM). These tools are often protocol or vendor specific and centered around attempting to allow serial communications over an IP infrastructure and are not engineered to be a monitoring solution. Monitoring tools that allow passive tapping of serial communications with one-way forwarding into security analysis tools are needed.

How can you tap it?

When planning to physically intercept, or tap, serial communications it is important to keep in mind any impacts the tap may have to the primary communications path. When selecting a tap, it is preferable to use a physical tap that isolates the monitoring port from the main communications line and that "fails open" allowing communications even if the device has a failure. You want to ensure that a malfunction or compromise of your monitoring will not have an impact to your operations. There are a number of products on the market such as the B+B SmartWorx's serial data taps or the Frontline ComProbe II that will allow you to duplicate serial communications in this manner.

Should an isolated solution not be practical in your environment, a serial Y-Cable (an example can be seen here) tap can be purchased for relatively low cost to create a monitoring port. Serial Y-Cables can even be manufactured with relatively basic soldering skills however unreliable connections or interference from serial Y-Cables could have adverse impacts operations and should only be used when an isolated solution is not available. Additionally, since serial Y-Cables are generally wired as straight through you can only practically monitor the RX side of the serial communications without constructing an external circuit and adding complexity to your solution that is built into the professional data taps.

Setting taps in an production environment can become incredibly complex depending on the configuration of the serial communications network you are attempting to tap. In my example implementation below I will demonstrate a very basic setup for monitoring a simplex connection suitable for monitoring a single endpoint device that can be helpful in an incident response or detection context. When adding in multiple protocols, multiplexers, and other serial communications equipment monitoring serial communications becomes significantly more complex. While the principles outlined here apply to more complex environments, significant planning and coordination with communications engineers at the facility will be required to implement monitoring at scale.

How can you integrate with existing tools?

Traditional IT network security monitoring has significantly matured over the last decade. There are now a variety of open source and commercial tools that can process and analyze IP based network data for security monitoring. In order to integrate with these existing tools, serial data could be "wrapped" with an IP packet structure so this data can be ingested. Below is a simple python tool I made called Serial IP Forwarder that leverages pySerial to forward serial data from a serial tap and forward it via UDP to an IP based NSM sensor for processing.

Serial IP Forwarder

The tool does not attempt to process the data or convert it to a IP equivalent ICS protocols (such as Modbus to ModbusTCP) but it does represent a starting point for forwarding serial captured data into more common IT NSM tools. This tool can be deployed on a simple laptop or a Raspberry Pi (RPi) with a serial interface to forward traffic for processing.

Example Raspberry Pi Implementation

Example-Pi-Implementation-1024x768.jpg
Figure 1: Example Raspberry Pi Serial Capture Setup

To demonstrate the concept, I set up a Raspberry Pi in my lab using a Modbus serial simulation. If you've taken SANS ICS515: ICS Active Defense and Incident Response, you can use the Raspberry Pi you are provided as part of the class to build your own serial data forwarder. While a stock RPi does not have a DB9 or other serial connector, the header pins are automatically configured for a serial interface. You can access the device as ?/dev/ttyAMA0', this is the RPi's Linux operating system name for the default serial port similar to a COM port you may be familiar with in Windows. You can acquire a serial port connector as I did above, or wire one yourself as it only requires four connections.

If you install the default version of Rasbian, you will need to make two modifications to your RPi before you can reliably use the built in serial port. By default the RPi initializes the serial port as system console access for applications without monitors or keyboards. To disable this function, you will need to edit your /boot/cmdline.txt and /etc/initab to remove any references to "ttyAMA0". Elinux.org has a helpful description of the RPi serial port that outlines the processes for making these modifications. Once complete, restart the RPi and connect it to your serial tap or Y-Cable.

In this example I have a Modbus Master station in RTU mode polling a Modbus slave with slave ID 10 for 10 registers. The resulting request should present in hexadecimal as "0A 03 00 00 00 0A C4 B6" and be assembled as shown below.

Modbus-Request.png
Figure 2: Modbus Request

On the RPi, simply navigate to the directory where you saved the python script and run the script as root being sure to specify at least the IP address or HOSTNAME you'd like the data to be forwarded to and the serial interface name. There are a variety of other options you can set, including the UDP port to forward to (default is 7777) that are displayed by running ?serial_forwarder.py -help?.

In my lab setup the my NSM sensor is located at 10.10.10.100 and the RPi serial port is named ?/dev/ttyAMA0'?so the command would be ?sudo python serial_forwarder.py 10.10.10.100 /dev/ttyAMA0'. The script will start up and wait for serial data to be transmitted. Once serial data is detected on the bus, the hexadecimal representation of the serial data will be displayed in the terminal window.

Successful-Capture-of-Serial-Communication.png
Figure 3 Successful Capture of Serial Communication

To verify that the data was actually transmitted to the NSM monitor for ingest, I had Wireshark running to verify.

Wireshark-Verification.png
Figure 4: Wireshark Verification

Since I was using a serial Y-Cable in the configuration above, I was only able to monitor the master station's transmissions. Additionally the Raspberry Pi could be active on the serial bus and could interfere with the regular communications between the master and slaves. This limitation can be overcome by using a purpose built isolated serial tap that merges both the TX and RX lines into the RX line of the tap port or by building a tap that ties the TX and RX lines together and adding diodes and other circuitry to ensure the tap remains completely passive. The configuration used here was to demonstrate the method and is not recommended for production environments.

Mark Bristow is an instructor for the SANS ICS515: Active Defense and Incident Response course. Mark currently serves as the Chief of Incident Response for the ICS-CERT and has a background in ICS assessments, incident response, and penetration testing.

Share:
TwitterLinkedInFacebook
Copy url Url was copied to clipboard
Subscribe to SANS Newsletters
Receive curated news, vulnerabilities, & security awareness tips
United States
Canada
United Kingdom
Spain
Belgium
Denmark
Norway
Netherlands
Australia
India
Japan
Singapore
Afghanistan
Aland Islands
Albania
Algeria
American Samoa
Andorra
Angola
Anguilla
Antarctica
Antigua and Barbuda
Argentina
Armenia
Aruba
Austria
Azerbaijan
Bahamas
Bahrain
Bangladesh
Barbados
Belarus
Belize
Benin
Bermuda
Bhutan
Bolivia
Bonaire, Sint Eustatius, and Saba
Bosnia And Herzegovina
Botswana
Bouvet Island
Brazil
British Indian Ocean Territory
Brunei Darussalam
Bulgaria
Burkina Faso
Burundi
Cambodia
Cameroon
Cape Verde
Cayman Islands
Central African Republic
Chad
Chile
China
Christmas Island
Cocos (Keeling) Islands
Colombia
Comoros
Cook Islands
Costa Rica
Croatia (Local Name: Hrvatska)
Curacao
Cyprus
Czech Republic
Democratic Republic of the Congo
Djibouti
Dominica
Dominican Republic
East Timor
East Timor
Ecuador
Egypt
El Salvador
Equatorial Guinea
Eritrea
Estonia
Ethiopia
Falkland Islands (Malvinas)
Faroe Islands
Fiji
Finland
France
French Guiana
French Polynesia
French Southern Territories
Gabon
Gambia
Georgia
Germany
Ghana
Gibraltar
Greece
Greenland
Grenada
Guadeloupe
Guam
Guatemala
Guernsey
Guinea
Guinea-Bissau
Guyana
Haiti
Heard And McDonald Islands
Honduras
Hong Kong
Hungary
Iceland
Indonesia
Iraq
Ireland
Isle of Man
Israel
Italy
Jamaica
Jersey
Jordan
Kazakhstan
Kenya
Kiribati
Korea, Republic Of
Kosovo
Kuwait
Kyrgyzstan
Lao People's Democratic Republic
Latvia
Lebanon
Lesotho
Liberia
Liechtenstein
Lithuania
Luxembourg
Macau
Macedonia
Madagascar
Malawi
Malaysia
Maldives
Mali
Malta
Marshall Islands
Martinique
Mauritania
Mauritius
Mayotte
Mexico
Micronesia, Federated States Of
Moldova, Republic Of
Monaco
Mongolia
Montenegro
Montserrat
Morocco
Mozambique
Myanmar
Namibia
Nauru
Nepal
Netherlands Antilles
New Caledonia
New Zealand
Nicaragua
Niger
Nigeria
Niue
Norfolk Island
Northern Mariana Islands
Oman
Pakistan
Palau
Palestine
Panama
Papua New Guinea
Paraguay
Peru
Philippines
Pitcairn
Poland
Portugal
Puerto Rico
Qatar
Reunion
Romania
Russian Federation
Rwanda
Saint Bartholemy
Saint Kitts And Nevis
Saint Lucia
Saint Martin
Saint Vincent And The Grenadines
Samoa
San Marino
Sao Tome And Principe
Saudi Arabia
Senegal
Serbia
Seychelles
Sierra Leone
Sint Maarten
Slovakia
Slovenia
Solomon Islands
South Africa
South Georgia and the South Sandwich Islands
South Sudan
Sri Lanka
St. Helena
St. Pierre And Miquelon
Suriname
Svalbard And Jan Mayen Islands
Swaziland
Sweden
Switzerland
Taiwan
Tajikistan
Tanzania
Thailand
Togo
Tokelau
Tonga
Trinidad And Tobago
Tunisia
Turkey
Turkmenistan
Turks And Caicos Islands
Tuvalu
Uganda
Ukraine
United Arab Emirates
United States Minor Outlying Islands
Uruguay
Uzbekistan
Vanuatu
Vatican City
Venezuela
Vietnam
Virgin Islands (British)
Virgin Islands (U.S.)
Wallis And Futuna Islands
Western Sahara
Yemen
Yugoslavia
Zambia
Zimbabwe

By providing this information, you agree to the processing of your personal data by SANS as described in our Privacy Policy.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Tags:
  • Industrial Control Systems Security

Related Content

Blog
ICS_Blog_Series-_A_Look_into_ICS-Part_22.jpg
Industrial Control Systems Security
April 4, 2022
A Look Into ICS612: ICS Cybersecurity In-Depth: Part 2
In OT security, you'll eventually be placed in an environment where you'll face the pressures of dealing with a process that's not responding.
370x370_jeffrey-shearer.jpg
Jeffrey Shearer
read more
Blog
ICS_Blog_Series-_A_Look_into_ICS_Cybersecurity_-_Social2.jpg
Industrial Control Systems Security
December 15, 2021
A Look Into ICS612: ICS Cybersecurity In-Depth: Part 1
ICS practitioners can immediately use their ICS612 training in real-world situations.
370x370_jeffrey-shearer.jpg
Jeffrey Shearer
read more
Blog
Untitled_design-43.png
Digital Forensics and Incident Response, Cybersecurity and IT Essentials, Industrial Control Systems Security, Purple Team, Open-Source Intelligence (OSINT), Penetration Testing and Red Teaming, Cyber Defense, Cloud Security, Security Management, Legal, and Audit
December 8, 2021
Good News: SANS Virtual Summits Will Remain FREE for the Community in 2022
They’re virtual. They’re global. They’re free.
370x370-person-placeholder.png
Emily Blades
read more
  • Register to Learn
  • Courses
  • Certifications
  • Degree Programs
  • Cyber Ranges
  • Job Tools
  • Security Policy Project
  • Posters & Cheat Sheets
  • White Papers
  • Focus Areas
  • Cyber Defense
  • Cloud Security
  • Cybersecurity Leadership
  • Digital Forensics
  • Industrial Control Systems
  • Offensive Operations
Subscribe to SANS Newsletters
Receive curated news, vulnerabilities, & security awareness tips
United States
Canada
United Kingdom
Spain
Belgium
Denmark
Norway
Netherlands
Australia
India
Japan
Singapore
Afghanistan
Aland Islands
Albania
Algeria
American Samoa
Andorra
Angola
Anguilla
Antarctica
Antigua and Barbuda
Argentina
Armenia
Aruba
Austria
Azerbaijan
Bahamas
Bahrain
Bangladesh
Barbados
Belarus
Belize
Benin
Bermuda
Bhutan
Bolivia
Bonaire, Sint Eustatius, and Saba
Bosnia And Herzegovina
Botswana
Bouvet Island
Brazil
British Indian Ocean Territory
Brunei Darussalam
Bulgaria
Burkina Faso
Burundi
Cambodia
Cameroon
Cape Verde
Cayman Islands
Central African Republic
Chad
Chile
China
Christmas Island
Cocos (Keeling) Islands
Colombia
Comoros
Cook Islands
Costa Rica
Croatia (Local Name: Hrvatska)
Curacao
Cyprus
Czech Republic
Democratic Republic of the Congo
Djibouti
Dominica
Dominican Republic
East Timor
East Timor
Ecuador
Egypt
El Salvador
Equatorial Guinea
Eritrea
Estonia
Ethiopia
Falkland Islands (Malvinas)
Faroe Islands
Fiji
Finland
France
French Guiana
French Polynesia
French Southern Territories
Gabon
Gambia
Georgia
Germany
Ghana
Gibraltar
Greece
Greenland
Grenada
Guadeloupe
Guam
Guatemala
Guernsey
Guinea
Guinea-Bissau
Guyana
Haiti
Heard And McDonald Islands
Honduras
Hong Kong
Hungary
Iceland
Indonesia
Iraq
Ireland
Isle of Man
Israel
Italy
Jamaica
Jersey
Jordan
Kazakhstan
Kenya
Kiribati
Korea, Republic Of
Kosovo
Kuwait
Kyrgyzstan
Lao People's Democratic Republic
Latvia
Lebanon
Lesotho
Liberia
Liechtenstein
Lithuania
Luxembourg
Macau
Macedonia
Madagascar
Malawi
Malaysia
Maldives
Mali
Malta
Marshall Islands
Martinique
Mauritania
Mauritius
Mayotte
Mexico
Micronesia, Federated States Of
Moldova, Republic Of
Monaco
Mongolia
Montenegro
Montserrat
Morocco
Mozambique
Myanmar
Namibia
Nauru
Nepal
Netherlands Antilles
New Caledonia
New Zealand
Nicaragua
Niger
Nigeria
Niue
Norfolk Island
Northern Mariana Islands
Oman
Pakistan
Palau
Palestine
Panama
Papua New Guinea
Paraguay
Peru
Philippines
Pitcairn
Poland
Portugal
Puerto Rico
Qatar
Reunion
Romania
Russian Federation
Rwanda
Saint Bartholemy
Saint Kitts And Nevis
Saint Lucia
Saint Martin
Saint Vincent And The Grenadines
Samoa
San Marino
Sao Tome And Principe
Saudi Arabia
Senegal
Serbia
Seychelles
Sierra Leone
Sint Maarten
Slovakia
Slovenia
Solomon Islands
South Africa
South Georgia and the South Sandwich Islands
South Sudan
Sri Lanka
St. Helena
St. Pierre And Miquelon
Suriname
Svalbard And Jan Mayen Islands
Swaziland
Sweden
Switzerland
Taiwan
Tajikistan
Tanzania
Thailand
Togo
Tokelau
Tonga
Trinidad And Tobago
Tunisia
Turkey
Turkmenistan
Turks And Caicos Islands
Tuvalu
Uganda
Ukraine
United Arab Emirates
United States Minor Outlying Islands
Uruguay
Uzbekistan
Vanuatu
Vatican City
Venezuela
Vietnam
Virgin Islands (British)
Virgin Islands (U.S.)
Wallis And Futuna Islands
Western Sahara
Yemen
Yugoslavia
Zambia
Zimbabwe

By providing this information, you agree to the processing of your personal data by SANS as described in our Privacy Policy.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.
  • © 2023 SANS™ Institute
  • Privacy Policy
  • Contact
  • Careers
  • Twitter
  • Facebook
  • Youtube
  • LinkedIn