Home > other >  How python port banner service information?
How python port banner service information?

Time:12-18

Excuse me each bosses, how python has open ports banner information ah, is after the connection is successful, it is known that the current port operation of the service, I really want to back to information obtained by port, such as FTP, HTTP service, such as how do I do?
I below the program can successfully connect to the port, but unable to get port the data returned, run after recv timeout automatically quit
#! The/usr/bin/python3
# - * - coding: utf-8 - * -
The import socket

The host='127.0.0.1'
Port=445
Print (" # start link...
")ConnSkt=socket. The socket (socket. AF_INET, socket. SOCK_STREAM)
ConnSkt. Settimeout (5)

Print (" # link finish ")
ConnSkt. Connect ((host, port))
Print (" [+] TCP open port: "+ STR (port))

Aaa=connSkt. Recv (100)
Print (aaa)
  • Related