# 00 — meta
host: ulab
label: after
colectat: 2026-10-30T22:33:57+02:00
unealtă: evidence-pack.py
checks: 11

All checks are read-only. 'SKIP' = could not be read (no sudo/permission).


## 01-host
$ hostname; uname -sr; . /etc/os-release && echo $PRETTY_NAME; uptime -p
lab
Linux 7.0.0-42-generic
Ubuntu 26.04.1 LTS
up 4 hours, 37 minutes

## 02-sshd-effective
$ sshd -T 2>/dev/null | grep -E '^(permitrootlogin|passwordauthentication|pubkeyauthentication|kbdinteractiveauthentication|maxauthtries|x11forwarding|allowusers|allowgroups|logingracetime|clientaliveinterval)'
logingracetime 120
maxauthtries 3
clientaliveinterval 300
permitrootlogin no
pubkeyauthentication yes
passwordauthentication yes
kbdinteractiveauthentication no
x11forwarding no
allowusers lab

## 03-sshd-files
$ ls -l /etc/ssh/sshd_config.d/ 2>/dev/null
total 20
-rw-r--r-- 1 root root  47 Oct 27 19:49 00-hardening.conf
-rw-r--r-- 1 root root  19 Oct 30 14:45 00-permit-root-login.conf
-rw-r--r-- 1 root root 139 Oct 30 15:45 20-hardening.conf
-rw------- 1 root root  27 Oct 26 16:17 50-cloud-init.conf
-rw-r--r-- 1 root root  26 Oct 16 16:30 60-cloudimg-settings.conf

## 04-listeners
$ ss -tulpn | sed -E 's/users:.*//'
Netid State  Recv-Q Send-Q Local Address:Port Peer Address:PortProcess                                                
udp   UNCONN 0      0          127.0.0.1:323       0.0.0.0:*    
udp   UNCONN 0      0         127.0.0.54:53        0.0.0.0:*    
udp   UNCONN 0      0      127.0.0.53%lo:53        0.0.0.0:*    
udp   UNCONN 0      0              [::1]:323          [::]:*    
tcp   LISTEN 0      4096      127.0.0.54:53        0.0.0.0:*    
tcp   LISTEN 0      4096   127.0.0.53%lo:53        0.0.0.0:*    
tcp   LISTEN 0      4096         0.0.0.0:22        0.0.0.0:*    
tcp   LISTEN 0      4096            [::]:22           [::]:*

## 05-sysctl
$ for k in kernel.randomize_va_space kernel.dmesg_restrict kernel.kptr_restrict kernel.yama.ptrace_scope net.ipv4.ip_forward net.ipv4.conf.all.rp_filter net.ipv4.tcp_syncookies; do printf '%-38s %s\n' $k $(sysctl -n $k 2>/dev/null); done
kernel.randomize_va_space              2
kernel.dmesg_restrict                  1
kernel.kptr_restrict                   2
kernel.yama.ptrace_scope               1
net.ipv4.ip_forward                    0
net.ipv4.conf.all.rp_filter            1
net.ipv4.tcp_syncookies                1

## 06-firewall
$ nft list ruleset 2>/dev/null || ufw status 2>/dev/null || firewall-cmd --list-all 2>/dev/null || echo 'SKIP: niciun firewall detectat'
table inet filter {
	chain input {
		type filter hook input priority filter; policy drop;
		ct state established,related accept
		iif "lo" accept
		tcp dport 22 accept
		ip protocol icmp accept
		ip6 nexthdr ipv6-icmp accept
		counter packets 10 bytes 600 drop
	}

	chain forward {
		type filter hook forward priority filter; policy drop;
	}

	chain output {
		type filter hook output priority filter; policy accept;
	}
}

## 07-sudo-access
$ getent group sudo wheel admin 2>/dev/null; echo '---'; for u in $(getent group sudo | cut -d: -f4 | tr ',' ' '); do echo "# $u"; sudo -n -l -U $u 2>/dev/null | sed -n '/may run/,$p' | head -6; done
sudo:x:27:lab
admin:x:107:
---
# lab
User lab may run the following commands on lab:
    (ALL : ALL) ALL

## 08-uid0
$ awk -F: '$3==0 {print $1}' /etc/passwd
root

## 09-suid
$ find / -xdev -perm -4000 -type f 2>/dev/null | head -20
/usr/bin/fusermount3
/usr/bin/umount
/usr/bin/sudo.ws
/usr/bin/passwd
/usr/bin/newgrp
/usr/bin/mount
/usr/bin/gpasswd
/usr/bin/ntfs-3g
/usr/bin/chsh
/usr/bin/chfn
/usr/bin/su
/usr/lib/cargo/bin/sudo
/usr/lib/cargo/bin/su
/usr/lib/dbus-1.0/dbus-daemon-launch-helper
/usr/lib/openssh/ssh-keysign

## 10-cron
$ sudo -n crontab -l 2>/dev/null || echo '(fără cron root)'; ls -1 /etc/cron.d 2>/dev/null
(fără cron root)
e2scrub_all

## 11-updates
$ (apt list --upgradable 2>/dev/null | tail -n +2 | wc -l) 2>/dev/null || (dnf -q check-update 2>/dev/null | grep -c '^[a-z]') 2>/dev/null || echo 'SKIP'
0

