Skip to content
KitploitKITPLOIT
工具博客
提交
工具博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

··订阅源·联系·隐私·© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
radare2-scripts — radare2 脚本合集,用于恶意软件分析:从内存转储中提取二进制文件、修补 PE 头,以及解码 shellcode 中的哈希函数导入。 | Kitploit
工具/GitHubGitHub/withsecurelabs/radare2-scripts
内存取证逆向工程Shellcode恶意软件分析数字取证二进制分析
GitHubwithsecurelabs/radare2-scripts

radare2-scripts

radare2 脚本合集,用于恶意软件分析:从内存转储中提取二进制文件、修补 PE 头,以及解码 shellcode 中的哈希函数导入。

查看仓库
32108年前Kitploit 审核通过

最受欢迎

查看全部 →

发现我们社区最常用的工具。

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

radare2 脚本

概述

一组用于 radare2 的脚本集合。

  • r2_bin_carver.py - 用于从内存转储中雕刻文件的脚本。
  • r2_hash_func_decoder.py - 用于解码哈希函数的脚本,常见于 shellcode 中。

脚本

二进制文件雕刻器

该脚本可根据给定的偏移量和大小,从内存转储(MDMP)中雕刻文件。 除了雕刻功能外,它还支持对雕刻出的 PE 文件进行基本修补。 在编写本文时,它将修补 PE 节头中的偏移量。

依赖要求

root@kitploit:~
pip install r2pipe

使用默认参数的示例输出:

示例

root@kitploit:~
$ python2 ./r2_bin_carver.py ./memory.dmp 0x04af0000 0x2f000
[+] Carving to ./memory.dmp.0x04af0000

使用魔数检查和修补进行二进制雕刻的示例输出:

root@kitploit:~
$ python2 ./r2_bin_carver.py -p -b MZ ./memory.dmp 0x04af0000 0x2f000
[+] Checking for magic: MZ - 4d5a
[+] Magic found, carving...
[+] Carving to ./memory.dmp.0x04af0000
[+] Patching...
[+] Found 3 sections to patch
[+] Patching Section 0.
  Setting VirtualSize to 0x1fb0
  Setting PointerToRawData to 0x1000
[+] Patching Section 1.
  Setting VirtualSize to 0x5b7f
  Setting PointerToRawData to 0x3000
[+] Patching Section 2.
  Setting VirtualSize to 0x254d2
  Setting PointerToRawData to 0x9000
[+] Pathing done

哈希函数解码器

该脚本通过查询预生成的哈希数据库来解码函数哈希。 它将处理所支持的哈希技术的生成、搜索和分析。

依赖要求

root@kitploit:~
pip install pefile r2pipe sqlite3

支持的技术

当前支持的哈希技术。

root@kitploit:~
$ python2 ./r2_hash_func_decoder.py -l
Suported Hashing Techniques:
- doublepulsar
- metasploit

生成数据库

这将为 DLL 或 EXE 的所有导出函数生成所有支持的哈希技术的哈希值。

root@kitploit:~
$ python2 ./r2_hash_func_decoder.py -g ntdll.dll
Generating Hashes:
Processing ./ntdll.dll...

搜索数据库

手动搜索数据库中给定的哈希值。

root@kitploit:~
$ python2 ./r2_hash_func_decoder.py -s 0x6f721347
Searching for 0x6F721347...
- metasploit: ntdll.dll!RtlExitUserThread()

在 radare2 中自动分析

这将搜索 radare2 中所有已定义的函数,以查找需要解码的给定技术的哈希值。

root@kitploit:~
$ r2 shellcode
> af @ 0x0
> afl
0x00000000   31 931          fcn.00000000
> #!pipe python2 ./r2_hash_func_decoder.py -a doublepulsar
Analysing:
Function: fcn.00000000 0x0 931
|_ 0x0000001f   movabs rcx, 0x3e1481df    ntoskrnl.exe!PsLookupProcessByProcessId
|_ 0x0000003e   movabs rcx, 0xa0031eba    ntoskrnl.exe!PsGetProcessImageFileName
|_ 0x0000005d   movabs rcx, 0xfffffffff9e70684    ntoskrnl.exe!KeStackAttachProcess
|_ 0x0000007c   movabs rcx, 0x15ebfe4f    ntoskrnl.exe!PsGetProcessPeb
|_ 0x0000009b   movabs rcx, 0xa4ac30f9    ntoskrnl.exe!KeUnstackDetachProcess
|_ 0x000000ba   movabs rcx, 0xecd0beca    ntoskrnl.exe!ObfDereferenceObject
|_ 0x000000d9   movabs rcx, 0xffffffff5d9fb8ae    ntdll.dll!ZwAllocateVirtualMemory
|_ 0x000000f8   movabs rcx, 0xffffffffe3690194    ntoskrnl.exe!ExAllocatePool
|_ 0x00000117   movabs rcx, 0xffffffffb80010f6    ntoskrnl.exe!KeInitializeApc
|_ 0x00000136   movabs rcx, 0xffffffffd25fd6ca    ntoskrnl.exe!KeInsertQueueApc
|_ 0x00000155   movabs rcx, 0x1124a879    ntoskrnl.exe!KeGetCurrentThread
|_ 0x00000174   movabs rcx, 0x4f90c637    ntoskrnl.exe!PsGetCurrentProcess
|_ 0x00000193   movabs rcx, 0x10fee76c    ntoskrnl.exe!PsGetThreadTeb

除了上述功能外,它还会在相应的行添加注释:

root@kitploit:~
[snip]
           0x00000017      e8bc060000     call 0x6d8                  ;[1]
│           0x0000001c      4889c3         mov rbx, rax
│           0x0000001f      48b9df81143e.  movabs rcx, 0x3e1481df      ; ntoskrnl.exe!PsLookupProcessByProcessId
│           0x00000029      e826050000     call 0x554                  ;[2]
│           0x0000002e      4885c0         test rax, rax
│       ┌─< 0x00000031      0f8455030000   je 0x38c                    ;[3]
│       │   0x00000037      4889059c0700.  mov qword [0x000007da], rax ; [0x7da:8]=0
│       │   0x0000003e      48b9ba1e03a0.  movabs rcx, 0xa0031eba      ; ntoskrnl.exe!PsGetProcessImageFileName
│       │   0x00000048      e807050000     call 0x554                  ;[2]
│       │   0x0000004d      4885c0         test rax, rax
│      ┌──< 0x00000050      0f8436030000   je 0x38c                    ;[3]
│      ││   0x00000056      488905850700.  mov qword [0x000007e2], rax ; [0x7e2:8]=0
│      ││   0x0000005d      48b98406e7f9.  movabs rcx, 0xfffffffff9e70684 ; ntoskrnl.exe!KeStackAttachProcess
│      ││   0x00000067      e8e8040000     call 0x554                  ;[2]
[snip]
下载工具