joxeankoret / CVE-2017-7494

Remote root exploit for the SAMBA CVE-2017-7494 vulnerability
GNU General Public License v3.0
255 stars 80 forks source link

Ubuntu 18.04 running error #8

Open r3x07 opened 4 years ago

r3x07 commented 4 years ago
gcc -shared -fPIC -Wall -Wno-nonnull implant.c -o libimplantx32.so -m32
In file included from implant.c:16:0:
/usr/include/stdio.h:27:10: fatal error: bits/libc-header-start.h: No such file or directory
 #include <bits/libc-header-start.h>
          ^~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Makefile:10: recipe for target 'libimplantx32.so' failed
make: *** [libimplantx32.so] Error 1
r3x07 commented 4 years ago

or happens whenever i run it

./cve_2017_7494.py -t 192.168.0.107
[Thu Jan  9 21:00:39 2020] Building libraries...
gcc -shared -fPIC -Wall -Wno-nonnull implant.c -o libimplantx64.so
gcc -shared -fPIC -Wall -Wno-nonnull implant.c -o libimplantx32.so -m32
In file included from implant.c:16:0:
/usr/include/stdio.h:27:10: fatal error: bits/libc-header-start.h: No such file or directory
 #include <bits/libc-header-start.h>
          ^~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Makefile:10: recipe for target 'libimplantx32.so' failed
make: *** [libimplantx32.so] Error 1
[Thu Jan  9 21:00:39 2020] Error building library:
joxeankoret commented 4 years ago

I think the problem is that you need to install gcc-multilib:

sudo apt-get install gcc-multilib
r3x07 commented 4 years ago

@joxeankoret i got this error now

adam@trajsec:~/CVE-2017-7494$ python cve_2017_7494.py -t 0.0.0.0
[Sat Jan 11 03:18:12 2020] Building libraries...
gcc -shared -fPIC -Wall -Wno-nonnull implant.c -o libimplantx64.so
gcc -shared -fPIC -Wall -Wno-nonnull implant.c -o libimplantx32.so -m32
[Sat Jan 11 03:18:12 2020] Logging into the Samba server 0.0.0.0:445
[Sat Jan 11 03:18:12 2020] Using a GUEST session
[Sat Jan 11 03:18:12 2020] Using  libimplantx64.so
[Sat Jan 11 03:18:12 2020] Trying to copy library 'kZm6tVkt.so' to share '[u'print$', u'/var/lib/samba/printers']'
[Sat Jan 11 03:18:12 2020] Error copying file: SMB SessionError: STATUS_ACCESS_DENIED({Access Denied} A process has requested access to an object but has not been granted those access rights.)
[Sat Jan 11 03:18:12 2020] Trying to copy library 'kZm6tVkt.so' to share '[u'IPC$', u'/tmp']'
[Sat Jan 11 03:18:12 2020] Error copying file: SMB SessionError: STATUS_OBJECT_NAME_NOT_FOUND(The object name is not found.)
[Sat Jan 11 03:18:12 2020] Trying to copy random library kZm6tVkt.so
[Sat Jan 11 03:18:12 2020] Unable to copy the payload to the target :(

weeeelye commented 4 years ago

@r3x07 you need write access to the smb share