.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "HARDENING-CHECK.DE 1" .TH HARDENING-CHECK.DE 1 "2018-12-05" "Debian-Hilfswerkzeuge" " " .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "BEZEICHNUNG" .IX Header "BEZEICHNUNG" hardening-check \- check binaries for security hardening features .SH "ÜBERSICHT" .IX Header "ÜBERSICHT" hardening-check [options] [\s-1ELF ...\s0] .PP Examine a given set of \s-1ELF\s0 binaries and check for several security hardening features, failing if they are not all found. .SH "BESCHREIBUNG" .IX Header "BESCHREIBUNG" This utility checks a given list of \s-1ELF\s0 binaries for several security hardening features that can be compiled into an executable. These features are: .IP "\fBPosition Independent Executable\fR" 8 .IX Item "Position Independent Executable" This indicates that the executable was built in such a way (\s-1PIE\s0) that the \&\*(L"text\*(R" section of the program can be relocated in memory. To take full advantage of this feature, the executing kernel must support text Address Space Layout Randomization (\s-1ASLR\s0). .IP "\fBStack Protected\fR" 8 .IX Item "Stack Protected" This indicates that there is evidence that the \s-1ELF\s0 was compiled with the \&\fBgcc\fR\|(1) option \fB\-fstack\-protector\fR (e.g. uses \fB_\|_stack_chk_fail\fR). The program will be resistant to having its stack overflowed. .Sp When an executable was built without any character arrays being allocated on the stack, this check will lead to false alarms (since there is no use of \&\fB_\|_stack_chk_fail\fR), even though it was compiled with the correct options. .IP "\fBFortify Source functions\fR" 8 .IX Item "Fortify Source functions" This indicates that the executable was compiled with \fB\-D_FORTIFY_SOURCE=2\fR and \fB\-O1\fR or higher. This causes certain unsafe glibc functions with their safer counterparts (e.g. \fBstrncpy\fR instead of \fBstrcpy\fR), or replaces calls that are verifiable at runtime with the runtime-check version (e.g. \fB_\|_memcpy_chk\fR insteade of \fBmemcpy\fR). .Sp When an executable was built such that the fortified versions of the glibc functions are not useful (e.g. use is verified as safe at compile time, or use cannot be verified at runtime), this check will lead to false alarms. In an effort to mitigate this, the check will pass if any fortified function is found, and will fail if only unfortified functions are found. Uncheckable conditions also pass (e.g. no functions that could be fortified are found, or not linked against glibc). .IP "\fBRead-only relocations\fR" 8 .IX Item "Read-only relocations" This indicates that the executable was build with \fB\-Wl,\-z,relro\fR to have \&\s-1ELF\s0 markings (\s-1RELRO\s0) that ask the runtime linker to mark any regions of the relocation table as \*(L"read-only\*(R" if they were resolved before execution begins. This reduces the possible areas of memory in a program that can be used by an attacker that performs a successful memory corruption exploit. .IP "\fBImmediate binding\fR" 8 .IX Item "Immediate binding" This indicates that the executable was built with \fB\-Wl,\-z,now\fR to have \s-1ELF\s0 markings (\s-1BIND_NOW\s0) that ask the runtime linker to resolve all relocations before starting program execution. When combined with \s-1RELRO\s0 above, this further reduces the regions of memory available to memory corruption attacks. .SH "OPTIONEN" .IX Header "OPTIONEN" .IP "\fB\-\-nopie\fR, \fB\-p\fR" 8 .IX Item "--nopie, -p" No not require that the checked binaries be built as \s-1PIE.\s0 .IP "\fB\-\-nostackprotector\fR, \fB\-s\fR" 8 .IX Item "--nostackprotector, -s" No not require that the checked binaries be built with the stack protector. .IP "\fB\-\-nofortify\fR, \fB\-f\fR" 8 .IX Item "--nofortify, -f" No not require that the checked binaries be built with Fority Source. .IP "\fB\-\-norelro\fR, \fB\-r\fR" 8 .IX Item "--norelro, -r" No not require that the checked binaries be built with \s-1RELRO.\s0 .IP "\fB\-\-nobindnow\fR, \fB\-b\fR" 8 .IX Item "--nobindnow, -b" No not require that the checked binaries be built with \s-1BIND_NOW.\s0 .IP "\fB\-\-quiet\fR, \fB\-q\fR" 8 .IX Item "--quiet, -q" Only report failures. .IP "\fB\-\-verbose\fR, \fB\-v\fR" 8 .IX Item "--verbose, -v" Report verbosely on failures. .IP "\fB\-\-report\-functions\fR, \fB\-R\fR" 8 .IX Item "--report-functions, -R" After the report, display all external functions needed by the \s-1ELF.\s0 .IP "\fB\-\-find\-libc\-functions\fR, \fB\-F\fR" 8 .IX Item "--find-libc-functions, -F" Instead of the regular report, locate the libc for the first \s-1ELF\s0 on the command line and report all the known \*(L"fortified\*(R" functions exported by libc. .IP "\fB\-\-color\fR, \fB\-c\fR" 8 .IX Item "--color, -c" Enable colorized status output. .IP "\fB\-\-lintian\fR, \fB\-l\fR" 8 .IX Item "--lintian, -l" Switch reporting to lintian-check-parsable output. .IP "\fB\-\-debug\fR" 8 .IX Item "--debug" Report some debugging during processing. .IP "\fB\-\-help\fR, \fB\-h\fR, \fB\-?\fR" 8 .IX Item "--help, -h, -?" Print a brief help message and exit. .IP "\fB\-\-man\fR, \fB\-H\fR" 8 .IX Item "--man, -H" Print the manual page and exit. .SH "RETURN VALUE" .IX Header "RETURN VALUE" When all checked binaries have all checkable hardening features detected, this program will finish with an exit code of 0. If any check fails, the exit code with be 1. Individual checks can be disabled via command line options. .SH "AUTOR" .IX Header "AUTOR" Kees Cook .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" Copyright 2009\-2013 Kees Cook . .PP This program is free software; you can redistribute it and/or modify it under the terms of the \s-1GNU\s0 General Public License as published by the Free Software Foundation; version 2 or later. .SH "SIEHE AUCH" .IX Header "SIEHE AUCH" \&\fBgcc\fR\|(1), \fBhardening\-wrapper\fR\|(1)