shellphish / how2heap

A repository for learning various heap exploitation techniques.
MIT License
7.12k stars 1.13k forks source link

Bugfix, Makefile now works on oldlist versions #185

Closed goreil closed 4 months ago

goreil commented 4 months ago

The new Makefile Feature #180 did not work for some glibc versions as it always downloaded 2.21-0ubuntu4.3_amd64 instead of the actual target version.

This affected every version inside of the "glibc-all-in-one/old_list", i.e. version 2.24, 2.26,2.28.

Bugtrace

$ H2H_USE_SYSTEM_LIBC=N make v2.24
git submodule update --init --recursive
cd glibc-all-in-one && ./update_list
[+] Common list has been save to "list"
[+] Old-release list has been save to "old_list"
download_glibc_2.24
version=2.24; \
libc=$(cat glibc-all-in-one/list | grep "$version" | grep "amd64" | head -n 1); \
old_libc=$(cat glibc-all-in-one/old_list | grep "" | grep "amd64" | head -n 1); \
if [ -z $libc ]; then libc=$old_libc; script="download_old"; else libc=$libc; script="download"; fi; \
cd glibc-all-in-one; \
rm -rf libs/$libc; \
./$script $libc
Getting 2.21-0ubuntu4.3_amd64
  -> Location: http://old-releases.ubuntu.com/ubuntu/pool/main/g/glibc/libc6_2.21-0ubuntu4.3_amd64.deb

This pull request remedies the issue

Kyle-Kyle commented 4 months ago

thank you for the fix!