Skip to content
KitploitKITPLOIT
도구블로그
제출
도구블로그
제출

해킹, 침투 테스트 및 사이버 보안 도구를 당신의 보안 무기고에!

Kitploit은 해킹, 사이버 보안 및 침투 테스트 도구 디렉토리입니다. 최신 프로젝트 업데이트를 발견하여 취약점을 찾고, 시스템을 분석하고, 테스트를 자동화하고, 보안을 강화하세요.

··피드·문의·개인정보·© 2026 Kitploit

도구 디렉토리

카테고리

모든 카테고리 보기
Loading categories
patchkit — Python을 이용한 바이너리 패치 | Kitploit
도구/GitHubGitHub/lunixbochs/patchkit
Reverse EngineeringBinary AnalysisBinary Exploitation
GitHublunixbochs/patchkit

patchkit

Python을 이용한 바이너리 패치

저장소 보기
6388253년 전Kitploit 검토 완료

인기

모두 보기 →

커뮤니티에서 가장 많이 사용되는 도구를 찾아보세요.

모든 도구 탐색

도구 컬렉션을 둘러보세요

모든 도구 보기 →
공유

patchkit

하나 이상의 간단한 Python 스크립트를 사용하여 ELF 바이너리를 패치합니다.

사용법:

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

patchdir

하나 이상의 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: explore 실행의 블록 경계와 추가 분석을 사용하여 두 바이너리 간의 기본 블록 차이를 찾아 출력합니다.

의존성

  • ./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
도구 다운로드