Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases now! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Ghidra Software Reverse Engineering for Beginners

You're reading from   Ghidra Software Reverse Engineering for Beginners Analyze, identify, and avoid malicious code and potential threats in your networks and systems

Arrow left icon
Product type Book
Published in Jan 2021
Publisher Packt
ISBN-13 9781800207974
Pages 322 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
A. P. David A. P. David
Author Profile Icon A. P. David
A. P. David
Arrow right icon
View More author details
Toc

Table of Contents (20) Chapters Close

Preface 1. Section 1: Introduction to Ghidra
2. Chapter 1: Getting Started with Ghidra FREE CHAPTER 3. Chapter 2: Automating RE Tasks with Ghidra Scripts 4. Chapter 3: Ghidra Debug Mode 5. Chapter 4: Using Ghidra Extensions 6. Section 2: Reverse Engineering
7. Chapter 5: Reversing Malware Using Ghidra 8. Chapter 6: Scripting Malware Analysis 9. Chapter 7: Using Ghidra Headless Analyzer 10. Chapter 8: Auditing Program Binaries 11. Chapter 9: Scripting Binary Audits 12. Section 3: Extending Ghidra
13. Chapter 10: Developing Ghidra Plugins 14. Chapter 11: Incorporating New Binary Formats 15. Chapter 12: Analyzing Processor Modules 16. Chapter 13: Contributing to the Ghidra Community 17. Chapter 14: Extending Ghidra for Advanced Reverse Engineering 18. Assessments 19. Other Books You May Enjoy

Ghidra RCE vulnerability

In this section, we will learn how the RCE vulnerability found in Ghidra 9.0 works, how to exploit it, and how to fix it.

Explaining the Ghidra RCE vulnerability

The vulnerability was due to a line located in launch.bat when running Ghidra on Windows platforms and launch.sh when running it on Linux or macOS. The following is the line involved:

-Xrunjdwp:transport=dt_socket,server=y,suspend=${SUSPEND},address=*:${DEBUG_PORT}

The vulnerability was fixed in the second version of Ghidra 9.0.1 by replacing the asterisk (*), which indicates all addresses are allowed to attach the debugger to Ghidra, and limiting it to localhost:

-Xrunjdwp:transport=dt_socket,server=y,suspend=!SUSPEND!,address=!DEBUG_ADDRESS!

As you can see, the vulnerability is so evident that, paradoxically, it is likely that it went unnoticed for the same reason.

Exploiting the Ghidra RCE vulnerability

To exploit this RCE vulnerability, we set up a vulnerable machine...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime