System/Kernel


alice@wonderland:~$ 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 wonderland 4.15.0-101-generic #102-Ubuntu SMP Mon May 11 10:07:26 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=18.04
DISTRIB_CODENAME=bionic
DISTRIB_DESCRIPTION="Ubuntu 18.04.4 LTS"
NAME="Ubuntu"
VERSION="18.04.4 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.4 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.4 LTS (Bionic Beaver) 4.15.0-101-generic 64-bit

Networks


alice@wonderland:~$ ip route ; arp -a
default via 10.10.0.1 dev eth0 proto dhcp src 10.10.35.235 metric 100
10.10.0.0/16 dev eth0 proto kernel scope link src 10.10.35.235
10.10.0.1 dev eth0 proto dhcp scope link src 10.10.35.235 metric 100
ip-10-10-0-1.eu-west-1.compute.internal (10.10.0.1) at 02:c8:85:b5:5a:aa [ether] on eth0
alice@wonderland:~$ netstat -antup | grep -i list
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
tcp        0      0 127.0.0.53:53           0.0.0.0:*               LISTEN      -
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      -
tcp6       0      0 :::80                   :::*                    LISTEN      -
tcp6       0      0 :::22                   :::*                    LISTEN      -

Users & Groups


alice@wonderland:~$ cat /etc/passwd ; ll /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
tryhackme:x:1000:1000:tryhackme:/home/tryhackme:/bin/bash
alice:x:1001:1001:Alice Liddell,,,:/home/alice:/bin/bash
hatter:x:1003:1003:Mad Hatter,,,:/home/hatter:/bin/bash
rabbit:x:1002:1002:White Rabbit,,,:/home/rabbit:/bin/bash
total 24
drwxr-xr-x  6 root      root      4096 May 25  2020 ./
drwxr-xr-x 23 root      root      4096 May 25  2020 ../
drwxr-xr-x  5 alice     alice     4096 May 25  2020 alice/
drwxr-x---  3 hatter    hatter    4096 May 25  2020 hatter/
drwxr-x---  2 rabbit    rabbit    4096 May 25  2020 rabbit/
drwxr-x---  6 tryhackme tryhackme 4096 May 25  2020 tryhackme/

hatter rabbit tryhackme

alice@wonderland:~$ 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(tryhackme) gid=1000(tryhackme) groups=1000(tryhackme),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),108(lxd)
uid=1001(alice) gid=1001(alice) groups=1001(alice)
uid=1003(hatter) gid=1003(hatter) groups=1003(hatter)
uid=1002(rabbit) gid=1002(rabbit) groups=1002(rabbit)

uid=1000(tryhackme) gid=1000(tryhackme) groups=1000(tryhackme),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),108(lxd) uid=1001(alice) gid=1001(alice) groups=1001(alice) uid=1003(hatter) gid=1003(hatter) groups=1003(hatter) uid=1002(rabbit) gid=1002(rabbit) groups=1002(rabbit)

SUIDs


alice@wonderland:~$ find / -perm -04000 -ls -type f 2>/dev/null
   394282     44 -rwsr-xr--   1 root     messagebus    42992 Jun 10  2019 /usr/lib/dbus-1.0/dbus-daemon-launch-helper
   394475     16 -rwsr-xr-x   1 root     root          14328 Mar 27  2019 /usr/lib/policykit-1/polkit-agent-helper-1
   394471    428 -rwsr-xr-x   1 root     root         436552 Mar  4  2019 /usr/lib/openssh/ssh-keysign
   524949    100 -rwsr-xr-x   1 root     root         100760 Nov 23  2018 /usr/lib/x86_64-linux-gnu/lxc/lxc-user-nic
   394289     12 -rwsr-xr-x   1 root     root          10232 Mar 28  2017 /usr/lib/eject/dmcrypt-get-device
   393716     44 -rwsr-xr-x   1 root     root          44528 Mar 22  2019 /usr/bin/chsh
   393920     40 -rwsr-xr-x   1 root     root          37136 Mar 22  2019 /usr/bin/newuidmap
   394097     20 -rwsr-xr-x   1 root     root          18448 Jun 28  2019 /usr/bin/traceroute6.iputils
   393714     76 -rwsr-xr-x   1 root     root          76496 Mar 22  2019 /usr/bin/chfn
   393936     60 -rwsr-xr-x   1 root     root          59640 Mar 22  2019 /usr/bin/passwd
   393809     76 -rwsr-xr-x   1 root     root          75824 Mar 22  2019 /usr/bin/gpasswd
   393919     40 -rwsr-xr-x   1 root     root          40344 Mar 22  2019 /usr/bin/newgrp
   393663     52 -rwsr-sr-x   1 daemon   daemon        51464 Feb 20  2018 /usr/bin/at
   393918     40 -rwsr-xr-x   1 root     root          37136 Mar 22  2019 /usr/bin/newgidmap
   393956     24 -rwsr-xr-x   1 root     root          22520 Mar 27  2019 /usr/bin/pkexec
   394061    148 -rwsr-xr-x   1 root     root         149080 Jan 31  2020 /usr/bin/sudo
   655427     32 -rwsr-xr-x   1 root     root          30800 Aug 11  2016 /bin/fusermount
   655971     28 -rwsr-xr-x   1 root     root          26696 Mar  5  2020 /bin/umount
   655478     64 -rwsr-xr-x   1 root     root          64424 Jun 28  2019 /bin/ping
   655970     44 -rwsr-xr-x   1 root     root          43088 Mar  5  2020 /bin/mount
   655494     44 -rwsr-xr-x   1 root     root          44664 Mar 22  2019 /bin/su

