Services & supportCareersSign in
en
English
Português
Español
Français
AlgoSec
Back to home
Horizon
Horizon
Horizon Platform
Explore our
Platforms modules
Horizon ACE
Transform your cloud network security
Horizon FireFlow
Automated security policy management
Horizon ObjectFlow
Smart automation for policy changes
Horizon AppViz
Discover, visualize and secure applications
Horizon Security Analyzer
Visualize & manage hybrid networks
Algo Assistant
AI assistant for security policy tasks
Integrations
Microsoft Teams
Slack
Check Point
BMC
F5
Microsoft Azure
Google Cloud
HP
AWS
Cisco
Explore all integrations
Product utilities
AlgoSec security center

Money-back guarantee

AlgoSec alternatives

Solutions
Solutions

By use case

Change automation

Risk management

Cost reduction

Compliance

By industry

Security service providers

Finance

Insurance

Healthcare

Government

Telecommunications

Resources
Resources

Explore

Resource center

Central hub for all AlgoSec content

Algo-Library

In-depth research and technical insights

Case studies

Real customer stories & results

Blog

Articles, insights, and product updates

Watch & learn

Videos

Videos on network security

Product demos

See the platform in action

Webinars

Expert talks on security challenges

Partners
Partners

Our partner program

Become a partner

Join the AlgoSec Elevate Partner Program

Our partner ecosystem

Locate a partner

Find a partner in our global network

Technology partners

Integrations with leading technology vendors

Service partners

Work with certified experts for services and consulting

Company
Company

Company overview

About

Who we are and the value we bring

Leadership

The executives guiding AlgoSec

Careers

Open roles and life at AlgoSec

Contact us

Reach our global offices and teams

Events

Conferences and upcoming events

Media center

Company news and product updates

Company utilities

Our customers

AlgoSec professional services

AlgoSec resident engineer

Training services & certification

AlgoSec support programs

AlgoSec media kit

Sign inServices & supportCareers
Schedule a demo
Schedule a demo
Abstract network background
Home
Blog
Router honeypot for an IRC bot

Router honeypot for an IRC bot

Rony Moshkovich

Rony Moshkovich

September 13, 2020

|

4

minute read

Share
YouTubeLinkedIn

In our previous post we have provided some details about a new fork of Kinsing malware, a Linux malware that propagates across misconfigured Docker platforms and compromises them with a coinminer.

Several days ago, the attackers behind this malware have uploaded a new ELF executable b_armv7l into the compromised server dockerupdate[.]anondns[.]net.

The executable b_armv7l is based on a known source of Tsunami (also known as Kaiten), and is built using uClibc toolchain:

$ file b_armv7l b_armv7l: ELF 32-bit LSB executable, ARM, EABI4 version 1 (SYSV), dynamically linked, interpreter /lib/ld-uClibc.so.0, with debug_info, not stripped

Unlike glibc, the C library normally used with Linux distributions, uClibc is smaller and is designed for embedded Linux systems, such as IoT. Therefore, the malicious b_armv7l was built with a clear intention to install it on such devices as routers, firewalls, gateways, network cameras, NAS servers, etc.

Some of the binary’s strings are encrypted. With the help of the HexRays decompiler, one could clearly see how they are decrypted:

memcpy(&key, "xm@_;w,B-Z*j?nvE|sq1o$3\"7zKC<F)utAr.p%=>4ihgfe6cba~&5Dk2d!8+9Uy:", 0x40u);
memcpy(&alphabet, "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ. ", 0x40u);

for (i = 0; i <= 64; ++i){ if (encoded[j] == key[i]) { if (psw_or_srv)
            decodedpsw[k] = alphabet[i];
        else
            decodedsrv[k] = alphabet[i];
        ++k;
    }}

The string decryption routine is trivial — it simply replaces each encrypted string’s character found in the array key with a character at the same position, located in the array alphabet.

