In ubuntu 16.04 docker container
Get correct glibc version source code
This is for gdb debug and pwn, reverse
go to launchpad, apt source cannot get specific version, check version by apt-cache policy libc6, the version is 2.23-0ubuntu11, even 0ubuntu11 need to be the same with source. Finally, run dpkg-source -x glibc_2.23-0ubuntu11.dsc.
Only get source:
cd /tmp
apt install apt-rdepends
apt download $(apt-rdepends libc6-dbg|grep -v "^ ")
apt install dpkg-dev && apt source libc6
# if dpkg-source failed
dpkg-source -x <package>.dscGet source and build
sudo apt build-dep libc6
sudo apt install build-essential
# 1
apt source libc6
cd <package>
dpkg-buildpackage -us -uc
# 2
# sudo apt install fakeroot
# export LANG=C LD_LIBRARY_PATH=""
apt source --compile libc6On host
docker cp ubuntu:/tmp/dl /tmp
for i in *.deb; do dpkg -x $i <path>; done