Flashback OS X Malware Broderick Ian Aquilino – September 27, 2012 Protecting the irreplaceable | f-secure.com
Agenda • Infection Vector • Installation • Main Binary • C&C Servers • Payload • Remaining Binaries • Filter/Loader Binary • LaunchAgent Binary September 27, 2 2012
Infection Summary Hacked Distribution Website Website Launch Installer Main Binary Agent Filter / Loader September 27, 3 2012
Infection Vector Hacked Distribution Website Website Launch Installer Main Binary Agent Filter / Loader September 27, 4 2012
Infection Vector September 27, 5 2012
Infection Vector September 27, 6 2012
Infection Vector September 27, 7 2012
Infection Vector • CVE-2008-5353 • CVE-2011-3544 • CVE-2012-0507 September 27, 8 2012
Installation Hacked Distribution Website Website Launch Installer Main Binary Agent Filter / Loader September 27, 9 2012
Main Binary Hacked Distribution Website Website Launch Installer Main Binary Agent Filter / Loader September 27, 10 2012
Main Binary: Update Server • Creates a thread that connects to a set of C&C servers to download updates every 3670 secs (>1hr) Generated list Returned by a based on date Hardcoded list third party (*new variants server only) September 27, 11 2012
Main Binary: Update Program • Response: • %marker1%%encoded_VM_program%%marker2% %encoded_MD5_RSA_signature%%marker3% • Log SHA1 of VM program • {HOME}/Library/Logs/swlog • {HOME}/Library/Logs/vmLog September 27, 12 2012
Main Binary: Payload C&C (Newer Variants) • Same thread will also connect to another set of C&C servers • This time to select a server for executing the payload Updateable list Hardcoded list Generated list (Entry ID (Entry ID based on date 3035856777) 2522550406) September 27, 13 2012
Main Binary: Payload C&C (Old Variants) Hardcoded list (Entry ID 2413278617) • Selected only once - when binary is loaded September 27, 14 2012
Main Binary: Payload C&C Validation • Response • %SHA1_string_of_server_name% | %MD5_RSA_signature% • Use (2 nd – old variant / 1 st – new variant) host in hardcoded list as default server • Use “ localhost ” if configuration entry does not exists (new variant only) September 27, 15 2012
Main Binary: Payload (Old Variants) Outbound Inbound CFWriteStreamWrite CFReadStreamRead send recv September 27, 16 2012
Main Binary: Payload (Old Variants) Outbound Inbound Contains target To Google? string? Pls reply in a format Inject content that is parseable September 27, 17 2012
Demo September 27, 18 2012
Main Binary: Payload (Newer Variants) Browser Command CFWriteStreamWrite and Control Other Modules Destination Google CFReadStreamRead September 27, 19 2012
Main Binary: Payload (Newer) -> Search Browser Command CFWriteStreamWrite and Control Keyword and other info Other Modules Destination Google CFReadStreamRead September 27, 20 2012
Main Binary: Payload (Newer) -> Search Browser Command Original search CFWriteStreamWrite and Control request Redirection data and/or other commands Other Modules Destination Google Google CFReadStreamRead search result September 27, 21 2012
Main Binary: Payload (Newer) -> Click Browser Command Redirection CFWriteStreamWrite and Control info Tracking info Other Modules Destination Google Redirection CFReadStreamRead info September 27, 22 2012
Main Binary: Payload (Newer) -> Click • Google return the request in the response September 27, 23 2012
Main Binary: Payload (Newer) -> Click Browser Command CFWriteStreamWrite and Control Request to new destination Other Modules Destination Google Redirection script CFReadStreamRead September 27, 24 2012
Main Binary: Payload (Newer) -> Click Browser Command CFWriteStreamWrite and Control Request with modified referrer Other Modules Destination Google CFReadStreamRead September 27, 25 2012
Demo September 27, 26 2012
Filter/Loader Binary Hacked Distribution Website Website Launch Installer Main Binary Agent Filter / Loader September 27, 27 2012
Filter/Loader Binary September 27, 28 2012
Filter/Loader Binary September 27, 29 2012
LaunchAgent Binary Hacked Distribution Website Website Launch Installer Main Binary Agent Filter / Loader September 27, 30 2012
LaunchAgent Binary • Stand-alone light version of the updater module found in the main binary • Uses different set of C&C servers Generated list Generated list based on Hardcoded list based on date constants • Similar server validation process • Logs CRC32 of the update/installation program • /tmp/.%crc32_of_VM_program% • Have it’s own instruction set September 27, 31 2012
LaunchAgent Binary - Recent Variant September 27, 32 2012
LaunchAgent Binary - Recent Variant • Taken over the responsibility of installing the malware September 27, 33 2012
Thank you! Please check out the conference paper for more details. broderick.aquilino@f-secure.com
Recommend
More recommend