SlideShare a Scribd company logo
Advanced malware analysis training session11 part2 dissecting the heart beat rat functionalities
Disclaimer
The Content, Demonstration, Source Code and Programs presented here is "AS IS" without
any warranty or conditions of any kind. Also the views/ideas/knowledge expressed here are
solely of the trainer’s only and nothing to do with the company or the organization in which
the trainer is currently working.
However in no circumstances neither the Trainer nor Cysinfo is responsible for any damage or
loss caused due to use or misuse of the information presented here.
Acknowledgement
 Special thanks to Null community for their extended support and co-operation.
 Special thanks to ThoughtWorks for the beautiful venue.
 Thanks to all the trainers who have devoted their precious time and countless hours to make it
happen.
Advanced Malware Analysis Training
This presentation is part of our Advanced Malware Analysis Training program. Currently it
is delivered only during our local meets for FREE of cost.
.
Who am I
Monnappa K A
 Member of Cysinfo
 Info Security Investigator @ Cisco
 Reverse Engineering, Malware Analysis, Memory Forensics
 Email: monnappa22@gmail.com
 Blog: http://malware-unplugged.blogspot.in
 Twitter: @monnappa22
 LinkedIn: http://www.linkedin.com/pub/monnappa-ka-grem-ceh/42/45a/1b8
 HeartBeat RAT Functionalities
 Part 2A - Demo
 Part 2B - Demo
 Part 2C – Demo
 Part 2D – Demo
 Part 2E– Demo
 Part 2F– Demo
 Part 2G - Demo
 References
 In this session, we will cover below HeartBeat RAT functionalities
o Part 2a) Decrypting various communications
o Part 2b) Functionality 1 - Process enumeration
o Part 2c) Functionality 2 - Process termination
o Part 2d) Functionality 3 - Create and Write to File
o Part 2e) Functionality 4 - Launch new application (create process)
o Part 2f) Functionality 5 - Reverse Shell
o Part 2g) Functionality 6 - Restart System
Advanced malware analysis training session11 part2 dissecting the heart beat rat functionalities
Below screenshot shows the encrypted process listing sent to the C2 server
Below screenshot shows the decrypted process listing
Below screenshot shows the encrypted reverse shell sent by the malware
Below screenshot shows the decrytped reverse shell
Advanced malware analysis training session11 part2 dissecting the heart beat rat functionalities
Since malware expects atleast 2056 bytes of data, sending more than 2056 bytes of fake data
Malware received the fake date we sent
Malware decrypts the received data from 9th byte
Malware checks if the first four byte is 01 00 00 00, so modifying the first four bytes
When malware receives the command code 1 (01 00 00 00), its enumerates processes on the
system
Malware encrypts the enumerated processes using the xor encryption algorithm
Malware sends encrypted process listing to the C2 (command and control) server
Advanced malware analysis training session11 part2 dissecting the heart beat rat functionalities
Malware checks if the first four byte is 02 00 00 00, so modifying the first four bytes
Malware interprets 9th byte as process id and terminates the process with that process id.
Lets give malware the process id of calc.exe
Malware opens handle to the calc.exe pid 1968
Terminates calc.exe process
Malware terminates the process by calling “TerminateProcess” API call
Malware Sends Encrypted Status Code
After terminating the process, malware encrypts the process termination status code and
sends it to C2
Advanced malware analysis training session11 part2 dissecting the heart beat rat functionalities
Malware checks if the first four byte is 03 00 00 00, so modifying the first four bytes
Malware Creates File
Malware reads the data starting from the 9th byte It interprets this as the file name and creates
a file
Malware Writes Encrypted Data
Malware receives data from C2, encrypts it and writes the encrypted data to the file.
Advanced malware analysis training session11 part2 dissecting the heart beat rat functionalities
Malware checks if the first four byte is 04 00 00 00, so modifying the first four bytes
Malware Launches Application
Malware reads bytes starting from the 9th byte and interprets this as the path to the application
to launch.
Sends Encrypted Status Code
After launching the new application, malware encrypts the application launch status code
and sends it to C2
Advanced malware analysis training session11 part2 dissecting the heart beat rat functionalities
Malware Checks for Command Code 5
Malware checks if the first four byte is 05 00 00 00, so modifying the first four bytes
Malware launches cmd.exe
Malware creates cmd.exe process
Malware creates Reverse Shell
Malware creates Reverse Shell
Sends Encrypted Reverse Shell
Malware sends encrypted reverse shell to the C2
Advanced malware analysis training session11 part2 dissecting the heart beat rat functionalities
Malware Checks for Command Code 0A
Malware checks if the first four byte is 0A 00 00 00, so modifying the first four bytes
Malware Restarts The System
Malware restarts the system
Thank You !

