Incibe-Cert Industrial Honeypot Implementation Guide
Incibe-Cert Industrial Honeypot Implementation Guide
implementation guide
October 2019
INCIBE-CERT_INDUSTRIAL_HONEYPOT_IMPLEMENTATION_GUIDE_2019_v1
This publication belongs to INCIBE (Spanish National Cybersecurity Institute) and is subject to a Creative Commons Attribution-
Non-commercial 3.0 Spain licence. As such, the copying, distribution, and public communication of this guide is permitted under
the following conditions:
• Attribution. The content of this report may be fully or partially reproduced by third parties, provided that they cite its origin and
make express reference to INCIBE or INCIBE-CERT and its website: https://www.incibe.es/. This attribution shall, under no
circumstance, indicate that INCIBE supports this third party or supports the use that it makes of its study.
• Non-commercial Use. The original material and the studies deriving therefrom may be distributed, copied, and exhibited,
provided that their use is not for commercial purposes.
When re-using or distributing the study, the terms of the licence of this study must be made clear. Some of these terms may be
waived if permission is obtained from INCIBE-CERT as the copyright owner. Full licence text:
https://creativecommons.org/licenses/by-nc-sa/3.0/es/.
LIST OF FIGURES
Figure 1 Example of a honeynet architecture .................................................................................. 10
Figure 2 Classification of honeypots ................................................................................................ 12
Figure 3 High interaction honeypot .................................................................................................. 13
Figure 4 Low interaction honeypot ................................................................................................... 13
Figure 5 Client honeypot .................................................................................................................. 17
Figure 6 Server honeypot ................................................................................................................. 17
Figure 7 HoneyMonkey phases of implementation .......................................................................... 19
Figure 8 BeEF logo .......................................................................................................................... 19
Figure 9 HoneyBadger logo ............................................................................................................. 20
Figure 10 NOVA logo ....................................................................................................................... 21
Figure 11 The Honeynet Project logo .............................................................................................. 22
Figure 12 Architecture proposal for an industrial honeynet ............................................................. 23
Figure 13 Conpot and GasPot logos ................................................................................................ 24
Figure 14 Git installation and Honeyd download commands ........................................................... 26
Figure 15 Command for installing dependencies ............................................................................. 27
Figure 16 Commands for the installation of Honeyd ........................................................................ 27
Figure 17 Creation of the folder........................................................................................................ 27
Figure 18 State of the folder at this point ......................................................................................... 28
Figure 19 Edited line in the file “honeyd-http-siemens.py” ............................................................... 29
Figure 20 Edited line in the file “honeyd-telnet-siemens.py” ............................................................ 29
Figure 21 Complete name of the OS obtained from nmap-os-db .................................................... 29
Figure 22 Name of the OS added in the last line of nmap.assoc ..................................................... 29
Figure 23 Previously created folder, with the configuration file ........................................................ 30
Figure 24 Contents of the configuration file honeyd.conf ................................................................. 30
Figure 25 Command and parameters for running the Honeyd virtual machine ............................... 31
Figure 26 Result of running the honeyd command .......................................................................... 31
Figure 27 Results of port scanning in the honeypot ......................................................................... 33
LIST OF TABLES
Table 1 Comparison of low and high interaction honeypots ............................................................ 14
Table 2 Comparison of physical and virtual honeypots ................................................................... 15
Table 3 List of used tools ................................................................................................................. 25
Table 4 List of tools used in the testing phase ................................................................................. 32
This guide defines the concept of a honeypot, the recommended requirements for its correct
implementation, its classification based on different criteria (iteration, equipment, behaviour
and role) and its progress to the present day, paying special attention to honeynets and the
way in which they are typically implemented.
The necessary steps for building an industrial honeypot from scratch are included, with
illustrations and examples, specifying its possible uses and its most important
characteristics.
The search for how to improve the cybersecurity of our systems is a continuous process.
The main problem is determining how an attacker may act or the methods they will use to
make sure their actions are successful.
One of the tools used with this proposal is the so-called honeynet, a network designed with
different tools and machines (Windows, Linux, Solaris, etc.) that are exclusively dedicated
to being the target of attackers, in order to subsequently be able to detect them, obtain
information on them and know how they have carried out the different attacks against it, for
purposes of developing protective measures against these cyberattacks.
How to design and deploy a honeynet is not as trivial a task as we would like it to be, and
given that it consists of a network of connected honeypots, we will focus on defining one of
these nodes, which is a known and widespread term. These honeypots are tools or systems
that are designed in order to deceive the attacker, hence the name “honeypot”, with respect
its aim of attracting attackers. The use of this type of tool can result in both companies and
researchers obtaining valuable information about attackers, as well as providing protection
against possible intrusion attempts, to industrial control systems, since they act as
prevention, detection and response.
Day after day, cyberattackers are learning and using new techniques in order to try to
compromise systems, which means a worldwide increase in cyberattacks.
A honeypot is a special type of network that has been designed and prepared as a means
of defence, in order to be able to be attacked and gather a large amount of information
about the methods and techniques used by cyberattackers. The use of this type of network
began in 1999 with “The Honeynet Project”1, when its founder Lance Spitzner unveiled the
honeypot concept.
1
https://www.honeynet.org/
2
https://honeyscore.shodan.io/
4.3. Components
The two main components of a honeynet are described below:
4.3.1. Honeywall
A honeywall is a machine that is exclusively prepared to act as a firewall, in other words, to
filter and monitor the traffic generated in a honeynet. Therefore, ideally, audit tools, network
analysers and IDS are used or combined in it.
The honeynet must capture the greatest amount of useful data and information so that,
subsequently, new types of attacks, strategies and tools used by intruders may be analysed
and extracted. All of the above must be done without the cyberattacker noticing that they
are being monitored, so the entire data capture and analysis process must be undertaken
in the most transparent and careful way possible.
4.3.2. Honeypot
A honeypot is a simulated system that serves as a security tool, located within a network
and designed to receive attacks. Its main objective is to obtain valuable data on
cyberattackers and their methods, tools used, intrusion techniques and modus operandi.
When building a honeypot, we must decide between the two existing options: physical or
virtual equipment. The differences between the two are that a physical computer is fully
functional and will make it more difficult for the attacker to realise that he is inside a
honeypot. On the other hand, the simulated honeypot is not fully functional, it has a service
that allows you to simultaneously imitate thousands of operating systems and their
characteristics. The existing tools for creating virtualised honeypots are able to simulate the
operating system at the TCP/IP stack level, so they allow you to deceive network and port
scanning tools such as nmap and xprobe; as it is a virtualisation subsystem, it allows you
to have real services such as http, ftp or telnet, with the aim of making the attacker believe
that he is in a real environment.
For SCI environments, different aspects must be taken into account in order to set up an
industrial network as complete as possible, especially regarding PLC devices or SCADA
systems, as we will need to decide which ones are used and define whether real or virtual
ones should be used. The act of completely simulating the industrial network involves
including each of the corresponding elements in the network, having control and automation
elements to be able to deploy a honeynet in conditions and obtain the most and best
information possible.
Care should be taken with the configuration of this type of honeypot since, in the case of
not having it properly configured and controlled, attackers could use it as an access point
to the rest of the network systems. Therefore, it should always be isolated so that no
systems are compromised.
5.2.1. Physical
A physical honeypot involves a real computer ready to be attacked from the outside. As it
is a physical computer, its functionality is the standard offered by computers, without any
restrictions. This makes it more difficult for the attacker to identify the honeypot, but limits
the number of attacks because they are unable to select the desired available services.
The price of a physical honeypot should be taken into account, given the need to have
hardware, not only software. Furthermore, it involves much more maintenance.
5.2.2. Virtual
A virtual honeypot is basically a real system but run on a virtual machine. The virtualisation
offers the benefit that simulating different types of devices on the same physical equipment
is possible. The number and type of services offered will depend on the implementation
undertaken by the virtual honeypot developer, as well as the type of interaction.
The maintenance of a virtual honeypot will depend on the number of services offered and
the interaction exhibited. If full operational services are available, with a high interaction
honeypot, maintenance will be similar to that of a physical computer.
As a general rule, virtualised honeypots are usually low interaction.
Virtual Honeypot Physical Honeypot
5.3.5. None
In this case, the honeypot does not undertake any action or countermeasure related to the
attacker’s actions, therefore there is no limitation of the scope or damages that may be
caused.
5.4.1. Client
A client honeypot serves to imitate a software that uses the services on a server. One of
the most classic examples is having a browser that visits different web pages with the
objective of having those attacked by taking advantage of some vulnerability. It is based on
going to websites and gathering information on the attacks and security risks.
5.4.2. Server
The operation of server honeypot consists of luring attackers to a secure or isolated
environment in order to be able to conduct research studies or remove possible attackers
from the real network.
It is based on the simulation of an environment as realistic and credible as possible, so it
will be more difficult for attackers to differentiate this type of network from a real one.
Typically, to attract their attention, applications, services or industrial automation devices
are simulated, trying to capture the cyberattacker’s attention.
When an attacker falls into the trap, all the actions, tools and techniques they use to achieve
their objectives are recorded, allowing administrators or researchers to obtain new
information, which allows for better protection and knowledge against future attackers.
Honeypots have evolved from their creation until now, and they will continue to do so going
forward, using new tools and techniques. Although their main mission has not changed, the
type of information sought and the way to collect it has.
Currently, it is possible to use a wide range of tools, including HoneyMonkey, BeEF and
HoneyBadger, aimed at extracting information from attackers, or Spider trap, Weblabyrinth
and Nova for slowing down the attacker through deception and traps.
6.1. HoneyMonkey
A HoneyMonkey is a special kind of tool created by Microsoft Research that, using a
computer network or virtual machines, is able to receive and analyse attacks by visiting
suspicious websites. Its main mission is to detect new attack types or patterns and formulas
for infection that take advantage of the browsers’ vulnerabilities.
Some of the main characteristics of this projects are the following:
It is made up of an “exploration” module and another for data collection.
Active exploration consists of automatically exploring, by means of agents,
a list of web pages, gathering information on possible attacks.
Operates like an automatic browsing system.
It visits all types of web pages so that one of them tries to take advantage of
vulnerabilities in the browser.
It is a type of client honeypot.
Browsers may be configured.
To stay up to date with the latest updates or run without any specific update,
so that a website exploits or takes advantage of any vulnerability.
HoneyMonkey operation is based in snapshots.
A snapshot of the records, runtimes and memory is taken before visiting the
pages.
After visiting the pages with malware, another snapshot is taken and both
are compared in order to see the effects it has created and which
vulnerability it has exploited.
HoneyMonkey runs on Windows XP with various levels of updates or patches, some of
them with only patches, others with some vulnerabilities and finally those without any patch
or update.
Once the machines and browsers are configured, the collection and analysis, made up of
the following phases, must be carried out:
Crawling phase. A list is made ahead of time with the web pages classified as
potentially dangerous, in other words, those websites from which they will try to take
advantage of vulnerabilities in our browser to exploit them. The system increases
the size of the list by adding the external links found on each website, because it is
likely that these are also malicious.
6.2. BeEF
BeEF (Browser Exploitation Framework) is a tool for penetration testing that focuses on the
web browser, its operation and data collection, and is based on running scripts on the
attacker's computer. During the attack, it is embedded within a secure web page and
gathers useful security information for analysts. Some of the problems encountered are due
to the difficulty in deployment and development, and in the attackers’ experience when it
comes to discovering honeypots.
6.3. HoneyBadger
HoneyBadger is a framework used for aiding in the detection and geolocation of attackers.
Its use, combined with the Molehunt tool, allows the user to create documents that, when
opened, report thereon, helping to identify and geolocate the attacker.
Its operation is based in offering attackers the administrative functions that they wish to
control. According to its creators, it can work in the form of ActiveX or Java applets, making
the attacker believe, once executed, that he has managed to breach the website.
HoneyBadger uses TCP flow analysis to detect and identify attacks, combining a variety of
TCP injection attacks in order to ensure that it is a real attack, thus avoiding false positives.
The result is obtained in the geolocation of the attacker with an approximately 20 metre
margin of error. Its operation is similar to the technology used by smartphones for
geolocation, by means of triangulation-based positioning.
6.4. Spidertrap
A Spidertrap is a honeypot aimed at decelerating and hindering the task of the crawlers
used for indexing web pages.
6.5. Weblabyrinth
Just like the previous tool, this is also targeted at a web environment and not at creating a
complete and operational physical honeypot.
Weblabyrinth is designed for creating, as its name suggests, a labyrinth of web pages in
order to try and confuse crawlers. The majority of the pages are false, so that they delay
the tasks of possible malicious crawlers in their search for information about the web.
It has machine learning that permits the activation of alerts when it detects suspicious
activity or abnormal attempts to access. To slow down attacks it provides false data to
attackers, protecting the internal systems.
By means of a very user-friendly web panel it enables the configuration and review of
information from the generated honeypots.
Over the years, projects have been emerging regarding industrial honeypots for the
protection and analysis of attackers. Some of the most stand-out and popular ones are The
Honeynet Project, Conpot/GasPot and Honeyd, which we will discuss below.
7.4. Honeyd
Honeyd involves software created by Niels Provos that enables the creation of multiple
honeypots and their virtual execution on the network. These machines may be configured
to simulate different types of components, operating systems or services in order to extract
useful information about attackers.
The two main objectives of this software are to distract attackers and its function as a
honeypot. The goal of the distraction is to keep the attackers focused on it, delaying and
slowing down their actions. The use of honeypot is geared more towards studying and
researching the forms of attack used.
In section 8. Deployment of an industrial honeypot, shows how to build a honeypot using
this software.
3
https://github.com/sjhilt/GasPot
4
https://ubuntu.com/download/desktop
5
https://github.com/DataSoft/Honeyd
6
https://sourceforge.net/projects/scadahoneynet/
7
https://github.com/DataSoft/Honeyd
The command to run in order to complete the installation of the same will be the following:
sudo apt-get install libevent-dev libdumbnet-dev libpcap-dev libpcre3-dev
libedit-dev bison flex libtool automake zlib1g-dev python
Figure 15 Command for installing dependencies
In order to have the results and configurations in one place, a folder should be created that
includes the SCADA Honeynet Project scripts that will subsequently be downloaded, and
the honeyd configuration and log file honeyd.conf and honeyd.log.
The objective of such files is to give a response as realistic as possible from the simulated
OS when scans are being done by means of nmap or another similar tool.
On the other hand, the simulation of services is done by means of running scripts as a
response to the receipt of a request from a Honeyd open port. This tool has a wide range
of scripts that are found in the directory /usr/share/honeyd/scripts. Some of these are in
bash or perl format, therefore it would be necessary to have such interpreters installed in
order to run them. With this, a wide variety of IT machines, such as Linux, Windows or
another embedded version may be simulated.
However, Honeyd does not have scripts that simulate the services of the SCI itself, therefore
scripts have been used that are programmed in Python from the SCADA Honeynet Project8.
There are scripts for services from two PLC from different brands such as, Siemens and
Schneider Electric, for example.
In order to make the work easier, it is recommended to move the entire folder
/cernscadahoneynet/files/scripts, located at the root of the SCADA HoneyNet Project, to
the folder that was previously created.
8
http://scadahoneynet.sourceforge.net/
In the case of wanting to simulate the Schneider website, changing the “web-
siemens” directory to “web-schneider” is enough. To show any other web page, the
web.sh script could be used, located in the folder /scripts/backdoor within the
honeyd installation.
Since there is no script that simulates Telnet in a Siemens PLC, duplicate the file
honeyd-telnet-schneider.py and rename the copy honeyd-telnet-siemens.py. It
is necessary to modify the file so that it indicates that it is a Siemens, not Schneider
Electric, computer.
logintext = “\n\rSiemens Login: ”
Figure 20 Edited line in the file “honeyd-telnet-siemens.py”
If it is not already included, extract the full name of the OS to be simulated from the
nmap-os-db file (the full name immediately after the desired product Fingerprint,
in our case SIMATIC 300 PLC), which is located in the path /usr/share/honeyd/,
and add it, editing it as root, at the end of the nmap.assoc list, followed by a
semicolon (it is in the same directory as the previous file). If it is already on the list,
just make sure that line is uncommented. In this case, the OS to simulate will be
Siemens Simatic 300 programmable logic controller.
Subsequently, the configuration file of the honeypot must be created, which will include all
the parameters of the machine to be simulated, such as open ports, services that are
emulated in them, network information, such as MAC or IP address, operating system
name, among others. In this case, it will be called honeyd.conf and will be located within
the previously created folder.
Where:
-d: run Honeyd without demonising and with debug messages.
-p file: allows Honeyd to read nmap fingerprints contained in that file.
-i interface: specifies the host network interface that will occupy the honeypot.
-l logfile: specifies the log file. In this way, there will be two logs: one of iptables
and one of Honeyd.
-f config: specifies the specific configuration file that Honeyd will run.
IP: IP address of the emulated virtual machine or subnet which contains several
emulated machines (in the case of more than one). This will be the network the
Honeyd will emulate. Must be the same network as the host interface specified in
the command with the -i argument.
-u: establishes the UID with which the Honeyd is operating.
-g: establishes the GID with which the Honeyd is operating.
--disable-webserver: disables the web server that honeyd has configured by
default.
A cheat sheet has been prepared with all of the commands summarised on page 43.
8.7. Results
In this section, the correct operation of the honeypot will be checked by using a set of tools
for the purposes of network analysis and devices, as well as the interpretation of the logs
generated by the honeypot.
9
https://nmap.org/zenmap/
10
http://www.modbusmaster.com/
11
https://www.wireshark.org/#download
12
http://snap7.sourceforge.net/
HTTP
An HTTP connection was made from a browser on a machine within the network of the
same in order to check the operation of the web service. A similar web page to one a
Siemens Simatic PLC would display is shown, with which it can interact to a certain level,
providing some data of the simulated device.
FTP
When making an FTP connection against the honeypot, depending on the user's input, the
service is expected to display the login message along with its different responses. In this
case, the corresponding error codes are obtained, just as a real FTP service would do. It
should be noted that it is not possible to login in the simulated service.
Modbus
To carry out this test ModbusTool for Windows was used, with which Modbus record reading
and writing packages can be sent. The honeypot correctly responds to the Modbus TCP
messages, just as a PLC with Modbus TCP communication would do.
Click Connect. The status should change to Connected and that value
should be able to seen in the records.
Below are screenshots of the packages sent by the programme, which may be located with
the following Wireshark filter: tcp.port==502.
Figure 34 Exchange of record reading packages between ModbusTool and the honeypot
Figure 35 Exchange of record writing packages between ModbusTool and the honeypot
This exchange may be checked using the tcp.port == 102 && s7comm filter in Wireshark:
Telnet
The result of making a telnet connection with the honeypot is expected, obtaining the user
and password entry messages. Just as with the FTP service, it is not possible to login.
SNMP
It is also possible to complete SNMP polling in the honeypot. The screenshot below shows
the result of carrying out a snmpwalk against its IP, confirming the expected behaviour of
the service, obtaining detailed information on the simulated device’s hardware and software.
Just as it does with other devices within a network, the sending of this log by syslog could
be configured so that it may be treated by a centralised log system.
13
https://vestertraining.com/sectores-industriales-recibieron-mas-ciberataques-2018/
CONFIGURATION FILE
Create a configuration file (<filename.conf>) inside the directory <path_name> and including the following configuration lines:
create siemens
set siemens ethernet “00:1f:f8:cc:d0:23”
set siemens default tcp action closed
set siemens default udp action reset
set siemens personality “Siemens Simatic 300 programmable logic controller”
add siemens tcp port 21 "python <scripts_path>/honeyd-ftp-siemens.py"
add siemens tcp port 23 "python <scripts_path>/honeyd-telnet-siemens.py"
add siemens tcp port 80 "python <scripts_path>/honeyd-http-siemens.py"
add siemens tcp port 102 "python <scripts_path>/honeyd-s7.py"
add siemens udp port 161 " python <scripts_path>/honeyd-snmp-siemens.py"
add siemens tcp port 502 " python <scripts_path>/honeyd-modbus.py"
set siemens uptime <timestamp in seconds>
bind <ip_address> siemens
HONEY INSTALLATION
GIT INSTALLATION
sudo apt-get install git
DEPENDENCIES INSTALLATION
sudo apt-get install libevent-dev libdumbnet-dev libpcap-dev libpcre3-dev
libedit-dev bison flex libtool automake zlib1g-dev python net-tools
OPERATING
HONEYD COMPILATION AND INSTALLATION ATTACKER SYSTEM HIGH INTERACTION
cd Honeyd/ HONEYPOT
./autogen.sh
./configure
make
RUNNING HONEYD
CREATION OF DIRECTORY FOR CONFIGURATION FILES
cd .. sudo honeyd -d -p nmap-os-db -i <interface> -l <log_name.log> -f <filename.conf>
mkdir <path_name> <IP_address_or_subnet> -u 0 -g 0 --disable-webserver
10. References