Using this trick, the critical strings can be decrypted as:

Variable NameEncoded StringDecoded String
decodedpsw$7|3vfaa~8logmeINNOW
decodedsrv$7?*$s7<Flocalhost
chanE7zv"fopen
servers[0]m,;y,-ymx,yZ,164[.]68[.]106[.]96
servers[1]qC?jny*"7"n"<y"vFircbd[.]anondns[.]net

How to run/debug it?

Rather than infecting a physical router or re-building a uClibc-based distribution for Raspberry Pi, a viable alternative is to set up an emulation environment where uClibc toolchain is used by default.

For example, Valerio Di Giampietro has provided an excellent set of scripts to set up a Qemu emulation environment to emulate D-link DVA-5592 router. The environment it builds will emulate the router’s ARM v7 Cortex A9 Processor, memory, root file system and an older version of Linux kernel (3.4.11-rt19).

As a result, the IRC bot b_armv7l will run under such QEMU VM out-of-the-box. Apart from an opportunity to deploy such honeypot into a cloud, another advantage of this approach is that the honeypot traffic can easily be sniffed on the host.

When the IRC bot is executed in the virtual honeypot, it will connect to the remote IRC server. As seen in the intercepted traffic, the IRC server will respond with high-level statistics along with the Message of the Day (MOTD):

:-                        _____             _____ _  _ _____ 
:-                       |_   _|__ __ _ _ _|_   _| \| |_   _|
:-                         | |/ -_) _` | '  \| | | .` | | |  
:-                         |_|\___\__,_|_|_|_|_| |_|\_| |_|  
:- 
:-                                          \|/
:-                                         .-*-
:-                                        / /|\
:-                                       _L_
:-                                     ,"   ".
:-                                 (\ /  O O  \ /)
:-                                  \|    _    |/
:-                                    \  (_)  /
:-                                    _/.___,\_
:-                                   (_/     \_)
:-                             
:- 
:-             '##:::::'##:'########:::::'######:::::'###::::'##::: ##:
:-              ##:'##: ##: ##.....:::::'##... ##:::'## ##::: ###:: ##:
:-              ##: ##: ##: ##:::::::::: ##:::..:::'##:. ##:: ####: ##:
:-              ##: ##: ##: ######:::::: ##:::::::'##:::. ##: ## ## ##:
:-              ##: ##: ##: ##...::::::: ##::::::: #########: ##. ####:
:-              ##: ##: ##: ##:::::::::: ##::: ##: ##.... ##: ##:. ###:
:-             . ###. ###:: ########::::. ######:: ##:::: ##: ##::. ##:
:-             :...::...:::........::::::......:::..:::::..::..::::..::
:-           '########::::'###::::'##:::'##:'########::::'####:'########:
:-           ... ##..::::'## ##::: ##::'##:: ##.....:::::. ##::... ##..::
:-           ::: ##:::::'##:. ##:: ##:'##::: ##::::::::::: ##::::: ##::::
:-           ::: ##::::'##:::. ##: #####:::: ######::::::: ##::::: ##::::
:-           ::: ##:::: #########: ##. ##::: ##...:::::::: ##::::: ##::::
:-           ::: ##:::: ##.... ##: ##:. ##:: ##::::::::::: ##::::: ##::::
:-           ::: ##:::: ##:::: ##: ##::. ##: ########::::'####:::: ##::::
:-           :::..:::::..:::::..::..::::..::........:::::....:::::..:::::
:-                   '########:::'#######::'##:::::'##:'##::: ##:
:-                    ##.... ##:'##.... ##: ##:'##: ##: ###:: ##:
:-                    ##:::: ##: ##:::: ##: ##: ##: ##: ####: ##:
:-                    ##:::: ##: ##:::: ##: ##: ##: ##: ## ## ##:
:-                    ##:::: ##: ##:::: ##: ##: ##: ##: ##. ####:
:-                    ##:::: ##: ##:::: ##: ##: ##: ##: ##:. ###:
:-                    ########::. #######::. ###. ###:: ##::. ##:
:-                   ........::::.......::::...::...:::..::::..::
:-                   
:- 
:-                              .-.                      .-. _    .-.
:-                              : :                      : ::_;   : :
:-               .--.  ,-.,-. .-' :  .-..-..-. .--.    .-' :.-. .-' :
:-              ' .; ; : ,. :' .; :  : `; `; :' '_.'  ' .; :: :' .; :
:-              `.__,_;:_;:_;`.__.'  `.__.__.'`.__.'  `.__.':_;`.__.'
:-                                                                   
:-                                                                   
:-                          just talk to us,
:-                          when you spot us
 