More Related Content

PPTX
Advanced malware analysis training session10 part1
PPTX
Reverse engineering malware
PPTX
Reversing and decrypting communications of apt malware
PPTX
Reverse Engineering Malware
PPTX
Advanced malware analysis training session1 detection and removal of malwares
PPTX
Reversing and Decrypting the Communications of APT Malware (Etumbot)
PPTX
Advanced Malware Analysis Training Session 11 - (Part 2) Dissecting the Heart...
Advanced malware analysis training session10 part1
Reverse engineering malware
Reversing and decrypting communications of apt malware
Reverse Engineering Malware
Advanced malware analysis training session1 detection and removal of malwares
Reversing and Decrypting the Communications of APT Malware (Etumbot)
Advanced Malware Analysis Training Session 11 - (Part 2) Dissecting the Heart...

What's hot (20)

PPTX
Reversing malware analysis training part3 windows pefile formatbasics
PPTX
Advanced malware analysis training session8 introduction to android
PPTX
Reversing malware analysis trainingpart9 advanced malware analysis
PPTX
Advanced malware analysis training session5 reversing automation
PPTX
Advanced Malware Analysis Training Session 7 - Malware Memory Forensics
PPTX
Advanced malwareanalysis training session2 botnet analysis part1
PPTX
Watering Hole Attacks Case Study and Analysis_SecurityXploded_Meet_june14
PPTX
Automating malware analysis
PPTX
Reversing malware analysis training part10 exploit development basics
PPTX
Advanced malware analysis training session6 malware sandbox analysis
PPTX
Advanced malware analysis training session 7 malware memory forensics
PPTX
Advanced malware analysis training session3 botnet analysis part2
PPTX
Advanced Malware Analysis Training Session 1 - Detection and Removal of Malwares
PPTX
Reversing malware analysis training part11 exploit development advanced
PPTX
Advanced Malware Analysis Training Session 8 - Introduction to Android
PPTX
Reversing malware analysis training part2 introduction to windows internals
PPTX
Reversing malware analysis training part1 lab setup guide
PPTX
Reversing malware analysis training part7 unpackingupx
PPTX
Dissecting the heart beat apt rat functionalities - Part 2
PPTX
Reversing malware analysis training part6 practical reversing
Reversing malware analysis training part3 windows pefile formatbasics
Advanced malware analysis training session8 introduction to android
Reversing malware analysis trainingpart9 advanced malware analysis
Advanced malware analysis training session5 reversing automation
Advanced Malware Analysis Training Session 7 - Malware Memory Forensics
Advanced malwareanalysis training session2 botnet analysis part1
Watering Hole Attacks Case Study and Analysis_SecurityXploded_Meet_june14
Automating malware analysis
Reversing malware analysis training part10 exploit development basics
Advanced malware analysis training session6 malware sandbox analysis
Advanced malware analysis training session 7 malware memory forensics
Advanced malware analysis training session3 botnet analysis part2
Advanced Malware Analysis Training Session 1 - Detection and Removal of Malwares
Reversing malware analysis training part11 exploit development advanced
Advanced Malware Analysis Training Session 8 - Introduction to Android
Reversing malware analysis training part2 introduction to windows internals
Reversing malware analysis training part1 lab setup guide
Reversing malware analysis training part7 unpackingupx
Dissecting the heart beat apt rat functionalities - Part 2
Reversing malware analysis training part6 practical reversing
Ad

Similar to Advanced malware analysis training session11 part2 dissecting the heart beat rat functionalities (20)

PPS
Viruses and Anti-Viruses
PPTX
Reversing and decrypting the communications of HeartBeat Rat - Part1
PDF
20111204 intro malware_livshits_lecture02
PPT
kuo-slides la seguridad de firewall ayuda a impedir q los hackers y el malwar...
PDF
2600 v09 n1 (spring 1992)
PPTX
Malware and Anti-Malware Seminar by Benny Czarny
PPTX
Malware 101 by saurabh chaudhary
PPTX
Introduction to Malware Analysis
PDF
Spo2 t19 spo2-t19
PDF
CH1- Introduction to malware analysis-v2.pdf
PDF
Reading Group Presentation: The Power of Procrastination
PPTX
Malware Static Analysis
ODP
Metasploit Framework Executable Encoding
PPTX
04-malware.pptx "Malware creeps unseen, corrupting data and control."
PPTX
Let's Talk Technical: Malware Evasion and Detection
PPTX
Malware Analysis Techniques &Incident Response.pptx
PPTX
Practical Malware Analysis: Ch 0: Malware Analysis Primer & 1: Basic Static T...
PDF
CNIT 126 Ch 0: Malware Analysis Primer & 1: Basic Static Techniques
PDF
Understand study
Viruses and Anti-Viruses
Reversing and decrypting the communications of HeartBeat Rat - Part1
20111204 intro malware_livshits_lecture02
kuo-slides la seguridad de firewall ayuda a impedir q los hackers y el malwar...
2600 v09 n1 (spring 1992)
Malware and Anti-Malware Seminar by Benny Czarny
Malware 101 by saurabh chaudhary
Introduction to Malware Analysis
Spo2 t19 spo2-t19
CH1- Introduction to malware analysis-v2.pdf
Reading Group Presentation: The Power of Procrastination
Malware Static Analysis
Metasploit Framework Executable Encoding
04-malware.pptx "Malware creeps unseen, corrupting data and control."
Let's Talk Technical: Malware Evasion and Detection
Malware Analysis Techniques &Incident Response.pptx
Practical Malware Analysis: Ch 0: Malware Analysis Primer & 1: Basic Static T...
CNIT 126 Ch 0: Malware Analysis Primer & 1: Basic Static Techniques
Understand study
Ad

