deb http://ftp.debian.org/debian lenny main contrib deb http://security.debian.org/ lenny/updates main contrib
deb http://archive.debian.org/debian lenny main deb http://archive.debian.org/debian-security lenny/updates main deb http://archive.debian.org/backports.org lenny-backports main deb http://ftp.debian.org/debian wheezy main contrib deb http://security.debian.org/ wheezy/updates main contrib
# apt-key adv --recv-keys --keyserver pgp.mit.edu 8B48AD6246925553 # apt-get update && apt-get install -y bash-static
# ls -la /bin/sh /bin/bash* -rwxr-xr-x 1 root root 700492 12 2008 /bin/bash -rwxr-xr-x 1 root root 1410128 10 2010 /bin/bash-static lrwxrwxrwx 1 root root 4 1 00:32 /bin/sh -> bash
# mv /bin/bash /bin/bash.old && ln -s bash-static /bin/bash
# ls -la /bin/sh /bin/bash* lrwxrwxrwx 1 root root 11 1 00:51 /bin/bash -> bash-static -rwxr-xr-x 1 root root 700492 12 2008 /bin/bash.old -rwxr-xr-x 1 root root 1410128 10 2010 /bin/bash-static lrwxrwxrwx 1 root root 4 1 00:32 /bin/sh -> bash
#deb http://ftp.debian.org/debian wheezy main contrib #deb http://security.debian.org/ wheezy/updates main contrib
# wget http://security.debian.org/debian-security/pool/updates/main/b/bash/bash-static_4.2+dfsg-0.1+deb7u3_i386.deb
# mkdir tmp # dpkg -x bash-static_4.1-3_i386.deb tmp/
# ar x bash-static_4.1-3_i386.deb
# apt-get install libc-dev gcc automake autoconf make patch
# yum install glibc-devel glibc-static make automake autoconf patch
# cd /usr/src # wget http://ftp.gnu.org/gnu/bash/bash-4.3.tar.gz # tar xzf bash-4.3.tar.gz # cd bash-4.3 # wget -cr --reject 'index.*' --reject '*.sig' -l1 http://ftp.gnu.org/gnu/bash/bash-4.3-patches/ # find ftp.gnu.org/gnu/bash/bash-4.3-patches/ -type f | sort -u | xargs -l1 -I % cat % | patch -p0
# ./configure --enable-static-link --without-bash-malloc --enable-job-control --enable-history # make # strip bash
# cp bash /bin/bash.new && mv /bin/bash /bin/bash.old && ln -s bash.new /bin/bash
Source: https://habr.com/ru/post/238903/
All Articles