首页
社区
课程
招聘
[转帖]Reverse Engineering with Ghidra_2020年9月24日更新:r2ghidra V4.5.1
发表于: 2019-4-16 06:27 15914

[转帖]Reverse Engineering with Ghidra_2020年9月24日更新:r2ghidra V4.5.1

2019-4-16 06:27
15914

开源项目

项目名称项目地址补充说明
Ghidra's decompilerhttps://github.com/cseagle/blc
2020年9月3日更新
r2ghidrahttps://github.com/radareorg/r2ghidra2020年8月27日更新:V4.5.1

备注

Ghidra's decompiler

更新日期:2020年9月3日

更新说明:更新了IDA 7.5和最新的Ghidra

更新地址:https://github.com/cseagle/blc


r2ghidra

更新日期:2020年8月27日

更新说明:https://github.com/radareorg/r2ghidra/commit/8e576eeadc211de4ac8d8c759cc368fa48cdfa99

更新版本:r2ghidra V4.5.1

下载地址:点击进入最新版本下载界面

Ghidra's decompiler介绍

该插件将Ghidra的反编译器代码集成到Ida插件中,并为Ida和Ghidra的所有平台支持提供了基本的反编译器功能。它提供了基本的源代码显示,试图模仿Hex-Rays反编译器的显示。仅在考虑Ida 7.x时编写。

备注:此代码非常原始,而且很可能是错误的!


BUILDING

在所有平台上,您都应该将blc克隆到IDA SDK的plugins子目录中,以便最终获得<sdkdir>/plugins/blc这是因为构建文件都使用相对路径来查找必要的IDA头文件和链接库。

为Linux / OS X构建blc:

使用include Makefile生成插件。您可能需要调整搜索到的路径以找到您的IDA安装(/Applications/IDA Pro N.NN在OSX /opt/ida-N.NN上假定并且在Linux 假定,如果N.NN是从IDA SDK目录的名称派生的,例如idasdk737.3IDA版本号关联并应与其匹配) )。要成功链接插件,这是必需的。

$ cd <sdkdir>/plugins/blc$ make

编译后的二进制文件将以 <sdkdir>/plugins/blc/bin


LINUX
         -------------------------------------------
         |        ida        |        ida64        |
         -------------------------------------------IDA 7.x  |                   |                     |
 plugin  |     blc.so        |      blc64.so       |
         -------------------------------------------OS/X
         -------------------------------------------
         |        ida        |        ida64        |
         -------------------------------------------IDA 7.x  |                   |  |                  |
 plugin  |     blc.dylib     |      blc64.dylib    |
         -------------------------------------------

将插件复制到您的<IDADIR>/plugins目录中,并且blc应该列为Ida和Ghidra支持的所有体系结构的可用插件。

为Windows构建BLC