More from Cysinfo Cyber Security Community (20)

PDF
Understanding Malware Persistence Techniques by Monnappa K A
PDF
Understanding & analyzing obfuscated malicious web scripts by Vikram Kharvi
PDF
Getting started with cybersecurity through CTFs by Shruti Dixit & Geethna TK
PPTX
Emerging Trends in Cybersecurity by Amar Prusty
PDF
A look into the sanitizer family (ASAN & UBSAN) by Akul Pillai
PDF
Closer look at PHP Unserialization by Ashwin Shenoi
PDF
Unicorn: The Ultimate CPU Emulator by Akshay Ajayan
PDF
The Art of Executing JavaScript by Akhil Mahendra
PDF
Reversing and Decrypting Malware Communications by Monnappa
PPTX
DeViL - Detect Virtual Machine in Linux by Sreelakshmi
PPTX
Analysis of android apk using adhrit by Abhishek J.M
PDF
Understanding evasive hollow process injection techniques monnappa k a
PPTX
Security challenges in d2d communication by ajithkumar vyasarao
PPTX
S2 e (selective symbolic execution) -shivkrishna a
PPTX
Dynamic binary analysis using angr siddharth muralee
PPTX
Bit flipping attack on aes cbc - ashutosh ahelleya
PDF
Security Analytics using ELK stack
PDF
Linux Malware Analysis
ODP
Introduction to Binary Exploitation
PDF
ATM Malware: Understanding the threat
Understanding Malware Persistence Techniques by Monnappa K A
Understanding & analyzing obfuscated malicious web scripts by Vikram Kharvi
Getting started with cybersecurity through CTFs by Shruti Dixit & Geethna TK
Emerging Trends in Cybersecurity by Amar Prusty
A look into the sanitizer family (ASAN & UBSAN) by Akul Pillai
Closer look at PHP Unserialization by Ashwin Shenoi
Unicorn: The Ultimate CPU Emulator by Akshay Ajayan
The Art of Executing JavaScript by Akhil Mahendra
Reversing and Decrypting Malware Communications by Monnappa
DeViL - Detect Virtual Machine in Linux by Sreelakshmi
Analysis of android apk using adhrit by Abhishek J.M
Understanding evasive hollow process injection techniques monnappa k a
Security challenges in d2d communication by ajithkumar vyasarao
S2 e (selective symbolic execution) -shivkrishna a
Dynamic binary analysis using angr siddharth muralee
Bit flipping attack on aes cbc - ashutosh ahelleya
Security Analytics using ELK stack
Linux Malware Analysis
Introduction to Binary Exploitation
ATM Malware: Understanding the threat

Recently uploaded (20)

PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Empathic Computing: Creating Shared Understanding
PPTX
Programs and apps: productivity, graphics, security and other tools
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PPTX
TLE Review Electricity (Electricity).pptx
PDF
Univ-Connecticut-ChatGPT-Presentaion.pdf
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
Tartificialntelligence_presentation.pptx
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PDF
August Patch Tuesday
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Heart disease approach using modified random forest and particle swarm optimi...
PDF
A comparative analysis of optical character recognition models for extracting...
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Spectral efficient network and resource selection model in 5G networks
Reach Out and Touch Someone: Haptics and Empathic Computing
Empathic Computing: Creating Shared Understanding
Programs and apps: productivity, graphics, security and other tools
Digital-Transformation-Roadmap-for-Companies.pptx
Diabetes mellitus diagnosis method based random forest with bat algorithm
Building Integrated photovoltaic BIPV_UPV.pdf
Mobile App Security Testing_ A Comprehensive Guide.pdf
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
TLE Review Electricity (Electricity).pptx
Univ-Connecticut-ChatGPT-Presentaion.pdf
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Advanced methodologies resolving dimensionality complications for autism neur...
Tartificialntelligence_presentation.pptx
Group 1 Presentation -Planning and Decision Making .pptx
August Patch Tuesday
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Heart disease approach using modified random forest and particle swarm optimi...
A comparative analysis of optical character recognition models for extracting...
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Spectral efficient network and resource selection model in 5G networks

