1
mirror of https://github.com/rapid7/metasploit-framework synced 2024-10-09 04:26:11 +02:00

Reduce minimum GLIBC versions where we can

This commit is contained in:
HD Moore 2017-05-27 19:28:41 -05:00
parent f9ecdf2b4d
commit b7b0c26f4a
49 changed files with 43 additions and 9 deletions

View File

@ -7,15 +7,15 @@ build () {
echo "[*] Building for ${TARGET_SUFFIX}..."
for type in {shellcode,system,findsock}
do ${CC} ${CFLAGS} -Wall -Werror -fPIC samba-root-${type}.c -shared -o samba-root-${type}-${TARGET_SUFFIX}.so
do ${CC} ${CFLAGS} -Wall -Werror -fPIC -fno-stack-protector samba-root-${type}.c -shared -o samba-root-${type}-${TARGET_SUFFIX}.so
done
}
rm -f *.o *.so *.gz
# x86
build "gcc" "x86_64" "-m64"
build "gcc" "x86" "-m32"
build "gcc" "x86_64" "-m64 -D OLD_LIB_SET_2"
build "gcc" "x86" "-m32 -D OLD_LIB_SET_1"
# ARM
build "arm-linux-gnueabi-gcc-5" "armel" "-march=armv5 -mlittle-endian"
@ -23,17 +23,17 @@ build "arm-linux-gnueabihf-gcc-5" "armhf" "-march=armv7 -mlittle-endian"
build "aarch64-linux-gnu-gcc-4.9" "aarch64" ""
# MIPS
build "mips-linux-gnu-gcc-5" "mips" ""
build "mipsel-linux-gnu-gcc-5" "mipsel" ""
build "mips64-linux-gnuabi64-gcc-5" "mips64" ""
build "mips64el-linux-gnuabi64-gcc-5" "mips64el" ""
build "mips-linux-gnu-gcc-5" "mips" "-D OLD_LIB_SET_1"
build "mipsel-linux-gnu-gcc-5" "mipsel" "-D OLD_LIB_SET_1"
build "mips64-linux-gnuabi64-gcc-5" "mips64" "-D OLD_LIB_SET_1"
build "mips64el-linux-gnuabi64-gcc-5" "mips64el" "-D OLD_LIB_SET_1"
# SPARC
build "sparc64-linux-gnu-gcc-5" "sparc64" ""
build "sparc64-linux-gnu-gcc-5" "sparc" "-m32"
build "sparc64-linux-gnu-gcc-5" "sparc" "-m32 -D OLD_LIB_SET_1"
# PowerPC
build "powerpc-linux-gnu-gcc-5" "powerpc" ""
build "powerpc-linux-gnu-gcc-5" "powerpc" "-D OLD_LIB_SET_1"
build "powerpc64-linux-gnu-gcc-5" "powerpc64" ""
build "powerpc64le-linux-gnu-gcc-4.9" "powerpc64le" ""

View File

@ -8,6 +8,18 @@
#include <signal.h>
#include <string.h>
#ifdef OLD_LIB_SET_1
__asm__(".symver execve,execve@GLIBC_2.0");
__asm__(".symver dup2,dup2@GLIBC_2.0");
__asm__(".symver getsockname,getsockname@GLIBC_2.0");
#endif
#ifdef OLD_LIB_SET_2
__asm__(".symver execve,execve@GLIBC_2.2.5");
__asm__(".symver dup2,dup2@GLIBC_2.2.5");
__asm__(".symver getsockname,getsockname@GLIBC_2.2.5");
#endif
extern bool change_to_root_user(void);
// Samba 4 looks for samba_init_module

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long