coolboy4me / cve-2019-0708_bluekeep_rce

it works on xp (all version sp2 sp3)
74 stars 16 forks source link

make error #3

Open a4j4123 opened 4 years ago

a4j4123 commented 4 years ago

root@saya:~/newtest/cve-2019-0708_bluekeep_rce-master/rdesktop-1.5.0# make gcc -g -Wall -I/usr/include -DPACKAGE_NAME=\"rdesktop\" -DPACKAGE_TARNAME=\"rdesktop\" -DPACKAGE_VERSION=\"1.5.0\" -DPACKAGE_STRING=\"rdesktop\ 1.5.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DL_ENDIAN=1 -DHAVE_SYS_SELECT_H=1 -DHAVE_LOCALE_H=1 -DHAVE_LANGINFO_H=1 -Dssldir=\"/usr\" -DEGD_SOCKET=\"/var/run/egd-pool\" -DWITH_RDPSND=1 -DHAVE_DIRENT_H=1 -DHAVE_DIRFD=1 -DHAVE_DECL_DIRFD=1 -DHAVE_ICONV_H=1 -DHAVE_ICONV=1 -DICONV_CONST= -DHAVE_SYS_VFS_H=1 -DHAVE_SYS_STATVFS_H=1 -DHAVE_SYS_STATFS_H=1 -DHAVE_SYS_PARAM_H=1 -DHAVE_SYS_MOUNT_H=1 -DSTAT_STATVFS=1 -DHAVE_STRUCT_STATVFS_F_NAMEMAX=1 -DHAVE_STRUCT_STATFS_F_NAMELEN=1 -DHAVE_MNTENT_H=1 -DHAVE_SETMNTENT=1 -DKEYMAP_PATH=\"/usr/local/share/rdesktop/keymaps/\" -o secure.o -c secure.c secure.c: In function ‘sec_rsa_encrypt’: secure.c:305:9: error: storage size of ‘mod’ isn’t known BIGNUM mod, exp, x, y; ^~~ secure.c:305:14: error: storage size of ‘exp’ isn’t known BIGNUM mod, exp, x, y; ^~~ secure.c:305:19: error: storage size of ‘x’ isn’t known BIGNUM mod, exp, x, y; ^ secure.c:305:22: error: storage size of ‘y’ isn’t known BIGNUM mod, exp, x, y; ^ secure.c:315:2: warning: implicit declaration of function ‘BN_init’; did you mean ‘ui_init’? [-Wimplicit-function-declaration] BN_init(&mod); ^~~ ui_init secure.c:305:22: warning: unused variable ‘y’ [-Wunused-variable] BIGNUM mod, exp, x, y; ^ secure.c:305:19: warning: unused variable ‘x’ [-Wunused-variable] BIGNUM mod, exp, x, y; ^ secure.c:305:14: warning: unused variable ‘exp’ [-Wunused-variable] BIGNUM mod, exp, x, y; ^~~ secure.c:305:9: warning: unused variable ‘mod’ [-Wunused-variable] BIGNUM mod, exp, x, y; ^~~ secure.c: In function ‘sec_parse_x509_key’: secure.c:537:22: error: dereferencing pointer to incomplete type ‘X509’ {aka ‘struct x509_st’} if (OBJ_obj2nid(cert->cert_info->key->algor->algorithm) == NID_md5WithRSAEncryption) ^~ secure.c:550:50: error: dereferencing pointer to incomplete type ‘EVP_PKEY’ {aka ‘struct evp_pkey_st’} server_public_key = RSAPublicKey_dup((RSA *) epk->pkey.ptr); ^~ secure.c: In function ‘sec_parse_crypt_info’: secure.c:653:32: warning: passing argument 2 of ‘d2i_X509’ from incompatible pointer type [-Wincompatible-pointer-types] ignorecert = d2i_X509(NULL, &(s->p), ignorelen); ^~~ In file included from /usr/local/include/openssl/objects.h:15, from /usr/local/include/openssl/evp.h:28, from /usr/local/include/openssl/x509.h:18, from /usr/local/include/openssl/x509v3.h:14, from secure.c:27: /usr/local/include/openssl/x509.h:551:1: note: expected ‘const unsigned char ’ but argument is of type ‘unsigned char ’ DECLARE_ASN1_FUNCTIONS(X509) ^~~~~~ secure.c:677:27: warning: passing argument 2 of ‘d2i_X509’ from incompatible pointer type [-Wincompatible-pointer-types] cacert = d2i_X509(NULL, &(s->p), cacert_len); ^~~ In file included from /usr/local/include/openssl/objects.h:15, from /usr/local/include/openssl/evp.h:28, from /usr/local/include/openssl/x509.h:18, from /usr/local/include/openssl/x509v3.h:14, from secure.c:27: /usr/local/include/openssl/x509.h:551:1: note: expected ‘const unsigned char ’ but argument is of type ‘unsigned char ’ DECLARE_ASN1_FUNCTIONS(X509) ^~~~~~ secure.c:700:32: warning: passing argument 2 of ‘d2i_X509’ from incompatible pointer type [-Wincompatible-pointer-types] server_cert = d2i_X509(NULL, &(s->p), cert_len); ^~~ In file included from /usr/local/include/openssl/objects.h:15, from /usr/local/include/openssl/evp.h:28, from /usr/local/include/openssl/x509.h:18, from /usr/local/include/openssl/x509v3.h:14, from secure.c:27: /usr/local/include/openssl/x509.h:551:1: note: expected ‘const unsigned char ’ but argument is of type ‘unsigned char ’ DECLARE_ASN1_FUNCTIONS(X509) ^~~~~~ make: *** [Makefile:167:secure.o] error 1

