shell bypass 403

UnknownSec Shell

: /usr/lib64/nagios/plugins/ [ drwxr-xr-x ]

name : check_fs.sh
#!/bin/bash

set -o pipefail -u

FILE="/tmp/dirty_fs_7Qas9rRW"
DMESG=$(which dmesg)
DMESGOPTS="-T"
GREP=$(which grep)
GREPOPTS="-w"
GREPSTRING="EXT4-fs error"
TAIL=$(which tail)
TAILOPTS="-1"
TOUCH=$(which touch)

[[ -f $FILE ]] && \
printf "\360\237\214\213 " && \
echo "CRITICAL: Filesystem is broken. Restart and repair now." && \
exit 2

CHECK_FS=$($DMESG $DMESGOPTS | $GREP $GREPOPTS "$GREPSTRING" | $TAIL $TAILOPTS)

if [ ! -z "$CHECK_FS" ]
then
    	$TOUCH $FILE 2>/dev/null && \
        printf "\360\237\214\213 " && \
        echo "CRITICAL: Filesystem is broken. Restart and repair now." && \
        exit 2 || \
        printf "\360\237\231\200 " && \
        echo "UNKNOWN: Cannot create temp file $FILE" &&  \
        exit 3
fi

printf "\360\237\222\232 " && \
echo "OK:" "Filesystem is clean." && \
exit 0

© 2025 UnknownSec
afwwrfwafr45458465
Password