The help desk has received a few calls from different IT admins regarding the attached program. They say that they’ve been using this program with no problems until recently. Now, it’s crashing randomly and popping up blue windows when it’s run. I don’t like the sound of that. Do your thing!
pyTTY is an SSH and telnet client, developed originally for the Windows platform. PuTTY is open-source software that is available with source code and is developed and supported by a group of volunteers. But this version that we have seems to do some malicious activities, so, let’s see what is happening.
1- File Hash:
2- Virus Total Result:
As this binary is originally legal software, we will find a lot of strings, but I found some interesting ones.
1- First I found three Base64 indexing strings, first one is the original Base64 indexing string and the other ones maybe indicate that this infected version will perform custom Base64 encoding on some data.
2- Second thing I found is these three libraries. First, two seem to be normal according to the natural usage of the binary, but the third one indicates that this version maybe executes a hidden shell code.
3- The most suspicious thing is the third one which is the PowerShell command to execute Base64 encoded script.
So, we have some good indicators for the next stages, so, let’s perform the basic dynamic analysis.
When we run this binary, the first thing will be observed is that a PowerShell window will pop up
and if we look at Process Explorer we will find that the puTTy process will spawn a PowerShell process as a child process
If we take a look at Wire Shark we will see a DNS request to bonus2.corporatebonusapplication.local followed by failed TCP connections on port 8443
This URL doesn’t appear in strings so this may be resolved during the run time we will see.
If we use Netcat to listen on this port we will find that the malware will send encrypted data followed by the domain name.
So, this malware tries to establish a reverse shell on the victim machine but for some reason, the malware can’t establish it successfully.
If we take the encoded payload that appeared in strings and decode it we will get a compressed file and if we decompress this file we will get the PowerShell script.
So, when we look at this script we will observe that this malware can perform both bind and reverse shell based on the command that will be received with the same port 8443
And if we move to the end of this script we see the command that will be used
So, this malware will perform a reverse shell and the second parameter -Sslcon will also be set to true
If we look at the second variable in the script we will observe that the malware needs an SSL certificate for the domain name to complete this connection.
So, we won’t could to complete this connection because we don’t have the certificate.
But we can modify the PowerShell script to don’t use SSL certificates, so, the command will be
powerfun -Command reverse
and then run the script
we have full access to the victim machine.