Skip to content
KitploitKITPLOIT
ツールブログ
提出
ツールブログ
提出

ハッキング、侵入テスト、サイバーセキュリティツールをあなたのセキュリティアーセナルに!

Kitploitはハッキング、サイバーセキュリティ、ペネトレーションテストのツールディレクトリです。最新のプロジェクトアップデートを見つけて、脆弱性の発見、システム分析、テストの自動化、セキュリティの強化を行いましょう。

··フィード·お問い合わせ·プライバシー·© 2026 Kitploit

ツールディレクトリ

カテゴリ

すべてのカテゴリを見る
Loading categories
patchkit — Pythonによるバイナリパッチング | Kitploit
ツール/GitHubGitHub/lunixbochs/patchkit
リバースエンジニアリングバイナリ解析バイナリエクスプロイト
GitHublunixbochs/patchkit

patchkit

Pythonによるバイナリパッチング

リポジトリを見る
6388253年前Kitploit レビュー済み

人気

すべて見る →

コミュニティで最も使われているツールを見つけましょう。

すべてのツールを探索

ツールコレクションを閲覧

すべてのツールを見る →
共有

patchkit

1つ以上のシンプルなPythonスクリプトを使用してELFバイナリをパッチします。

使い方:

root@kitploit:~
patch <binary> <patchdir|file> [patchdir|file...]

patchdir

1つ以上のPythonパッチファイルを含み、これらはアルファベット順にバイナリに対して実行されます。

パッチの例

アドレスをNOPで埋め、アセンブリ関数を注入し、エントリポイントをフックする:

root@kitploit:~
def simple_patch(pt):
    # nop out a jump at the entry point
    pt.patch(pt.entry, hex='90' * 5)

    # inject assembly into the binary and return the address
    addr = pt.inject(asm='mov eax, 1; ret')

    # hook the entry point to make it call addr (ret will run the original entry point)
    pt.hook(pt.entry, addr)

C関数の置き換え:

root@kitploit:~
def replace_free(pt):
    # pretend free() is at this address:
    old_free = 0x804fc4

    # inject a function to replace free()
    new_free = pt.inject(c=r'''
    void free_stub(void *addr) {
        printf("stubbed free(%p)\n", addr);
    }
    ''')

    # patch the beginning of free() with a jump to our new function
    pt.patch(old_free, jmp=new_free)

API

root@kitploit:~
addr = search(data)
hook(addr, new_addr)
patch(addr, *compile arg*)
addr = inject(*compile arg*)

*compile arg* は以下のいずれかです:
  raw='data'
  hex='0bfe'
  asm='nop'
  jmp=0xaddr
  c='void func() { int a; a = 1; }'(injectでのみサポート、patchでは非対応)

IDAスクリプト

いくつかのスクリプトは ida/ パスにあります。次のように実行します:

root@kitploit:~
/Applications/IDA\ Pro\ 6.8/idaq.app/Contents/MacOS/idaq64 -A -Sida/allfuncs.py a.out

このように呼び出すと、allfuncs.py は a.out.funcs を生成し、これはハードニングスクリプトで使用されます。

ツール

これらは現在、CGC および x86 に特化していますが、将来的には一般的な使用のために移植される予定です。

  • explore: PythonのCFGと再帰的バックトラッキングエミュレータを使用して、実行可能ファイル内の基本ブロックを見つけます
  • bindiff: 探索実行によるブロック境界と追加の分析を使用して、2つのバイナリ間の基本ブロックの差分を見つけて出力します

依存関係

  • 自動的にこれらをインストールするには ./deps.sh を実行してください
    • Capstone Engine - https://github.com/aquynh/capstone.git
    • Keystone Engine - https://github.com/keystone-engine/keystone.git
    • Unicorn Engine - https://github.com/unicorn-engine/unicorn.git
ツールをダウンロード