VERDICT: HIGH RISK
The provided Android application code exhibits several concerning behaviors strongly indicative of malicious intent. The risk level is assessed as HIGH due to the presence of multiple red flags consistent with sophisticated Android malware techniques. The analysis below details the specific malicious behavior patterns observed:
1. Dynamic Code Loading (HIGH): The function comeOn
demonstrates a pattern of dynamically loading and executing code. The app fetches files (potentially DEX or ELF) using getCacheFilePath
and downloadFile
, then attempts to execute them using getDexClassLoader
. This is a classic technique for delivering malicious payloads after initial installation, allowing the malware to easily update its functionality and evade static analysis. The use of custom decryption (decryptFile
, decryptAES
) further enhances the obfuscation and anti-analysis capabilities, indicating a deliberate attempt to conceal the loaded code’s true nature.
2. Custom Decryption and Execution (HIGH): The decryptFile
function performs custom decryption of a file, likely to obfuscate the malicious payload. The decryption utilizes an AES algorithm, which adds a layer of complexity to the reversal process. In combination with the dynamic loading, this points strongly towards a sophisticated malware strategy. The decrypted file is then written to disk (fopen
, fwrite
) and executed using a custom class loader.
3. Time Cloaking (MEDIUM): thread_function
incorporates time-based cloaking. It checks the user’s timezone (getTimeZoneInfo
) and potentially alters behavior if the timezone is not “America/Sao Paulo”. More importantly, it appends a timestamp ("?time=" + current time
) to a string used for downloading further files. This suggests an attempt to evade detection by changing behavior based on the device’s time and potentially making analysis more challenging by dynamically creating different network requests.
4. Network Cloaking (MEDIUM): thread_function
exhibits additional cloaking behavior, though details are limited. The function interacts with network resources to download additional resources, showing its network-active nature. The data used in network operations are likely obfuscated through string manipulation and URL obfuscation, making identification and analysis difficult. The precise cloaking mechanisms used are not fully clear from the decompiled code, but the presence of this behavior is a significant concern.
5. Obfuscation Techniques (HIGH): The entire codebase uses extensive obfuscation techniques. The code is heavily reliant on complex data structures (deques, hash tables, trees) and intricate control flow. Function and variable names are nonsensical, hindering analysis. The use of multiple layers of indirection, combined with aggressive heap memory management (operator_new
, operator_delete
), makes the code difficult to understand and analyze. These obfuscation methods are typical of malware aiming to evade reverse engineering.
6. Anti-Debugging/Anti-Analysis Techniques (HIGH): The JNI_OnLoad
function includes a call to ptrace(PTRACE_TRACEME, 0, 0, 0)
. This is a clear indicator of an attempt to detect debugging or analysis tools. If a debugger is attached, this function’s behavior will likely differ; it could crash, stall the execution, or even hide its malicious code.
Conclusion:
The combination of dynamic code loading, custom decryption, sophisticated obfuscation, and anti-debugging techniques creates a high likelihood of malicious activity. The incomplete understanding of the role of several custom functions further aggravates the risk. The app’s behavior is heavily contingent on received data and time-sensitive factors, raising serious concerns about its potential for wide-ranging malicious acts. Immediate action should be taken to contain and investigate this application further. A detailed sandbox analysis is critical to identify any network communications, file system manipulation, or other abusive activities.