martin@code:~$ sudo -l Matching Defaults entries for martin on localhost: env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/snap/bin
User martin may run the following commands on localhost: (ALL : ALL) NOPASSWD: /usr/bin/backy.sh
is_allowed_path() { local path="$1" for allowed_path in "${allowed_paths[@]}"; do if [[ "$path" == $allowed_path* ]]; then return 0 fi done return 1 }
for dir in $directories_to_archive; do if ! is_allowed_path "$dir"; then /usr/bin/echo "Error: $dir is not allowed. Only directories under /var/ and /home/ are allowed." exit 1 fi done
┌──(kali㉿kali)-[~/Desktop] └─$ nmap 10.10.10.245 sh: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8): No such file or directory Starting Nmap 7.95 ( https://nmap.org ) at 2026-01-04 01:40 EST Nmap scan report for cap.htb (10.10.10.245) Host is up (0.28s latency). Not shown: 997 closed tcp ports (reset) PORT STATE SERVICE 21/tcp open ftp 22/tcp open ssh 80/tcp open http
Nmap done: 1 IP address (1 host up) scanned in 21.24 seconds
┌──(kali㉿kali)-[~/Desktop] └─$ ftp cap.htb Connected to cap.htb. 220 (vsFTPd 3.0.3) Name (cap.htb:kali): nathan 331 Please specify the password. Password: 230 Login successful. Remote system type is UNIX. Using binary mode to transfer files. ftp> dir 229 Entering Extended Passive Mode (|||47686|) 150 Here comes the directory listing. -r-------- 1 1001 1001 33 Jan 04 02:37 user.txt 226 Directory send OK. ftp> get user.txt local: user.txt remote: user.txt 229 Entering Extended Passive Mode (|||37352|) 150 Opening BINARY mode data connection for user.txt (33 bytes). 100% |***************************************************************************************************************************| 33 555.62 KiB/s 00:00 ETA 226 Transfer complete. 33 bytes received in 00:00 (0.11 KiB/s)xxxxxxxxxx ftp cap.htb┌──(kali㉿kali)-[~/Desktop]└─$ ftp cap.htbConnected to cap.htb.220 (vsFTPd 3.0.3)Name (cap.htb:kali): nathan331 Please specify the password.Password: 230 Login successful.Remote system type is UNIX.Using binary mode to transfer files.ftp> dir229 Entering Extended Passive Mode (|||47686|)150 Here comes the directory listing.drwxrwxr-x 4 1001 1001 4096 Jan 04 06:13 CVE-2021-4034-main-rw-rw-r-- 1 1001 1001 6457 Jan 04 06:11 CVE-2021-4034-main.zip-rwxrwxrwx 1 1001 1001 975444 Jan 04 06:25 linpeas.shdrwxr-xr-x 3 1001 1001 4096 Jan 04 06:10 snap-r-------- 1 1001 1001 33 Jan 04 02:37 user.txt226 Directory send OK.ftp> get user.txtlocal: user.txt remote: user.txt229 Entering Extended Passive Mode (|||37352|)150 Opening BINARY mode data connection for user.txt (33 bytes).100% |***************************************************************************************************************************| 33 555.62 KiB/s 00:00 ETA226 Transfer complete.33 bytes received in 00:00 (0.11 KiB/s)