ttsite commented 4 years ago

I'm also wrong here. I don't know what the complete operating environment is like.

a4j4123 commented 4 years ago

我在这里也错了。我不知道完整的操作环境是什么样的。

Compiled successfully, leave a message, thank you —_—

UMRnInside commented 4 years ago

Same issue appered on Debian 10 "buster":

gcc -std=gnu11 -g -O2 -Wall -I/usr/include  -DPACKAGE_NAME=\"rdesktop\" -DPACKAGE_TARNAME=\"rdesktop\" -DPACKAGE_VERSION=\"1.5.0\" -DPACKAGE_STRING=\"rdesktop\ 1.5.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DL_ENDIAN=1 -DHAVE_SYS_SELECT_H=1 -DHAVE_LOCALE_H=1 -DHAVE_LANGINFO_H=1 -Dssldir=\"/usr\" -DEGD_SOCKET=\"/var/run/egd-pool\" -DWITH_RDPSND=1 -DHAVE_DIRENT_H=1 -DHAVE_DIRFD=1 -DHAVE_DECL_DIRFD=1 -DHAVE_ICONV_H=1 -DHAVE_ICONV=1 -DICONV_CONST= -DHAVE_SYS_VFS_H=1 -DHAVE_SYS_STATVFS_H=1 -DHAVE_SYS_STATFS_H=1 -DHAVE_SYS_PARAM_H=1 -DHAVE_SYS_MOUNT_H=1 -DSTAT_STATVFS=1 -DHAVE_STRUCT_STATVFS_F_NAMEMAX=1 -DHAVE_STRUCT_STATFS_F_NAMELEN=1 -DHAVE_MNTENT_H=1 -DHAVE_SETMNTENT=1 -DKEYMAP_PATH=\"/usr/local/share/rdesktop/keymaps/\" -o secure.o -c secure.c
secure.c: In function ‘sec_rsa_encrypt’:
secure.c:307:9: error: storage size of ‘mod’ isn’t known
  BIGNUM mod, exp, x, y;
         ^~~
secure.c:307:14: error: storage size of ‘exp’ isn’t known
  BIGNUM mod, exp, x, y;
              ^~~
secure.c:307:19: error: storage size of ‘x’ isn’t known
  BIGNUM mod, exp, x, y;
                   ^
secure.c:307:22: error: storage size of ‘y’ isn’t known
  BIGNUM mod, exp, x, y;

secure.c: In function ‘sec_parse_x509_key’:
secure.c:539:22: error: dereferencing pointer to incomplete type ‘X509’ {aka ‘struct x509_st’}
  if (OBJ_obj2nid(cert->cert_info->key->algor->algorithm) == NID_md5WithRSAEncryption)
                      ^~
secure.c:552:50: error: dereferencing pointer to incomplete type ‘EVP_PKEY’ {aka ‘struct evp_pkey_st’}
  server_public_key = RSAPublicKey_dup((RSA *) epk->pkey.ptr);
gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/8/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 8.3.0-6' --with-bugurl=file:///usr/share/doc/gcc-8/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-8 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 8.3.0 (Debian 8.3.0-6) 

openssl version
OpenSSL 1.1.1d  10 Sep 2019
UMRnInside commented 4 years ago

I found this commit in rdesktop/rdesktop

It could be a problem of OpenSSL version.

UMRnInside commented 4 years ago

rdesktop-1.5.0 was built successfully on Debian 9 "stretch" with libssl1.0-dev

HOWEVER , heap_spray requires libcrypto.so.1.0.0, while libssl1.0-dev comes with libcrypto.so.1.0.2

a4j4123 commented 4 years ago

rdesktop-1.5.0是在Debian 9“ stretch” 上成功构建的,具有libssl1.0-dev

但是heap_spray需要libcrypto.so.1.0.0,而libssl1.0-dev附带libcrypto.so.1.0.2

thanks