Advanced malware analysis training session11 part2 dissecting the heart beat rat functionalities

  • 2. Disclaimer The Content, Demonstration, Source Code and Programs presented here is "AS IS" without any warranty or conditions of any kind. Also the views/ideas/knowledge expressed here are solely of the trainer’s only and nothing to do with the company or the organization in which the trainer is currently working. However in no circumstances neither the Trainer nor Cysinfo is responsible for any damage or loss caused due to use or misuse of the information presented here.
  • 3. Acknowledgement  Special thanks to Null community for their extended support and co-operation.  Special thanks to ThoughtWorks for the beautiful venue.  Thanks to all the trainers who have devoted their precious time and countless hours to make it happen.
  • 4. Advanced Malware Analysis Training This presentation is part of our Advanced Malware Analysis Training program. Currently it is delivered only during our local meets for FREE of cost. .
  • 5. Who am I Monnappa K A  Member of Cysinfo  Info Security Investigator @ Cisco  Reverse Engineering, Malware Analysis, Memory Forensics  Email: [email protected]  Blog: http://malware-unplugged.blogspot.in  Twitter: @monnappa22  LinkedIn: http://www.linkedin.com/pub/monnappa-ka-grem-ceh/42/45a/1b8
  • 6.  HeartBeat RAT Functionalities  Part 2A - Demo  Part 2B - Demo  Part 2C – Demo  Part 2D – Demo  Part 2E– Demo  Part 2F– Demo  Part 2G - Demo  References
  • 7.  In this session, we will cover below HeartBeat RAT functionalities o Part 2a) Decrypting various communications o Part 2b) Functionality 1 - Process enumeration o Part 2c) Functionality 2 - Process termination o Part 2d) Functionality 3 - Create and Write to File o Part 2e) Functionality 4 - Launch new application (create process) o Part 2f) Functionality 5 - Reverse Shell o Part 2g) Functionality 6 - Restart System
  • 9. Below screenshot shows the encrypted process listing sent to the C2 server
  • 10. Below screenshot shows the decrypted process listing
  • 11. Below screenshot shows the encrypted reverse shell sent by the malware
  • 12. Below screenshot shows the decrytped reverse shell
  • 14. Since malware expects atleast 2056 bytes of data, sending more than 2056 bytes of fake data
  • 15. Malware received the fake date we sent
  • 16. Malware decrypts the received data from 9th byte
  • 17. Malware checks if the first four byte is 01 00 00 00, so modifying the first four bytes
  • 18. When malware receives the command code 1 (01 00 00 00), its enumerates processes on the system
  • 19. Malware encrypts the enumerated processes using the xor encryption algorithm
  • 20. Malware sends encrypted process listing to the C2 (command and control) server
  • 22. Malware checks if the first four byte is 02 00 00 00, so modifying the first four bytes
  • 23. Malware interprets 9th byte as process id and terminates the process with that process id. Lets give malware the process id of calc.exe
  • 24. Malware opens handle to the calc.exe pid 1968
  • 25. Terminates calc.exe process Malware terminates the process by calling “TerminateProcess” API call
  • 26. Malware Sends Encrypted Status Code After terminating the process, malware encrypts the process termination status code and sends it to C2
  • 28. Malware checks if the first four byte is 03 00 00 00, so modifying the first four bytes
  • 29. Malware Creates File Malware reads the data starting from the 9th byte It interprets this as the file name and creates a file
  • 30. Malware Writes Encrypted Data Malware receives data from C2, encrypts it and writes the encrypted data to the file.
  • 32. Malware checks if the first four byte is 04 00 00 00, so modifying the first four bytes
  • 33. Malware Launches Application Malware reads bytes starting from the 9th byte and interprets this as the path to the application to launch.
  • 34. Sends Encrypted Status Code After launching the new application, malware encrypts the application launch status code and sends it to C2
  • 36. Malware Checks for Command Code 5 Malware checks if the first four byte is 05 00 00 00, so modifying the first four bytes
  • 37. Malware launches cmd.exe Malware creates cmd.exe process
  • 38. Malware creates Reverse Shell Malware creates Reverse Shell
  • 39. Sends Encrypted Reverse Shell Malware sends encrypted reverse shell to the C2
  • 41. Malware Checks for Command Code 0A Malware checks if the first four byte is 0A 00 00 00, so modifying the first four bytes
  • 42. Malware Restarts The System Malware restarts the system