Analysis Malicious JAR ( Part 2 )
After importing the malicious JAR file into JD-GUI, we identify several key components:
-
metasploit.dat: Likely contains configuration data or payloads related to the Metasploit Framework.
-
phNGgjyA.exe: An executable dropped during dynamic analysis, confirming its link to the JAR file.
-
metasploit: A possible module or component of Metasploit used for exploitation.
-
META-INF: Includes metadata such as the
MANIFEST.MF
file, which may reveal the file’s structure and entry points.
These elements suggest a sophisticated attack leveraging Metasploit, warranting deeper investigation to fully understand its behavior. After opening metasploit.dat
, which likely contains configuration or payload data related to the Metasploit Framework, we uncover some noteworthy details:
-
Spawn=2: Indicates that the malware may spawn multiple instances or processes, potentially to aid persistence or evade detection.
-
Executable=phNGgjyA.exe: Confirms that
phNGgjyA.exe
is the primary payload dropped by the JAR file, highlighting its central role in the attack.
These findings further reinforce the conclusion that the JAR file is part of a Metasploit-based attack, with phNGgjyA.exe
serving as a key component in its execution.
Note: I used https://www.decompiler.com to open the metasploit.dat
file, as JD-GUI is unable to read or decompile .dat
files.
Continuing our analysis, after inspecting Payload.class
, we uncover several code segments that provide deeper insight into the malicious behavior:
-
properties.getProperty("DroppedExecutable")
: Indicates the malware retrieves the name or path of a dropped executable—likely referring tophNGgjyA.exe
. -
File file3 = new File(file2, "metasploit.dat")
: Shows the creation of ametasploit.dat
file, likely for storing configuration or payload data, reinforcing its link to Metasploit. -
File file1 = File.createTempFile("~spawn", ".tmp")
: Suggests the malware generates a temporary file, possibly for stealthy payload execution or storage. -
InputStream inputStream = clazz.getResourceAsStream("/metasploit.dat")
: Reveals thatmetasploit.dat
is accessed as an embedded resource within the JAR, supporting its role in further malicious operations.
These lines collectively illustrate how the malware manages its components and behavior, pointing to a structured, Metasploit-based attack.
Scrolling further through the code, we uncover additional details that shed light on the malware’s configuration and behavior:
-
int j = Integer.parseInt(properties.getProperty("LPORT", "4444"))
: Retrieves the listening port (LPORT
), defaulting to 4444. This port is commonly used by the Metasploit Framework for reverse shell communication. -
String str4 = properties.getProperty("LHOST", (String)null)
: Retrieves theLHOST
, which defines the attacker's IP address or hostname. The value is currentlynull
, indicating that the attacker's host is not explicitly set and may be configured elsewhere. -
String str5 = properties.getProperty("URL", (String)null)
: Retrieves aURL
property, which could point to a command-and-control (C2) server or a location from which the malware fetches additional instructions. -
InputStream inputStream1 = null
: Appears to be an uninitialized input stream, potentially used later for reading resources or configurations.
The presence of LPORT=4444
reinforces the likelihood that this malware is leveraging Metasploit’s default reverse shell setup. However, the absence of a defined LHOST
suggests that the attacker’s connection details may be hidden or dynamically configured at runtime. Further analysis is needed to determine how and where the malware establishes communication with the attacker's system.
As we scroll further through the code, we encounter evidence suggesting that this malware is designed to operate across multiple operating systems, including both Windows and Linux. The relevant code reveals its cross-platform capabilities:
-
IS_AIX
: Indicates that the malware checks for files in Java directories specific to AIX, a Unix-based operating system. -
addExtension
: Appends the.exe
extension for Windows systems but omits it for Linux, showing awareness of OS-specific file conventions.
This approach demonstrates that the malware is built with adaptability in mind, allowing it to adjust its behavior based on the underlying operating system—enhancing its versatility and effectiveness across different environments.
Comments
Post a Comment