403Webshell
Server IP : 199.250.200.62  /  Your IP : 216.73.216.91
Web Server : Apache
System : Linux vps37394.inmotionhosting.com 3.10.0-1160.119.1.vz7.224.4 #1 SMP Mon Sep 30 15:36:27 MSK 2024 x86_64
User : jasonp18 ( 1000)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : OFF
Directory :  /opt/dedrads/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /opt/dedrads/check_boxtrapper
#!/bin/bash


LINESDEF="900000"

test "$2" == "--lines" && LINES=$3

MAIL_LOG="/var/log/exim_mainlog";
if [ ! -f $MAIL_LOG ]; then
        echo "Can't find $MAIL_LOG - bailing."
        exit 1;
fi

function pusage () {

    echo;echo "$0 --logs"
    echo "This will check the exim_mainlog for boxtrapper wars.  It's the
    most effective way to find a boxtrapper going on now, and is the default
    action taken by this script"


    echo;echo "$0 --scan"
    echo "This script will review the size of all boxtrapper log
    folders - it is intensive and can take up to an hour to complete
    if the server is heavily loaded.  Use with care."
#
#echo "Flags for this script are taken from 'du' flags. Common
#usage is described below:"
#
#echo;echo "$0 --logs  -h"
#echo "Human readable sizes";echo;
#
#echo;echo "$0 --logs  -b"
#echo "Display directory size in bytes (best when piped to sort
#-nk1 for directory listing - $0 --logs -b | sort -nk2)";echo;
#
#echo;echo "$0 --help"
#echo "This information blob.";
#
#


}

check_exim_boxtrapper () {
    echo "Scanning $MAIL_LOG for boxtrapper wars - big numbers are bad (usually 1k-> >100K).  You can ignore 'transport'."
    tail -"${LINES:-$LINESDEF}" /var/log/exim_mainlog | awk '/boxtrapper/{print $6}' | sort | uniq -c | sort -nk1
}


if [ -z "$1" ];
then
    pusage
fi

case $1 in
--help)
    pusage
    ;;
--scan)
    #{.2} == /home/ and /home2/
    for account in /home{,2}/*/etc/*/*/
    do
        if [ -d "${account}boxtrapper/log" ]
        then
            du -h --max-depth=1 "${account}boxtrapper/log"
        fi
    done
    ;;

--logs)
    check_exim_boxtrapper
    ;;
    *)
    check_exim_boxtrapper
    ;;
esac

Youez - 2016 - github.com/yon3zu
LinuXploit