
Pwnning은 예술입니다.
HeapInspect는 heap을 훨씬 더 예쁘게 보이도록 설계되었습니다.
이제 이 도구는 nadbg의 플러그인입니다. 사용해보세요!
HeapShower (자세히)PrettyPrinter (색상, 요약)이 도구의 빠른 사용 예시.




또한 gdb 플러그인으로 사용할 수 있으며, pwndbg나 다른 플러그인이 힙 분석에 실패했을 때 매우 유용합니다.
sed -i "1i source `pwd`/gdbscript.py" ~/.gdbinit # alternatively, you can add that line manually
참고



사용하기 매우 쉽습니다. 나중에 패키지로 만들 예정입니다.
from heapinspect.core import *
hi = HeapInspector(1234) #pid here
hs = HeapShower(hi)
print(hs.fastbins)
print(hs.smallbins)
print(hs.largebins)
print(hs.unsortedbins)
print(hs.tcache_chunks)
hs.relative = 1 #relative mode, check Quick shot
print(hs.fastbins)
sleep(10)
#now assume that the heap state has changed
hs.update() #use this to refresh
pp = PrettyPrinter(hi)
print(pp.all) #pretty printer
pp.update() #use this to update
몇 가지 테스트 케이스가 있습니다.
heapinspect/tests/ $ python test.py #this will run all test cases for you to check this tool.
......
......
test case unsortedbins64 at test/testcases/libc-2.27/64bit
pid:6704
========================= fastbins =========================
========================= unsortedbins =========================
chunk(0x7f9aae2e6720): prev_size=0x0 size=0xb1 fd=0x7f9aacdfbca0 bk=0x7f9aae2e6880
chunk(0x7f9aae2e6880): prev_size=0x0 size=0xb1 fd=0x7f9aae2e6720 bk=0x7f9aacdfbca0
========================= smallbins =========================
========================= largebins =========================
========================= tcache =========================
tcache[9]:
chunk(0x7f9aae2e6670): prev_size=0x0 size=0xb1 fd=0x7f9aae2e65d0 bk=0x0
chunk(0x7f9aae2e65c0): prev_size=0x0 size=0xb1 fd=0x7f9aae2e6520 bk=0x0
chunk(0x7f9aae2e6510): prev_size=0x0 size=0xb1 fd=0x7f9aae2e6470 bk=0x0
chunk(0x7f9aae2e6460): prev_size=0x0 size=0xb1 fd=0x7f9aae2e63c0 bk=0x0
chunk(0x7f9aae2e63b0): prev_size=0x0 size=0xb1 fd=0x7f9aae2e6310 bk=0x0
chunk(0x7f9aae2e6300): prev_size=0x0 size=0xb1 fd=0x7f9aae2e6260 bk=0x0
chunk(0x7f9aae2e6250): prev_size=0x0 size=0xb1 fd=0x0 bk=0x0
자세한 docstring이 소스 코드에 작성되어 있습니다.
docs에 sphinx 문서를 구축했습니다. 브라우저에서 docs/build/html/index.html을 열면 됩니다.
문서 업데이트.
기능 업데이트는 아닙니다.
첫 번째 릴리스
다음 버전은 릴리스가 될 예정입니다.
이 버전은 안정적이지 않습니다. 다른 glibc로 인한 버그를 수정하려고 노력 중입니다. 테스트에 도움이 필요합니다.
다음 버전에서는 멀티 libc 지원이 추가될 예정입니다. heapdiff와 heap check는 나중에 추가될 것입니다.
HeapShowerbins는 이제 glibc 방식에 따라 fd 대신 bk부터 검색HeapRecoder, heapdiff를 만들 예정smallbins and largebinsfastbin prototypeunsortedbin prototypebins prototypetcache prototypeC_Struct 추가class HeapInspector 추가arena의 더 많은 정보를 파싱하려고 시도proc_util에 class Proc 추가test.py에서 실험적 테스트