In May, US President Trump set into motion a series of requirements to obtain an understanding of where US federal agencies stood in terms of readiness to ward off cyber attacks and assured the American public his administration valued the importance of understanding the risk, mitigating it and building a world-class workforce.
As a CISO for several organizations, including a major healthcare contractor to the US government and a global accounting firm engaged in government contracts, I have watched the evolution of the US federal government’s focus on cyber security with great care. It has always been important, but as the tools and criminals become more sophisticated, our work to benchmark our current status, manage risk and develop a highly skilled workforce of tomorrow becomes even more critical.
My professional association, ISACA, for which I’ve spent over a decade providing information security presentations and certification workshops, and whose work I am highly passionate about, also supports a strong focus on cyber security risk management and workforce development. By mid-July, the federal agencies owe the Office of Management and Budget (OMB) and Department of Homeland Security (DHS) a risk management report or current assessment. It is the next milestone in the US Executive Order Strengthening the Cybersecurity of Federal Networks and Critical Infrastructure. They will need to report information based on FY 2017 FISMA CIO metrics so everyone is reporting based on a consistent methodology. It must be based on 2016-2017 Guidance of Federal Information Security and Privacy Requirements.
Then, the OMB and DHS will use the FISMA metrics to produce agency-specific risk assessments in a report to the President. The results will serve as a way to identify new needs and offer ways to think about how to offer services differently to improve cyber security. In the future, agencies will have to conduct reviews bi-annually.
The order also calls for an action plan for implementing a framework that reduces risks and allows the network to:
Identify
Protect
Detect
Respond
Recover
Aligning with the NIST Special Publications, as well as other associated standards and guidelines, this structure will provide a common vocabulary and process sharing across the agencies. The framework plan is also due in mid-July.
From a cyber security practitioner’s viewpoint, while the timeframe is aggressive, the order is welcomed because 1) it acknowledges the importance of our interconnected government and that risks in one agency or critical infrastructure may impact others; 2) the approach is from a risk management perspective (vs. compliance), and requires an explanation as to why choices were made (strategic, operational, and budgetary considerations) to accept the current level of risk; and 3) it indicates a desire to move to current technology and updated systems.
After the reports and planning are in, there will need to be a time for reflection—a time to analyze our current situation and how we are best served as we enter a new era. Customized training will be critical. Traditional four-year degrees in computer science may not be our path forward in our new world. We’ll need to engage partners from academia, Veterans Affairs (veterans have a strong skill set that could be leveraged) and private industry.
ISACA offers cyber security training and supports exploring opportunities for non-traditional educational training to build a hardened IT infrastructure.
As a cyber security professional who has had the opportunity to see many changes throughout the landscape of my career, I believe thinking differently allows us to offer solutions that will strengthen our borders and build a more prepared workforce.
Todd Fitzgerald, SVP and Chief Administrative Officer, Information Security and Technology Risk, Northern Trust, Chicago
Recently, we discovered a new version of the OceanLotus backdoor in our WildFire cloud analysis platform which may be one of the more advanced backdoors we have seen on macOS to date. This iteration is targeted towards victims in Vietnam and still maintains extremely low AV detection almost a year after it was first discovered. Despite having been in the wild for an extended period of time, the operation appears to still be active. During our analysis, we were able communicate directly with the command and control server as recently as early June 2017.
While there seem to be similarities to an OceanLotus sample discovered in May 2015, a variety of improvements have been made since then. Some of the improvements include the use of a decoy document, elimination of the use of command line utilities, a robust string encoding mechanism, custom binary protocol traffic with encryption, and a modularized backdoor.
Infection Vector
The new OceanLotus backdoor is distributed in a zip file. While we don’t have direct evidence for the initial infection vector we presume it’s most likely via an email attachment. Once the user has extracted the zip file, they see a directory containing a file with a Microsoft Word document icon. The file is actually an application bundle, which contains executable code. (see Figure 1). Once the user double clicks on the purported Word document, the Trojan executes and then launches Word to display a decoy document.
The malware uses the decoy document to help mask the execution of the malware. This technique is a common one for Windows-based malware, but rare on macOS. In order to achieve this layer of obfuscation, the malware author had to trick the operating system into believing the folder is an application bundle despite the .docx extension. Traditionally, macOS malware have emulated legitimate application installers such as Adobe Flash, which was how the previous version of OceanLotus was packaged.
Figure 1. Context menu and file listing
Once the application bundle is launched, it opens a hidden file in the bundle’s Resources folder named .CFUserEncoding which is a password-protected Word document (see Figure 2). It also copies this file to the executable path and essentially replaces the application bundle after persistence has been set up. This would lead the victim to believe that nothing was amiss, as they thought they were opening a Word document and a Word document opened. In this case, the Word file has the name “Noi dung chi tiet.docx”, which is Vietnamese for “Details.”
Figure 2. Decoy document prompts for a password to open the file
Persistence
Compared to the previous version of this backdoor, the persistence mechanism for this remained largely the same. This version creates a Launch Agent that runs when the victim host starts up, where as in the previous version execution was upon when a user logs in. It also copies itself to a different location and filename based on the UID of the user who ran the application.
For a user other than root, it takes the MD5 hash of the structure returned by getpwuid() and breaks the hash down into segments <first 8 chars of hash>-<next 16 chars of hash>-<last 8 chars of hash>. This segmented MD5 hash is prepended with “0000-“ then used as a directory in ~/Library/OpenSSL/ to store the executable file (see Figure 3). If the user is root, the executable is stored in the system wide library directory at /Library/TimeMachine/bin/mtmfs.
It is interesting to note that the executable and plist locations look like legitimate applications.
Figure 3. plist and executable names and locations based on UID
Once the malware has set up persistence, it deletes the application bundle from the executable path leaving the decoy document in its place and launches itself as a service from the new location.
No Command Line Utilities
One of the first things we noticed about this backdoor is the lack of suspicious strings which often times provides context as to what the malware might do on a victim host. In most macOS malware, calls to the system() or exec() functions to run additional scripts are in place. In this case, these were not present nor were there command line utility strings that may easily convey the malicious intention of the application. This shows a deep level of understanding of the macOS platform by the author of this backdoor compared to other threat actors that will commonly copy and paste scripts from the Internet.
The lack of these strings may also double as an anti-analysis technique to make the malware seem less suspicious, especially to basic static analysis.
String Decoding
Since there appear to be no obvious suspicious strings in plaintext, we move onto the possibility of use of encoded, or obfuscated strings.
The string decode routine for this backdoor is an upgrade from previous versions in which strings were XOR encoded with the word “Variable” as a key. The string decode routine now consists of a combination of bit shifting and XOR operations with a variable key that depends on the length of the string that was encoded. If the computation for the variable XOR key turns out to be 0, the default XOR key of 0x1B is used. Figure 4 shows a Python implementation of the decode function.
Figure 4. Python implementation of the malware’s string decode function
After decoding the strings (see Figure 5), we can glean that the malware sets up persistence, surveys the victim’s computer, and sends this information back to a server. At this point, it is still not obvious that this malware contains backdoor functionality.
Figure 5. List of decoded strings
Custom Binary Protocol and Encrypted Traffic
The threat actors responsible for this malware appear to have spent some amount of effort to develop their own custom communication protocol. They did not simply use an off-the-shelf web server for their command and control server, as is commonly done. Instead, they created their own command and control mechanism.
The backdoor uses a custom binary protocol on TCP port 443, a well-known port that is unlikely to be blocked by traditional firewalls due to its use in HTTPS connections. The packet seen in Figure 6 is encoded with a combination of bit shifting (see Figure 7) and XOR with a key of 0x1B before it is sent. The bits are always rotated to the left 3 times before doing the XOR operation. This is an improvement from the previous version where the packet was only XOR encoded with a key of 0x1B.
Figure 6. Initial packet sent by the client to the server
Figure 7. Bit shifting function used in the encode/decode routine for network packets
After decoding the packet, we can see a breakdown of different fields. Figure 8 shows the initial packet sent by the client to the server. It is relatively empty aside from the “magic” bytes, length of data and type of communication.
Figure 8. Initial packet sent by the client to the server (decoded)
Depending on the command response sent from the server, a packet may be bigger than 0x52 bytes. Data beyond 0x52 bytes is zlib compressed then encrypted with AES in CBC mode with a null initialization vector (IV) and a key sent from the server that is padded to 32 bytes.
We captured live traffic from the server, and observed that the encryption keys sent from the server are ephemeral. This means that each new session with the server is given a different key used to encrypt data sent back and forth within that session. This is a marked improvement compared to the previous version, where only XOR encoding with a one-byte key was used for encryption.
After decoding the packet it receives from the server, the backdoor validates certain fields like the “magic” bytes and makes sure the length of the data being received is not over a certain amount. Throughout the program execution, it also checks and handles any errors that may have been generated.
Command and Control Communications
The command and control server communication sequence is as follows:
The client initiates a session with the server by sending a packet with 0x2170272 in the command field.
The server then responds with an ephemeral encryption key and a command.
The client checks if the received packet from the server is valid.
The client executes the command sent by the server and responds with a zlib compressed and AES encrypted blob of the result then sends this back to the server.
Unlike the previous versions of OceanLotus where the commands can be easily gathered from its strings, the author has obfuscated the functions with constant values. We decoded the following available commands as seen in Figure 9.
Command
Command Description
0x2170272
Initialize
0x5CCA727
???
0x2E25992
receive file from server
0x2CD9070
get info on a file / directory
0x12B3629
delete file / directory
0x138E3E6
???
0x25D5082
execute function from a dynamic library
0x25360EA
send file to server
0x17B1CC4
???
0x18320E0
send victim and computer information together with the backdoor’s watermark
0x1B25503
execute a function from a dynamic library
0x1532E65
execute a function from a dynamic library
Figure 9. List of commands available
Command 0x2170272
When the backdoor is launched, a file is created in /Library/Preferences/.files or ~/Library/Preferences/.files depending on the victim’s user ID. This file (see Figure 10) contains a timestamp and the victim’s name concatenated with the machine’s serial number which is then hashed twice with MD5. This is then copied to a buffer that is 0x110 bytes long and AES encrypted in CBC mode with a null IV and a key of “pth”. It is then saved into the file.
Timestamp + MD5(MD5(<victim’s name + machine serial number>))
After this file is created, the client sends its first packet to the server with 0x2170272 in the command field. The server acknowledges and responds with the same command and the client verifies that the file has been created.
Figure 10. Decrypted contents of ~/Library/Preferences/.files
Command 0x18320E0
The server then sends this command with an ephemeral key shortly after it sends the 0x2170272 command. The client gathers all the data seen in Figure 11, encrypts it with the key provided by the server and sends it back. One thing to note is the Base64 string that is sent in this packet. This string is static in the binary and does not change, which may be indicative of a marker for campaign or version identification.
\x00\x00\x004137674062B3226FE630C24F7DE1021E\xe9\x0f\x00\x00\x00Mac OS X 10.X.X\xb6\x03\x00\x00
\x05\x01\x00\x00f\x00\x00\x00Model ID:iMac8,1\nCPU:Intel(R) Core(TM)2 Duo CPU T7700 @ 2.40GHz\nMemory:4.00\nSerial No:XXXXXXXXXXX\x00\x00\x00\x00
Figure 11. Decrypted contents of a packet sent by the client to the server
Not highlighted in Figure 11 but also included in this packet is the kernel boot time which may be used by the C2 server to help determine if the backdoor is being run in a sandbox environment.
Commands 0x25D5082, 0x1B25503, 0x1532E65
These commands load a dynamic library using dlopen() and obtains a function pointer to execute within that shared library using dlsym(). Unfortunately, we do not know which dynamic libraries or functions are used for each command since these are server supplied and we were not able to capture any communication that used these commands.
However, we can postulate that since the parameters to the functions have the same number of arguments with the first being a fairly large constant similar to the command constants, (see Figure 12) and the backdoor has a function for receiving files, it is possible that these functions correspond to a shared library that the server uploads to the victim host. This means that additional functionality can be added to this backdoor by loading modules directly from the C2 server.
Figure 12. Snippets showing loaded function pointers and their parameters
Conclusion
Most macOS malware in the wild today are not very complex, but threat actors have been quickly improving their tradecraft. The increased level of sophistication and complexity may be indicative of increased targeting of macOS hosts looking to the future. With this OceanLotus attack in combination with recent macOS versions of the Sofacygroup’stoolset, we have now observed multiple espionage motivated threat actors targeting macOS. It is imperative that the same types of strong security practices and policies organizations use to defend Windows devices are applied universally to include macOS devices as well.
Apple has already updated the macOS protection systems to address this variant of OceanLotus.
Palo Alto Networks customers are protected and may learn more via the following:
Samples are classified as malicious by WildFire
Domains and IPs have been classified as malicious and IPS signatures generated
AutoFocus users may learn more via the OceanLotus tag
Indicators of Compromise
Hashes
b33370167853330704945684c50ce0af6eb27838e1e3f88ea457d2c88a223d8b Noi dung chi tiet.zip
Two of the most pressing cybersecurity tasks of our time are the need to dramatically grow the size of the workforce, and to create one that is agile enough to keep up with the shifting sands of today’s business landscape. Infosec Europe’s keynote panel session “Building an Agile Security Team for the Future,” chaired by (ISC)²s EMEA managing director Adrian Davis, saw leading frontline professionals from travel search giants Skyscanner, to transport operator Network Rail and the UK government, discuss how these challenges might be addressed.
The first key insight was that an agile cybersecurity team cannot have fixed, traditional role boundaries. Having fluid job roles allows cybersecurity professionals the ability to learn new skills, aspire to achieve managerial positions and help other business units by working outside their “techie” comfort zones. Crucially, the ability to transcend fixed role boundaries gives the flexibility to adapt to a diverse array of threats. Network Rail CISO, Paul Watts, explained how professionals in his team are constantly talking to, and working with, professionals from other teams and departments, as they recognise that innovations must draw on as wide a pool of expertise as possible, and that cybersecurity now encompasses all business units.
Vicki Gavin, head of information security at The Economist Group explained that the key to achieving a team that transcends traditional role boundaries was to “hire for inclusivity, not exclusivity.” Pruning the job specs helped to draw in a more diverse pool of talent. Women, for example, are less likely to apply for roles with lengthy job specs, unless they believe they are fully competent at each one of them. It is also vital to remove unconscious bias from the recruitment process; for example, building role profiles around the last person who did the role means that recruiters are continuously hiring the same kind of person – largely older males – and failing to open doors to millennials, women and people from other professions.
Rather than exclusively hiring qualified off-the-shelf tech specialists, cybersecurity employers should broaden the talent net by hiring for attributes, rather than qualifications, and investing more in training. Instead of recruiters searching for superman. The truth is that it may be necessary to build superman from scratch. There are many ways to attract new people into the industry, and the answer can be on your doorstep. Watts explained that he found someone in marketing who had an interest in cybersecurity, but no experience in the role. He offered her a brief secondment with his team and she quickly picked up the skills and brought a completely new perspective to the team.
The panel remarked that while traditional recruits to the industry can be risk-averse and afraid of chaos, an agile security team is one that is innovative, prepared to “fail forward” and “doesn’t ask for permission, but asks for forgiveness.”
In a world where cybersecurity transcends any one business department, an agile security team must also be one that can speak the language of every business unit, from the board to the marketing team. It must be a team as diverse as the business it operates in, and a team that has technical knowledge garnished with soft skills. As one panellist remarked “in an increasingly amorphous industry, we need an amorphous workforce.”
When I began performing digital forensics more than 10 years ago, things were relatively simple. At that time, the complexity of digital forensics revolved around ensuring each artifact of relevance was identified, and the proper tools to analyze them were available to leverage against computers used by the suspect.
The computer(s) of the suspect were typically the only focus. In some instances, we were also having to deal with mailbox exports of corporate users. When mobile devices came onto the scene in 2008 timeframe, our single device analysis approach to investigations was disrupted significantly. What are these things? Why don’t my hard drive forensics tools work on phones? We “forensicators” had no idea what challenges we would face in the next decade.
The significant challenges facing digital forensics experts today are the vast amounts of devices and locations that may house the valuable information. It is no longer always the case that all data sought to derive a conclusion is on a single device or in a single location. While it is now common to analyze both the computer(s) and phones used by the suspect, there now must be consideration given to other mobile devices (tablets), cloud-based email, cloud-based storage, social media activity, game consoles, IoT devices and even wearables.
Forensics tools for mobile devices were historically valued based on how many phones were supported. We are now arguably down to four phone types that you will likely encounter. Even now as the forensics tools have advanced considerably, the collection of mobile devices requires different approaches than computers. In many instances, the trusted full forensic image of the evidence is not always available – only the data the phone manufacturer will allow you to have. With the drastic reduction in the types of phones you will now encounter, the value is now in the parsers for the applications. With the millions of mobile applications available, and the frequent updates, it continues to be a challenge for the mobile phone forensic platforms to keep up with the rapid pace.
Over the past decade, users have traded in their locally stored email from their Internet service provider (ISP) for the convenience of webmail platforms such as Gmail, Yahoo Mail, or Outlook.com. When users are using webmail services, it is very unlikely that their email will be stored locally and, compared to years past, only fragments of the email are available in Internet cache files. Depending on the nature of the investigation, forensicators may be given the needed access to collect this information from the provider for analysis. When involved in internal investigations involving employees, it is very unlikely that forensicators will be given this access. In addition, even if you can obtain the webmail credentials from the device analyzed, you are not permitted to log into their personal email account. Therefore, the Internet histories and limited file fragments are all that will be available.
This same scenario now applies to personal files as users have migrated this information to cloud-based storage such as Box, Google docs and Dropbox. The same difficulties as webmail email exist.
There are few investigations that do not have a social media component, either directly or indirectly. While Internet histories may demonstrate the usage of these sites, the available information related to all activity and communications can be difficult to extract from the device alone. While the social media providers likely have extensive activity available for each user, this information would require subpoena power that you may or may not have.
Lastly, the IoT phenomenon is also significantly impacting the digital forensics field to provide types of information we have not had in the past. From Internet cameras to fitness wearables, anything electronic may now be a potential target for collection and analysis. However, IoT devices pose similar challenges to that of mobile devices in 2010. There are thousands of different types of devices and little to no standardization. With that diversity and chaos, there are challenges for the collection, parsing, and analyzing of this information. As the mobile device forensic platforms exploded and faced challenges a decade ago, I predict the same for IoT devices going forward.
The overall goal of forensic analysts is to have confidence that every artifact has been properly identified, parsed and analyzed for an accurate conclusion. We have digital artifacts that we never dreamed of years ago. With the diversity of information and numerous locations where pertinent data may now be stored, it is a challenge to be certain you have everything you need.
I suggest that forensicators be patient, yet diligent, with the data sources available. As an artifact points to a data source that is not currently available, regroup and seek that information for additional analysis.
Much of what I learned about being a professional – and being part of a professional community – came through my association with ISACA.
As the first person in my family to graduate from college, I entered the workforce hungry for the educational resources, networking and professional growth opportunities to make an impact. ISACA provided that and much more, allowing me to envision and embark upon a career trajectory that otherwise would not have been possible.
My professional development was accelerated by pursuing ISACA volunteer opportunities such as helping to coordinate local conferences, which allowed me to make valuable industry contacts and build my project management skills. Eventually I became president of ISACA’s Greater Washington DC Chapter, providing another important opportunity to expand my skill set and learn more about the audit and assurance, governance, risk, and information and cyber security professions. Serving on several ISACA committees and on the board of directors provided further enrichment, both professionally and personally, as I am fortunate to have built treasured relationships with many of ISACA’s 130,000-plus members worldwide.
Now, as the newly installed chair of ISACA’s board of directors, I am grateful for the opportunity to help lead the organization that has provided me so much fulfillment. I’m privileged to work with and on behalf of our global professional community to advance the positive potential of technology in the professions that we serve and society as a whole.
ISACA is nearing its 50-year mark, and with technology-driven challenges and opportunities all around us, there is no doubt we are more relevant than ever. In addition to ongoing activities building toward our 50th anniversary in 2019, there is so much to accomplish in the year ahead. Cultivating a deeper pipeline of leaders in our professions through the Leadership Development Advisory Council, building toward greater societal impact through a revitalized foundation and ensuring ISACA’s Connecting Women Leaders in Technology program becomes even more robust and influential are among many projects for which there is promising momentum.
As we anticipate the progress ahead, I want to express my appreciation for the many contributions of our outgoing board members, as well as our outgoing board chair, Chris Dimitriadis. Chris has led with a calm and good-natured approach, steering ISACA through a period of growth and change while making sure that local chapters and all members of our community are heard and included.
I am delighted that Chris will be part of the smart, dedicated and diverse group of board members for 2017-2018 that will help shape ISACA’s vibrant future:
Brennan Baybeck, CISM, CISSP, CISA, CRISC, director
Zubin Chagpar, CISA, CISM, PMP, director
Peter Christiaans, CISA, CISM, CRISC, PMP, director
Hironori Goto, CISA, CISM, CGEIT, CRISC, ABCP, director
Mike Hughes, CISA, CRISC, CGEIT, director
Leonard Ong, CISA, CISM, CGEIT, CRISC, CFE, CIS, CISSP, CPP, CSSCP, ISSAP, ISSMP, PMP, director
R.V. Raghu, CISA, CRISC, director
Jo Stewart-Rattray, CISA, CISM, CGEIT, CRISC, director
Ted Wolff, CISA, director
Tichaona Zororo, CISA, CISM, CRISC, CGEIT, CIA, CRMA, director
Chris Dimitriadis, CISA, CISM, CRISC, ISO 20000 LA, director and past board chair
Robert E Stroud, CGEIT, CRISC, director and past board chair
Tony Hayes, CGEIT, AFCHSE, CHE, FACS, FCPA, FIIA, director and past board chair
Matt Loeb, CGEIT, director and CEO
While the board will work diligently on ISACA’s behalf, it will take a team effort – all of us collaborating as ONE – to achieve all that we can. We live in a world that is grappling with widespread digital disruption. ISACA can and must be a leading voice in providing a sense of assurance and security as professionals and enterprises navigate a challenging technology landscape.
I know how influential ISACA can be, as evidenced by my own journey. I am proud of what ISACA has meant for myself and so many others, but more than anything, I am energized about the future that we can build together.
Theresa Grafenstine, CISA, CGEIT, CRISC, CPA, CISSP, CIA, CGMA, CGAP, chair of ISACA’s Board of Directors and inspector general of the U.S. House of Representatives