Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some binary files cause context.quiet to affect the global scope. #2304

Closed
the-soloist opened this issue Nov 24, 2023 · 1 comment · Fixed by #2305
Closed

Some binary files cause context.quiet to affect the global scope. #2304

the-soloist opened this issue Nov 24, 2023 · 1 comment · Fixed by #2305

Comments

@the-soloist
Copy link
Contributor

The tested libc is download from https://github.com/niklasb/libc-database

Update Pwntools First

using latest commit

image

Debug Output

DEBUG output:
image

But when not using DEBUG, use ELF() load the target libc causes context.quiet to affect the global scope.
image

Test Code

testing on the following code

#!/usr/bin/env python
# -*- coding: utf-8 -*-
from pwn import *
import ipdb

safe = "./libc6_2.13-20ubuntu5.2_i386.so"
target = "./libc6-x32_2.30-0ubuntu2_i386.so"

# load target libc
print("[test0] context.log_level: ", context.log_level)
ELF(target, checksec=False)
print("[test0] context.log_level: ", context.log_level)

# load safe libc in context.quiet
print("[test1] context.log_level: ", context.log_level)
with context.quiet:
    ELF(safe, checksec=False)
print("[test1] context.log_level: ", context.log_level)

# load target libc in context.quiet
print("[test2] context.log_level: ", context.log_level)
with context.quiet:
    ELF(target, checksec=False)
print("[test2] context.log_level: ", context.log_level)

Example File

attachment.zip

@peace-maker
Copy link
Member

Thank you for the great test case!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants