Gallopsled / pwntools

CTF framework and exploit development library
http://pwntools.com
Other
11.69k stars 1.67k forks source link

libcdb print redundant information #2414

Open the-soloist opened 1 month ago

the-soloist commented 1 month ago

When provider_local_system executes local_libc = ELF(shell_path, checksec=False).libc, it does not pass the checksec=False parameter to libc. This results in libcdb printing redundant libc information that is unrelated to the actual search results.

https://github.com/Gallopsled/pwntools/blob/dev/pwnlib/libcdb.py#L122

I'm testing on latest commit.

#!/usr/bin/env python
# -*- coding: utf-8 -*-

import os
from pwn import *

context.log_level = "info"
context.local_libcdb = "/path/to/libc-database"

log.waitfor("searching build_id")
os.system("rm -rf ~/.cache/.pwntools-cache-*")
time_start = time.time()
path = libcdb.search_by_md5("c4474f5b616fddc87aec1c70ea665c8f", offline_only=True, unstrip=False)
libc = ELF(path, checksec=False)
print(f"cost {time.time() - time_start}s", libc)
image