| 关键词: socket quot server running request IIS 10.0 data address Connect |
import socket # Specify the target subnet subnet = "10.0.0.0/24" # Create a socket object s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) # Connect the socket to the port where the IIS server is listening server_address = ('10.0.0.1', 80) s.connect(server_address) # Send HTTP GET request request = "GET / HTTP/1.1\r\nHost: 10.0.0.1\r\n\r\n" s.sendall(request) # Receive data data = s.recv(1024) # Check whether the server is running IIS if "Server: Microsoft-IIS" in data: print("Host is running IIS") else: print("Host is not running IIS") # Close the socket s.close() |
|
声明:文章版权归原作者所有 部分文章转自互联网 如有侵权请联系
[邮箱地址] 删除
|