SGIDs


alice@wonderland:~$ find / -perm -02000 -ls -type f 2>/dev/null
   131288     36 -rwxr-sr-x   1 root     shadow      34816 Feb 27  2019 /sbin/unix_chkpwd
   131256     36 -rwxr-sr-x   1 root     shadow      34816 Feb 27  2019 /sbin/pam_extrausers_chkpwd
   526126     12 -rwxr-sr-x   1 root     utmp        10232 Mar 11  2016 /usr/lib/x86_64-linux-gnu/utempter/utempter
   393737     40 -rwxr-sr-x   1 root     crontab     39352 Nov 16  2017 /usr/bin/crontab
   393674     16 -rwxr-sr-x   1 root     tty         14328 Jan 17  2018 /usr/bin/bsd-write
   393788     24 -rwxr-sr-x   1 root     shadow      22808 Mar 22  2019 /usr/bin/expiry
   393709     72 -rwxr-sr-x   1 root     shadow      71816 Mar 22  2019 /usr/bin/chage
   393663     52 -rwsr-sr-x   1 daemon   daemon      51464 Feb 20  2018 /usr/bin/at
   393910     44 -rwxr-sr-x   1 root     mlocate     43088 Mar  1  2018 /usr/bin/mlocate
   394052    356 -rwxr-sr-x   1 root     ssh        362640 Mar  4  2019 /usr/bin/ssh-agent
   395440     32 -rwxr-sr-x   1 root     tty         30800 Mar  5  2020 /usr/bin/wall
   400090      4 drwxrwsr-x   3 root     staff        4096 Feb  3  2020 /usr/local/lib/python3.6
   400091      4 drwxrwsr-x   2 root     staff        4096 Feb  3  2020 /usr/local/lib/python3.6/dist-packages
  1049828      4 drwxr-sr-x   3 root     systemd-journal     4096 May 25  2020 /var/log/journal
  1048794      4 drwxr-sr-x   2 root     systemd-journal     4096 Aug 28 13:25 /var/log/journal/3c6cb1f9e32b45699be035b09c0b90cd
  1049521      4 drwxrwsr-x   2 root     mail                4096 Feb  3  2020 /var/mail
  1049519      4 drwxrwsr-x   2 root     staff               4096 Apr 24  2018 /var/local

Processes


