Skip to content

Commit a01a2ea

Browse files
author
Brent Cook
committed
Land rapid7#8467, Samba CVE-2017-7494 Improvements
2 parents 5698896 + 28fb5cc commit a01a2ea

File tree

57 files changed

+677
-299
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+677
-299
lines changed

Gemfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ PATH
3535
rb-readline
3636
recog
3737
redcarpet
38-
rex-arch (= 0.1.4)
38+
rex-arch
3939
rex-bin_tools
4040
rex-core
4141
rex-encoder
@@ -264,7 +264,7 @@ GEM
264264
recog (2.1.8)
265265
nokogiri
266266
redcarpet (3.4.0)
267-
rex-arch (0.1.4)
267+
rex-arch (0.1.8)
268268
rex-text
269269
rex-bin_tools (0.1.3)
270270
metasm

data/exploits/CVE-2017-7494/build.sh

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#!/bin/bash
2+
3+
build () {
4+
CC=$1
5+
TARGET_SUFFIX=$2
6+
CFLAGS=$3
7+
8+
echo "[*] Building for ${TARGET_SUFFIX}..."
9+
for type in {shellcode,system,findsock}
10+
do ${CC} ${CFLAGS} -Wall -Werror -fPIC -fno-stack-protector samba-root-${type}.c -shared -o samba-root-${type}-${TARGET_SUFFIX}.so
11+
done
12+
}
13+
14+
rm -f *.o *.so *.gz
15+
16+
#
17+
# Linux GLIBC
18+
#
19+
20+
# x86
21+
build "gcc" "linux-glibc-x86_64" "-m64 -D OLD_LIB_SET_2"
22+
build "gcc" "linux-glibc-x86" "-m32 -D OLD_LIB_SET_1"
23+
24+
# ARM
25+
build "arm-linux-gnueabi-gcc-5" "linux-glibc-armel" "-march=armv5 -mlittle-endian"
26+
build "arm-linux-gnueabihf-gcc-5" "linux-glibc-armhf" "-march=armv7 -mlittle-endian"
27+
build "aarch64-linux-gnu-gcc-4.9" "linux-glibc-aarch64" ""
28+
29+
# MIPS
30+
build "mips-linux-gnu-gcc-5" "linux-glibc-mips" "-D OLD_LIB_SET_1"
31+
build "mipsel-linux-gnu-gcc-5" "linux-glibc-mipsel" "-D OLD_LIB_SET_1"
32+
build "mips64-linux-gnuabi64-gcc-5" "linux-glibc-mips64" "-D OLD_LIB_SET_1"
33+
build "mips64el-linux-gnuabi64-gcc-5" "linux-glibc-mips64el" "-D OLD_LIB_SET_1"
34+
35+
# SPARC
36+
build "sparc64-linux-gnu-gcc-5" "linux-glibc-sparc64" ""
37+
build "sparc64-linux-gnu-gcc-5" "linux-glibc-sparc" "-m32 -D OLD_LIB_SET_1"
38+
39+
# PowerPC
40+
build "powerpc-linux-gnu-gcc-5" "linux-glibc-powerpc" "-D OLD_LIB_SET_1"
41+
build "powerpc64-linux-gnu-gcc-5" "linux-glibc-powerpc64" ""
42+
build "powerpc64le-linux-gnu-gcc-4.9" "linux-glibc-powerpc64le" ""
43+
44+
# S390X
45+
build "s390x-linux-gnu-gcc-5" "linux-glibc-s390x" ""
46+
47+
gzip -9 *.so
48+
rm -f *.o *.so
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
3+
# Assume x86_64 Ubuntu 16.04 base system
4+
apt-get install build-essential \
5+
gcc-5-multilib \
6+
gcc-5-multilib-arm-linux-gnueabi \
7+
gcc-5-multilib-arm-linux-gnueabihf \
8+
gcc-5-multilib-mips-linux-gnu \
9+
gcc-5-multilib-mips64-linux-gnuabi64 \
10+
gcc-5-multilib-mips64el-linux-gnuabi64 \
11+
gcc-5-multilib-mipsel-linux-gnu \
12+
gcc-5-multilib-powerpc-linux-gnu \
13+
gcc-5-multilib-powerpc64-linux-gnu \
14+
gcc-5-multilib-s390x-linux-gnu \
15+
gcc-5-multilib-sparc64-linux-gnu \
16+
gcc-4.9-powerpc64le-linux-gnu \
17+
gcc-4.9-aarch64-linux-gnu
18+
19+
if [ ! -e /usr/include/asm ];
20+
then ln -sf /usr/include/asm-generic /usr/include/asm
21+
fi
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)