Skip to content

Add new debian database in libcd #2572

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

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from

Conversation

dgagn
Copy link

@dgagn dgagn commented Mar 31, 2025

This PR extends _find_libc_package_lib_url to support Debian-based libc packages from the SIPWISE security mirror. It's useful for GLIBC 2.36-9+deb12u6.

@dgagn dgagn changed the title Add libcd new debian database for urls Add new debian database in libcd Mar 31, 2025
@peace-maker
Copy link
Member

Thanks for the contribution. What problem does this fix? What's sipwise and why that mirror explicitly?

@dgagn
Copy link
Author

dgagn commented Mar 31, 2025

Thanks for the contribution. What problem does this fix? What's sipwise and why that mirror explicitly?

The problem is that some version of libc, such as 2.36-9+deb12u6 cannot be downloaded from the standard debian mirror because of vulnerabilities found in them. The only reason for using the sipwise mirror is that it provides old debian libc versions. The sipwise mirror is the first (and only?) one that hosts the version 2.36-9+deb12u6. I had that specific version in a ctf.

pwnlib/libcdb.py Outdated
@@ -515,6 +517,11 @@ def _find_libc_package_lib_url(libc):
libc_version = version.group(1).decode()
yield 'https://launchpad.net/ubuntu/+archive/primary/+files/libc6_{}_{}.deb'.format(libc_version, libc.arch)

# check debian.sipwise.com if it's a debian libc
maybe_deb_version = maybe_deb_version.split('/')[-1]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This throws AttributeError if maybe_deb_version is None, please move under the if below.

if libc_match is not None:
for match in libc_match:
# Allow to override url with a caching proxy in CI
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We still need this in our testing pipeline to get a speedup.

pwnlib/libcdb.py Outdated
# check debian.sipwise.com if it's a debian libc
maybe_deb_version = maybe_deb_version.split('/')[-1]
if maybe_deb_version is not None:
yield 'https://debian.sipwise.com/debian-security/pool/main/g/glibc/{}'.format(maybe_deb_version)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should maybe (?) verify debian signatures if this is a third-party db. I just realized the same goes for our http urls by the way (MITM and so on).

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect, i'll figure this out, thank you.

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

Successfully merging this pull request may close these issues.

3 participants