使用随附的解决方案(.sln)文件(blc.sln在Visual Studio C ++ 2017或更高版本中进行构建根据您使用的IDA版本,有两个构建目标可用:


         -----------------------------------------
         |        ida        |        ida64      |
         -----------------------------------------IDA 7.x  |    Release/x64    |   Release64/x64   |
 plugin  |       blc.dll     |       blc64.dll   |
         -----------------------------------------

将插件复制到您的<IDADIR>/plugins目录中,并且blc应该被列为Ida和Ghidra支持的所有体系结构的可用插件。

安装

假设您已将IDA安装到<idadir>,请通过将已编译的二进制文件从复制<sdkdir>/plugins/blc/bin到到<idadir>/plugins(Linux / Windows)或<idadir>/idabin/plugins(OS X)安装插件

该插件取决于Ghira处理器规格,您需要从自己的Ghidra安装中复制该规格。安装Ghidra只需解压缩最新的Ghidra版本即可,例如:https ://ghidra-sre.org/ghidra_9.1_PUBLIC_20191023.zip在解压缩的 Ghidra文件夹中,您会找到一个Ghidra子目录,子目录又包含一个Processors子目录。反编译器需要访问包含在中的文件Ghidra/Processors默认情况下,插件会查找$GHIDRA_DIR它希望指向您的Ghidra安装文件夹(例如已$GHIDRA_DIR/Ghidra/Processors存在)的环境变量如果 $GHIDRA_DIR未设置,则该插件希望找到<idadir>/plugins/Ghidra/Processors 您可以使用符号链接或通过从Ghidra安装复制适当的目录来创建的内容。


r2ghidra介绍

这是radar2的Ghidra反编译器的集成。 它完全基于Ghidra的反编译器部分,该部分完全用C ++编写,因此Ghidra本身完全不需要,并且插件可以独立构建。 该项目是在R2con 2019上作为Cutter演讲的一部分提出的:https://youtu.be/eHtMiezr7l8?t=950

安装

有一个r2pm软件包,可以很容易地安装它,例如:

r2pm -i r2ghidra-dec

该软件包仅安装radare2部分。 要使用Cutter中的r2ghidra,请使用从Cutter 1.9开始提供的预构建发行版,该发行版捆绑了r2ghidra,或遵循以下构建说明。

用法

Usage: pdg   # Native Ghidra decompiler plugin
| pdg           # Decompile current function with the Ghidra decompiler
| pdgd          # Dump the debug XML Dump
| pdgx          # Dump the XML of the current decompiled function
| pdgj          # Dump the current decompiled function as JSON
| pdgo          # Decompile current function side by side with offsets
| pdgs          # Display loaded Sleigh Languages
| pdg*          # Decompiled code is returned to r2 as comment

以下配置变量(用于e命令)可用于调整r2ghidra的行为:

   r2ghidra.cmt.cpp: C++ comment style
 r2ghidra.cmt.indent: Comment indent
     r2ghidra.indent: Indent increment
       r2ghidra.lang: Custom Sleigh ID to override auto-detection (e.g. x86:LE:32:default)
    r2ghidra.linelen: Max line length
   r2ghidra.nl.brace: Newline before opening '{'
    r2ghidra.nl.else: Newline before else
 r2ghidra.sleighhome: SLEIGHHOME

在这里,r2ghidra.sleighhome必须指向包含*.sla,*.lspec,...文件的目录,用于反编译器应支持的体系结构。 但是,这在使用r2pm软件包或如下所示安装时会自动设置。

Building

首先,确保已获取此存储库中包含的子模块并且该模块是最新的:

git submodule init
git submodule update

然后,可以按如下所示构建和安装radare2插件:

mkdir build && cd build
cmake -DCMAKE_INSTALL_PREFIX=~/.local ..
make
make install

在这里,将CMAKE_INSTALL_PREFIX设置为radare2可以从中加载插件的位置。 必须执行安装步骤才能使插件正常工作,因为该步骤包括安装必要的Sleigh文件。

要同时构建Cutter插件,请将-DBUILD_CUTTER_PLUGIN = ON -DCUTTER_SOURCE_DIR = / path / to / cutter / source传递给cmake,例如:

/my/path> git clone https://github.com/radareorg/cutter
/my/path> # build Cutter, clone r2ghidra-dec, etc.
...
/my/path/r2ghidra-dec> mkdir build && cd build
/my/path/r2ghidra-dec/build> cmake -DBUILD_CUTTER_PLUGIN=ON -DCUTTER_SOURCE_DIR=/my/path/cutter -DCMAKE_INSTALL_PREFIX=~/.local ..
/my/path/r2ghidra-dec/build> make && make install

License

Please note that this plugin is available under the LGPLv3, which is more strict than Ghidra's license!

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this program. If not, see https://www.gnu.org/licenses/.


Here Be Dragons: Reverse Engineering with Ghidra - Part 0 [Main Windows & CrackMe]

_https://www.shogunlab.com/blog/2019/04/12/here-be-dragons-ghidra-0.html


[课程]FART 脱壳王!加量不加价!FART作者讲授!

最后于 2020-9-24 08:45 被梦幻的彼岸编辑 ,原因:
收藏
免费 1
支持
分享
最新回复 (28)
雪    币: 93908
活跃值: (200199)
能力值: (RANK:10 )
在线值:
发帖
回帖
粉丝
2
Reversing WannaCry Part 1 - Finding the killswitch and unpacking the malware in #Ghidra

_https://www.youtube.com/watch?v=Sv8yu12y5zM
最后于 2019-4-16 06:31 被linhanshi编辑 ,原因:
2019-4-16 06:28
0
雪    币: 93908
活跃值: (200199)
能力值: (RANK:10 )
在线值:
发帖
回帖
粉丝
3
An Abstract Interpretation-Based Deobfuscation
_https://www.msreverseengineering.com/blog/2019/4/17/an-abstract-interpretation-based-deobfuscation-plugin-for-ghidra
2019-4-19 06:13
0
雪    币: 93908
活跃值: (200199)
能力值: (RANK:10 )
在线值:
发帖
回帖
粉丝
4
Analyzing Emotet with Ghidra — Part 1
_https://medium.com/@0xd0cf11e/analyzing-emotet-with-ghidra-part-1-4da71a5c8d69
Analyzing Emotet with Ghidra — Part 2
_https://medium.com/@0xd0cf11e/analyzing-emotet-with-ghidra-part-2-9efbea374b14
2019-4-25 08:03
0
雪    币: 93908
活跃值: (200199)
能力值: (RANK:10 )
在线值:
发帖
回帖
粉丝
5
Ghidra: Shadow Hammer (Stage 1: Setup.exe) static Analysis
_https://www.youtube.com/watch?v=gI0nZR4z7_M
2019-4-26 08:59
0
雪    币: 5511
活跃值: (2072)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
6
Ghidra_src:_https://github.com/NationalSecurityAgency/ghidra
Ghidra_9.0.2:_https://ghidra-sre.org/ghidra_9.0.2_PUBLIC_20190403.zip
2019-4-26 15:03
0
雪    币: 93908
活跃值: (200199)
能力值: (RANK:10 )
在线值:
发帖
回帖
粉丝
7
Ghidra versus Ida: reverse engineering a 'crackme'
_https://youtu.be/S06pgk4DjFQ
2019-4-30 08:07
0
雪    币: 93908
活跃值: (200199)
能力值: (RANK:10 )
在线值:
发帖
回帖
粉丝
8
Three Heads are Better Than One: Mastering NSA’s Ghidra Reverse Engineering Tool
_https://github.com/0xAlexei/INFILTRATE2019
2019-5-4 09:15
0
雪    币: 93908
活跃值: (200199)
能力值: (RANK:10 )
在线值:
发帖
回帖
粉丝
9
Three Heads are Better Than One: Mastering Ghidra - Alexei Bulazel, Jeremy Blackthorne - INFILTRATE 2019
_https://vimeo.com/335158460
2019-5-11 11:36
0
雪    币: 93908
活跃值: (200199)
能力值: (RANK:10 )
在线值:
发帖
回帖
粉丝
10
WORKING WITH GHIDRA'S P-CODE TO IDENTIFY VULNERABLE FUNCTION CALLS
_https://www.riverloopsecurity.com/blog/2019/05/pcode/
2019-5-15 07:46
0
雪    币: 93908
活跃值: (200199)
能力值: (RANK:10 )
在线值:
发帖
回帖
粉丝
11
I have started a ghidra tutorial series and was told I should post it here. This tutorial is about solving a simple crack me using ghidra
_https://youtu.be/yQTMvtutsjY

2019-5-15 07:49
0
雪    币: 93908
活跃值: (200199)
能力值: (RANK:10 )
在线值:
发帖
回帖
粉丝
12

Go Plugin for Ghidra

Plugin to assist reversing Golang binaries with Ghidra.

This is in a VERY early stage and for now only handles linux/x86_64 binaries.

_ https://github.com/felberj/gotools
2019-5-16 08:18
0
雪    币: 93908
活跃值: (200199)
能力值: (RANK:10 )
在线值:
发帖
回帖
粉丝
13
SVD-Loader for Ghidra
Simplifying bare-metal ARM reverse engineering
_https://github.com/leveldown-security/SVD-Loader-Ghidra
2019-9-19 09:03
0
雪    币: 93908
活跃值: (200199)
能力值: (RANK:10 )
在线值:
发帖
回帖
粉丝
14
r2ghidra-dec
Deep ghidra decompiler integration for radare2
_https://github.com/radareorg/r2ghidra-dec
2019-9-19 09:04
0
雪    币: 93908
活跃值: (200199)
能力值: (RANK:10 )
在线值:
发帖
回帖
粉丝
15
AUTOMATING GHIDRA: WRITING A SCRIPT TO FIND BANNED FUNCTIONS
_https://www.vdalabs.com/2019/03/09/automating-ghidra-writing-a-script-to-find-banned-functions/
2019-9-19 09:05
0
雪    币: 93908
活跃值: (200199)
能力值: (RANK:10 )
在线值:
发帖
回帖
粉丝
16
GhidraX64Dbg
Extension containing a Ghidra script to export annotations from Ghidra to an X32/X64 database.
_https://github.com/revolver-ocelot-saa/GhidraX64Dbg
2019-9-19 09:06
0
雪    币: 93908
活跃值: (200199)
能力值: (RANK:10 )
在线值:
发帖
回帖
粉丝
17
Ghidra Data Type 
What is this?

.gdt files are data type archives.
They contain data type to symbol correlation data.
When applied to e.g. imported functions, the functions will be assigned the correct signatures via these files.
_https://github.com/0x6d696368/ghidra-data/tree/master/typeinfo
2019-9-19 09:07
0
雪    币: 203
活跃值: (40)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
18
谢谢分享!!!!
2020-2-11 09:10
0
雪    币:
能力值: ( LV1,RANK:0 )
在线值:
发帖
回帖
粉丝
19
谢谢分享!!!! ,开源软件值得关注
2020-3-6 20:28
0
雪    币: 93908
活跃值: (200199)
能力值: (RANK:10 )
在线值:
发帖
回帖
粉丝
20
Ghidra & Cerbero: released the native interface PoC

_https://ntcore.com/?p=658
2020-3-22 02:04
0
雪    币: 5235
活跃值: (3260)
能力值: ( LV10,RANK:175 )
在线值:
发帖
回帖
粉丝
21
看起来很屌啊
2020-3-22 07:47
0
雪    币: 83
活跃值: (1082)
能力值: ( LV8,RANK:130 )
在线值:
发帖
回帖
粉丝
22
已阅
2020-3-22 07:59
0
雪    币: 93908
活跃值: (200199)
能力值: (RANK:10 )
在线值:
发帖
回帖
粉丝
23

Reversing Control Structures with Ghidra:

_https://www.youtube.com/watch?v=Y2qd0m4_4ZM&feature=youtu.be

最后于 2020-5-24 10:41 被linhanshi编辑 ,原因:
2020-5-24 10:41
0
雪    币: 93908
活跃值: (200199)
能力值: (RANK:10 )
在线值:
发帖
回帖
粉丝
24

EMERALD

Example

Installation:

Copy the repository files into any of ghidra_scripts directories, open the Script Manager and search for emerald and enable In Tool option:

imageimage

_https://github.com/reb311ion/emerald

2020-6-18 18:40
0
雪    币: 126
活跃值: (1343)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
25
very very good@thx lin
2020-8-2 12:20
0
游客
登录 | 注册 方可回帖
返回
//