- Saved searches
- Use saved searches to filter your results more quickly
- mikenizo808/Setting-up-Kali-for-Analyzing-or-Debugging-Binaries
- Name already in use
- Sign In Required
- Launching GitHub Desktop
- Launching GitHub Desktop
- Launching Xcode
- Launching Visual Studio Code
- Latest commit
- Git stats
- Files
- README.md
- Install Ghidra On Kali Linux
- Installation
- Download:
- Requirements:
- Launching Ghidra
- How To Install ghidra on Kali Linux
- What is ghidra
- Install ghidra Using apt-get
- Install ghidra Using apt
- Install ghidra Using aptitude
- How To Uninstall ghidra on Kali Linux
- Uninstall ghidra And Its Dependencies
- Remove ghidra Configurations and Data
- Remove ghidra configuration, data, and all of its dependencies
- References
- Summary
- How to Install and Run Ghidra on Linux
- What Is Ghidra?
- Step 1: Installing JDK 11
Saved searches
Use saved searches to filter your results more quickly
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.
mikenizo808/Setting-up-Kali-for-Analyzing-or-Debugging-Binaries
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Sign In Required
Please sign in to use Codespaces.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching Xcode
If nothing happens, download Xcode and try again.
Launching Visual Studio Code
Your codespace will open once ready.
There was a problem preparing your codespace, please try again.
Latest commit
Git stats
Files
Failed to load latest commit information.
README.md
In this write-up, we quickly install a bunch of tools to get some basics set up for debugging binaries. All credit for the tools and techniques go to the excellent John Hammond video listed below.
The commands and tools selected here are based on the first 8 minutes (the setup) of:
#Binary Exploitation Deep Dive: Return to LIBC (with Matt) https://youtu.be/tMN5N5oid2c
Optionally, you can search for any interesting kali tools at the following link.
One of the requirements is gdb which is a popular open source debugger. You can optionally visit the official project page at https://www.sourceware.org/gdb/ to learn more about the history, etc.
To install on kali we can use apt install as follows:
#typical sudo apt install gdb #optional - support more operating systems sudo apt install gdb-multiarch
Note: For more detail at about the kali versions shown above, see the kali tools page at https://www.kali.org/tools/gdb/`.
#Optional - show what what you have or need sudo apt list libc6 openjdk-11-jdk-headless libgcc-s1 libstdc++6 #install the requirements sudo apt install -y libc6 openjdk-11-jdk-headless libgcc-s1 libstdc++6 #install java sudo apt install openjdk-11-jdk-headless -y #test java java -version
Install Ghidra Reversing Tool
Note: The dependencies for ghidra should be part of kali by default, but for reference, the requirements are:
libc6 libgcc-s1 libstdc++6 openjdk-11-jdk-headless
Optional — Install sublime text editor
https://www.sublimetext.com/docs/linux_repositories.html
Optional — Install Visual Studio Code
https://code.visualstudio.com/docs/setup/linux
Optional — Install Eclipse IDE
You can optionally install Eclipse which is an integrated development environment (IDE) for Java, C, etc.
Native Tools on kali ( python3 and pip )
Some things we have by default in kali are python3 and pip , which we can confirm with —version . We will use these tools later.
python3 --version pip --version
Optional — Install bpython
Note: Not to be confused with pwninit which we install later.
If you download the entire repo then you can just point to this file with pip to install all of them with pip install -r requirements.txt as shown in the steps later.
The following is the content of the file in case of interest.
## example "requirements.txt" for `gef`. cat ┌──(tech1㉿kali001)-[~] └─$ cat ~/Downloads/.gef/requirements.txt capstone keystone-engine pylint ropper unicorn pytest pytest-xdist coverage
So before we install, gef be sure to launch your regular gdb at least once so you know what it looks like. Once you install gef it enhances your experience with gdb next time you launch it.
#optional - launch `gdb` gdb #quit gdb press q #install gef (pick an option) #option 1 - entire repo #this is good because you can look at required packages #change directory cd Downloads #download the repo git clone https://github.com/hugsy/gef #change directory cd gef #copy the script to your home directory cp gef.py ~/.gef.py #list required packages cat ~/Downloads/.gef/requirements.txt #install required packages with pip pip install -r requirements.txt #option 2 - download just the script #this is good if you have all the pre-reqs or will do them later wget -q "https://github.com/hugsy/gef/raw/master/gef.py" -O "$/.gef.py" #create a .gdbinit file, if needed touch ~/.gdbinit vi ~/.gdbinit #contents of .gdbinit should be the following one line: source ~/.gef.py #use gef gdb #get help help #quit q
Review the help information and best practices for this tool.
This install may take some time, so be patient.
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Note: After the rust installation completes, close and relaunch your terminal
Confirm rust is installed
We can use the cargo command to confirm that rust is ready.
Note: cargo is the package manager for rust .
Installing pwninit with cargo
First, we install a long list of pre-requisites using apt , and then finally we use cargo to download and build the pwninit package.
Note: You can optionally install multiple packages with apt on a single line (just add a space between), but here we show one at time.
#install patchelf sudo apt install patchelf #install elfutils sudo apt install elfutils #install pkg-config sudo apt install pkg-config #install lzma sudo apt install lzma #install liblzma-dev sudo apt install liblzma-dev #install libssl-dev #note: we already have `openssl` by default but we also need this. sudo apt install libssl-dev #install pwninit cargo install pwninit
Tip: If your build fails, try to resolve any dependencies mentioned in the error and then run the cargo install pwninit command again. All previous downloads and progress are remembered automatically, so once you have all of the requirements, the compile should be fast and all green..
#optional - show location of binary you just built which pwninit #usage (note: only run from the directory to analyze / setup) #warning: this will make some bits exectuable in this directory cd /path/to/pwninit #this generates a "solve.py" #optional - Review `solve.py` less ./solve.py
Note: The solve.py would be used by the leaders of a capture the flag challenge to setup a scenario.
In this write-up, we got you up and running with some some binary debugging tools for kali Linux.
Install Ghidra On Kali Linux
April 4th, 2019, With high anticipation from the cybersecurity community the NSA release the open source of its Software Reverse Engineering (SRE) framework Ghidra. This all gaining traction as the organization reaches out to garner potential new employees. While the effort seem to be an interesting avenue to pursue the infosec community welcomes the open-sourcing of such powerful tools.
Installation
Over the next few steps we will install Ghidra on Kali. Official Installation guide link: https://ghidra-sre.org/InstallationGuide.html
Download:
- Ghidra Download page: https://www.ghidra-sre.org/
- Github Repository Link: https://github.com/NationalSecurityAgency/ghidra
Requirements:
- Java 11 Runtime & Development Kit(JDK) — OpenJDK recommended
- installation instructions included within this tutorial.
- Head to the Ghidra download page and click “Download Ghidra v9.0.2”
Launching Ghidra
in directory uncompressed:
From this point you can load up a binary or application and move through the compiled code to proceed reverse engineering.
How To Install ghidra on Kali Linux
In this tutorial we learn how to install ghidra on Kali Linux.
What is ghidra
This package contains a software reverse engineering (SRE) framework created and maintained by the National Security Agency Research Directorate. This framework includes a suite of full-featured, high-end software analysis tools that enable users to analyze compiled code on a variety of platforms including Windows, macOS, and Linux. Capabilities include disassembly, assembly, decompilation, graphing, and scripting, along with hundreds of other features. Ghidra supports a wide variety of processor instruction sets and executable formats and can be run in both user-interactive and automated modes. Users may also develop their own Ghidra extension components and/or scripts using Java or Python.
In support of NSA’s Cybersecurity mission, Ghidra was built to solve scaling and teaming problems on complex SRE efforts, and to provide a customizable and extensible SRE research platform. NSA has applied Ghidra SRE capabilities to a variety of problems that involve analyzing malicious code and generating deep insights for SRE analysts who seek a better understanding of potential vulnerabilities in networks and systems.
There are three ways to install ghidra on Kali Linux . We can use apt-get , apt and aptitude . In the following sections we will describe each method. You can choose one of them.
Install ghidra Using apt-get
Update apt database with apt-get using the following command.
After updating apt database, We can install ghidra using apt-get by running the following command:
sudo apt-get -y install ghidra
Install ghidra Using apt
Update apt database with apt using the following command.
After updating apt database, We can install ghidra using apt by running the following command:
sudo apt -y install ghidra
Install ghidra Using aptitude
If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Kali Linux. Update apt database with aptitude using the following command.
After updating apt database, We can install ghidra using aptitude by running the following command:
sudo aptitude -y install ghidra
How To Uninstall ghidra on Kali Linux
To uninstall only the ghidra package we can use the following command:
sudo apt-get remove ghidra
Uninstall ghidra And Its Dependencies
To uninstall ghidra and its dependencies that are no longer needed by Kali Linux, we can use the command below:
sudo apt-get -y autoremove ghidra
Remove ghidra Configurations and Data
To remove ghidra configuration and data from Kali Linux we can use the following command:
sudo apt-get -y purge ghidra
Remove ghidra configuration, data, and all of its dependencies
We can use the following command to remove ghidra configurations, data and all of its dependencies, we can use the following command:
sudo apt-get -y autoremove --purge ghidra
References
Summary
In this tutorial we learn how to install ghidra using different package management tools like apt, apt-get and aptitude.
How to Install and Run Ghidra on Linux
Ghidra is one of the most popular reverse engineering frameworks for security professionals. Here’s how to install it on Linux.
Readers like you help support MUO. When you make a purchase using links on our site, we may earn an affiliate commission. Read More.
Kick-start your journey to be a master reverser with the tools and analytical prowess of Ghidra SRE. Here’s a guide on how to install and set up Ghidra on your Linux machine.
What Is Ghidra?
Created by the NSA, Ghidra is an open-source, cross-platform, sophisticated software reverse engineering framework that offers military-grade tools for analyzing and reversing software binaries. With Ghidra, you can reverse engineer or, decompile a software binary and study the source code underneath.
It is often the go-to framework in the trade of malware analysis and reverse engineering, closely competing with IDA, a software reverse engineering framework of similar stature.
Step 1: Installing JDK 11
Before exploring the Ghidra installation process, you have to make sure your system has JDK 11 installed and set up. Without Java installed on your system, Ghidra will refuse to even start up.
You can either manually install JDK 11 by downloading the tarball or install it through the package manager of your Linux distro. Ideally, installing via package managers is the way to go since it’s much quicker and hassle-free than the former hands-on method.
To install JDK 11 on your Linux desktop, fire up the terminal and run the following commands depending on your distro’s package manager:
On Debian/Ubuntu-based systems:
sudo apt-get install openjdk-11-jdk
sudo pacman -S jdk11-openjdk
On Fedora/CentOS/RHEL systems:
sudo dnf install java-latest-openjdk