Research, Security

Dissecting Malicious Network Traffic To Identify Botnet Communication

by Swasti Bhushan Deb

Botnets are well-known in the domains of information security, digital forensics and incident response for hosting illegal data, launching DDOS attacks, stealing information, spamming, bitcoin mining, spreading ransomware, launching brute force attacks, managing remote access to connected devices, and even propagating infection to other devices, among other things. Internet Relay Chat (IRC) networks are a popular medium for controlling bot networks. IRC-based bots with unpredictable degrees of sophistication and customized commands have something in common. An IRC bot, when executed in a client machine, connects to IRC server on random higher ports, logs into a definite predefined channel and listens for commands issued by the bot master.

The botnet lifecycle starts with the infection phase where a system is compromised by a customized and preconfigured piece of malware. The connection phase is when the infected system initiates contact on a predefined remote IRC TCP service port for communication. A nickname, password or key may authenticate the bot’s access to the channel. In the command & control phase, the bot receives commands from the bot master via the designated channel of communication (C2C). Finally in the multiplication phase, customized and preconfigured malware is downloaded into the infected bot for further control and to spread infection via USB devices, writable network shares and so on.

This article intends to showcase a proof of concept aimed to analyse unique communication to / from an infected host and botnet. The network capture used can be found here. The analysis was carried out using Wireshark. The analysis and observations will assist in initial investigation of the network capture to identify traffic illustrating typical bot behaviour – joining a predefined channel with a nickname or username; messages exchanged between the bot and the bot master; spreading infection, and so on.


  1. A total of 60 packets were observed to be present in the pcap file. IP addresses identified:
    1. port 1037 (service: ams) ;port 1038 (service: mtqp)
    2. port 53 (service : DNS)
    3. Resolved Address- ;TCP port 5540 (service : sdreport)
  2. IP,port 1037 initiates a DNS query to, port 53 for name resolution of DNS Response from at and
  3. Packets-3,4,& 5 detail TCP three way handshake. The handshake was initiated from,port 1038 & destined to (,port 5540).
  4. Packet 6: IRC “PASS” message was used to set a ‘connection password’ by the host bot- is used to register a connection with an IRC server- (
  5. Packet 8:IRC “NICK” message used to provide user a nickname (pLagUe{) by host
  6. Packet 10:IRC “USER” message was used to specify the username by host The original parameters alongside the message are in the format <username> <hostname> <servername> <realname>.The username was identified as “sKuZ” and real name as “TeaM UniX b0at 0.4”
  7. Packet 12: IRC ( replies back to host ( The reply originates from server “”. Indicates authorization message by the server.
  8. Packet 15: IRC pings the client ( with a hostname as it could not resolve the hostname. The PING command was used to test the presence of the client bot.
  9. Packet 16: The PONG response indicates a reply by the client bot to the ping message of the ICR Server.
  10. Packet 18: Communication indicates replies from server “” which was created on “mar 25 2011 at 02:34:51 CET” and is running “Unreal3.2.9-rc1” (an open source IRC server). The IRC server welcomes the client bot with a series of additional replies. As per RFC 2812,the series of replies indicates successful registration by the client bot.
  11. Packet 19: Indicates message from the client host to change visibility mode to a hidden user on the IRC server.
  12. Packet 21 & 23: JOIN command issued by the client bot and request to start listening to the specific channel –“ verga”.
  13. Packet 25: PRIVMSG used by the client to send private message to channel “verga”. The message “NueVo PuTo InfeCcIoN” in Spanish translates to “New WhOre InfeCtIOn” in English.
  14. Packet 27: Details the command response from the IRC server. Indicates 56 users and 189 invisible on 9 servers. Informs the client host that the nickname isn’t registered.
  15. Packet 30-43: Indicates re-registration initiated by the client bot.
  16. Packet 45: Indicates command message from Bot “pLagUe” to download an executable “plaga.exe” hosted at into the system drive of the client bot ( c:\jiji).
  17. Packet 53:Details the response from the client bot to the IRC server indicating infecting virus into “autorun.inf” of (most likely attached) USB devices.

IRC Communication summary

Table 1 Packet wise description

  • The interpretation of the IRC commands are based on RFC 2812.
  • The host at joined ( with username “sKuZ” and joined channel “verga”.
    The pLagUe{USA}64007 bot instructs the client bot ( to download an executable- “plaga.exe” hosted at, store it in the system drive (c:\jiji) and inject itself into “autorun.inf” of attached USB devices. This indicates the propagation mechanism used in this case.
  • The executable “plaga.exe” hosted at was flagged as a malware by VirusTotal. The VirusTotal graph indicates multiple malware instances hosted by subdomains of

From the observations cited above, it would be reasonable to conclude that the host at made a DNS query to for resolution of It is assumed that the host at could be infected with a IRC Trojan which initiated TCP connection to, logged into a predetermined IRC channel and based on the commands issued by the bot master, spread further infection by infecting the autorun.inf of the attached USB devices.


Capture File Properties: A quick glance at the pcap file using Wireshark indicates a total of 60 packets. This can be achieved using the “Capture File Properties” window by selecting the “Capture File Properties“ option from the Statistics drop-down menu.

TCP Stream: An excerpt of the TCP stream is detailed below and indicates 19 client packets and 13 server packets. The “Follow TCP Stream” window can be used to visualize protocols in the way that the application layer sees it. This can be achieved right clicking on any TCP packet and selecting Follow =>> TCP Stream. Figure 1 describes the TCP stream and relevant information required to understand bot communication.

Figure 1 Excerpt of TCP Stream

1-Connection password set by the host bot
2-Nickname set by the host bot
3-Username set by the host bot
4-Notice from IRC server
5-PING command from IRC server & PONG response from bot
6-IRC network info
7-Visibility mode set by client bot as hidden
8-Client bot request message to start listening on specific channel – “verga”
9-Private message from client bot on channel – “verga”
10-Additional message indicating the number of active channels, local users, online operators etc. on the IRC server
11-Request message indicating a re-registration attempt of the client bot to listen on channel “verga”
12-Message from the botnet – pLagUe to download an exe (plaga.exe) from
13-Private message from client bot indicating successful injection of the exe into autorun.inf of four USB devices

“Protocol Hierarchy Statistics”: Packets usually contain multiple protocols. The “Protocol Hierarchy Statistics” window reflects a tree of all the protocols in the capture. This serves as an initial assessment in understanding major protocols present in the capture. Applying the TCP “Data” field as a display filter lists the TCP packets containing data. The protocol hierarchy chart in Wireshark can be generating by selecting the “Protocol Hierarchy“ option from the Statistics drop-down menu.



About scar

Scar de Courcier is an assistant editor at Forensic Focus.


No comments yet.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 1,163 other followers

%d bloggers like this: