Software: nginx/1.23.4. PHP/5.6.40-65+ubuntu20.04.1+deb.sury.org+1 uname -a: Linux foro-restaurado-2 5.15.0-1040-oracle #46-Ubuntu SMP Fri Jul 14 21:47:21 UTC 2023 uid=33(www-data) gid=33(www-data) groups=33(www-data) Safe-mode: OFF (not secure) /usr/src/linux-oracle-5.13-headers-5.13.0-1018/tools/testing/selftests/lkdtm/ drwxr-xr-x |
Viewing file: Select action/file-type: #!/bin/sh # SPDX-License-Identifier: GPL-2.0 # # Measure kernel stack entropy by sampling via LKDTM's REPORT_STACK test. set -e samples="${1:-1000}" # Capture dmesg continuously since it may fill up depending on sample size. log=$(mktemp -t stack-entropy-XXXXXX) dmesg --follow >"$log" & pid=$! report=-1 for i in $(seq 1 $samples); do echo "REPORT_STACK" >/sys/kernel/debug/provoke-crash/DIRECT if [ -t 1 ]; then percent=$(( 100 * $i / $samples )) if [ "$percent" -ne "$report" ]; then /bin/echo -en "$percent%\r" report="$percent" fi fi done kill "$pid" # Count unique offsets since last run. seen=$(tac "$log" | grep -m1 -B"$samples"0 'Starting stack offset' | \ grep 'Stack offset' | awk '{print $NF}' | sort | uniq -c | wc -l) bits=$(echo "obase=2; $seen" | bc | wc -L) echo "Bits of stack entropy: $bits" rm -f "$log" # We would expect any functional stack randomization to be at least 5 bits. if [ "$bits" -lt 5 ]; then exit 1 else exit 0 fi |
:: Command execute :: | |
--[ c99shell v. 2.0 [PHP 7 Update] [25.02.2019] maintained by HackingTool | HackingTool | Generation time: 0.004 ]-- |