alice@wonderland:~$ ps -auxwww
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.9  1.7 159572  8728 ?        Ss   12:51   0:30 /sbin/init maybe-ubiquity
root       383  0.1  3.4 127644 16788 ?        S<s  12:52   0:03 /lib/systemd/systemd-journald
root       401  0.0  0.3  97708  1776 ?        Ss   12:52   0:00 /sbin/lvmetad -f
root       408  0.2  0.9  45996  4568 ?        Ss   12:52   0:06 /lib/systemd/systemd-udevd
systemd+   493  0.0  0.6 141936  3148 ?        Ssl  12:52   0:00 /lib/systemd/systemd-timesyncd
systemd+   575  0.0  1.0  80060  4924 ?        Ss   12:53   0:00 /lib/systemd/systemd-networkd
systemd+   588  0.0  0.9  70640  4844 ?        Ss   12:53   0:00 /lib/systemd/systemd-resolved
daemon     679  0.0  0.4  28332  2064 ?        Ss   12:53   0:00 /usr/sbin/atd -f
message+   680  0.0  0.8  50104  4256 ?        Ss   12:53   0:00 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation --syslog-only
root       683  0.0  0.5  30104  2804 ?        Ss   12:53   0:00 /usr/sbin/cron -f
tryhack+   697 14.8  2.3 409464 11524 ?        Ssl  12:53   7:14 /home/tryhackme/server -p 80
root       704  0.1  0.5 636592  2480 ?        Ssl  12:53   0:04 /usr/bin/lxcfs /var/lib/lxcfs/
root       705  0.0  1.3 286356  6496 ?        Ssl  12:53   0:00 /usr/lib/accountsservice/accounts-daemon
syslog     707  0.0  0.8 263036  4192 ?        Ssl  12:53   0:00 /usr/sbin/rsyslogd -n
root       712  0.0  1.1  70584  5764 ?        Ss   12:53   0:00 /lib/systemd/systemd-logind
root       713  0.0  3.4 169188 16720 ?        Ssl  12:53   0:01 /usr/bin/python3 /usr/bin/networkd-dispatcher --run-startup-triggers
root       734  0.0  0.4  14768  2016 ttyS0    Ss+  12:53   0:00 /sbin/agetty -o -p -- \u --keep-baud 115200,38400,9600 ttyS0 vt220
root       737  0.0  0.3  13244  1664 tty1     Ss+  12:53   0:00 /sbin/agetty -o -p -- \u --noclear tty1 linux
root       738  0.0  1.2  72300  6132 ?        Ss   12:53   0:00 /usr/sbin/sshd -D
root       739  0.0  1.4 291452  6924 ?        Ssl  12:53   0:00 /usr/lib/policykit-1/polkitd --no-debug
root       749  0.0  3.7 186032 18492 ?        Ssl  12:53   0:02 /usr/bin/python3 /usr/share/unattended-upgrades/unattended-upgrade-shutdown --wait-for-signal
root      1205  0.0  1.4 107984  7044 ?        Ss   13:24   0:00 sshd: alice [priv]
alice     1208  0.0  1.4  76672  6988 ?        Ss   13:25   0:00 /lib/systemd/systemd --user
alice     1214  0.0  0.4 193552  2256 ?        S    13:25   0:00 (sd-pam)
alice     1320  0.0  0.6 107984  3392 ?        S    13:25   0:00 sshd: alice@pts/0
alice     1321  0.1  0.8  21468  3988 pts/0    Ss+  13:25   0:01 -bash
root      1349  0.0  1.4 107984  6976 ?        Ss   13:33   0:00 sshd: alice [priv]
alice     1417  0.0  0.6 107984  3324 ?        R    13:33   0:00 sshd: alice@pts/1
alice     1418  0.2  0.9  21468  4632 pts/1    Ss   13:33   0:01 -bash
alice     1570  0.0  0.7  38448  3484 pts/1    R+   13:42   0:00 ps -auxwww

/usr/sbin/cron -f /home/tryhackme/server -p 80 /usr/lib/policykit-1/polkitd --no-debug

Cron & Systemd


alice@wonderland:~$ crontab -l ; cat /etc/crontab ; systemctl list-timers
no crontab for alice
# /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    UNIT                         ACTIVATES
Thu 2024-08-29 02:35:43 UTC  12h left    Wed 2024-08-28 12:53:33 UTC  52min ago apt-daily.timer              apt-daily.s
Thu 2024-08-29 05:12:48 UTC  15h left    Wed 2024-08-28 12:53:33 UTC  52min ago motd-news.timer              motd-news.s
Thu 2024-08-29 06:57:51 UTC  17h left    Wed 2024-08-28 12:53:33 UTC  52min ago apt-daily-upgrade.timer      apt-daily-u
Thu 2024-08-29 13:06:44 UTC  23h left    Wed 2024-08-28 13:06:44 UTC  39min ago systemd-tmpfiles-clean.timer systemd-tmp
Mon 2024-09-02 00:00:00 UTC  4 days left Wed 2024-08-28 12:53:33 UTC  52min ago fstrim.timer                 fstrim.serv
 
5 timers listed.
Pass --all to see loaded but inactive timers, too.

Sudo Version


alice@wonderland:~$ sudo --version
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


alice@wonderland:~$ ldd --version
ldd (Ubuntu GLIBC 2.27-3ubuntu1) 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) 2.27