Next, the client will join an IRC channel GLIBC_2.

Once joined, the server will reply its vendetta message aimed at Cado security, a company that reported about TeamTNT earlier.

:TeamTNT.IRC.Hub 332 DPAOKJ #GLIBC_2:CadoSecurity lies to look really good

After that, the client falls into a waiting state, periodically sending PING commands to the server and receiving PONG responses.

We’ve got a bee! (or, is it a fly?)

After approximately two days of running, the honeypot has finally registered a remote command sent by the attackers to the IRC bot running in the virtualised honeypot:

:!* SH netstat -ntl | grep -v grep | grep -v “:1982 ” | grep -v “:6697 ” | grep -v “:1982 ” | grep -v “:2105 ” | grep -v “:51982 “

The request starts from the “SH “ command, which is then parsed by the bot and executed with popen() function — a function that opens a process by invoking the shell.

With this remote command, the attackers have executed netstat command to see what ports were open on the ‘router’. The command was accompanied with a filter to exclude ‘noisy’ ports from reporting.

The bot complied — it executed the netstat command, and then sent back the output as a private message, using the NOTICE command. The message stated that the ‘router’ had only one port open: SSH port 22.

NOTICE NKDE:Active Internet connections (only servers)

NOTICE NKDE:Proto Recv-Q Send-Q Local Address Foreign Address State

NOTICE NKDE:tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN

NOTICE NKDE: NKDE!~NKDE@[HONEYPOT_IP_ADDRESS] QUIT:Client closed connection

If the router’s SSH server is not hidden behind an ISP’s NAT, the attackers might then attempt to connect to it directly, either by using default credentials or by brute-forcing them.

The ultimate goal of the attackers is to infect a compromised device with an XMRig coinminer, also built for ARMv7 CPU.

As an extra feature, the IRC bot itself can be instructed to initiate a DoS attack against other targets.

As their Message of the Day claims, they’ve done this before.

Rony Moshkovich

Rony Moshkovich

Rony Moshkovich, Director of Product for AlgoSec, has decades of practical research and engineering experience in the IT security industry. His background includes extensive management experience with an emphasis in software research and development, making him uniquely capable of guiding business requirements, and professional services for Enterprise, SMB, and consumer solutions.

Table of contents

Table of contents item

Ready to take control of your network security?

See how AlgoSec Horizon Platform can transform your security policy management – from chaos to control!

[Placeholder - Marketo will create the error message]
[Placeholder - Marketo will create the error message]
[Placeholder - Marketo will create the error message]
[Placeholder - Marketo will create the error message]
[Placeholder - Marketo will create the error message]
[Placeholder - Marketo will create the error message]
By submitting this form, I accept AlgoSec's privacy policy
[Placeholder - Marketo will create the error message]
Thank you!
AlgoSec
LinkedInYouTube
Trending topics
AlgoSec & CiscoMicro-segmentationCloud network securityCloud security complianceHIPAA network compliance
Essential tools
Integrations
Useful info
Contact usEnd user license agreementSaaS SLAEnvironmental strategyESG strategySecurity center

© 2004 – 2026 All rights reserved by AlgoSec

Privacy policyTerms of useCookie settings