@@ -78,9 +78,9 @@ remoteServer = raw_input("Enter a remote host to scan: ")
7878remoteServerIP = socket .gethostbyname (remoteServer )
7979
8080# Print a nice banner with information on which host we are about to scan
81- print "-" * 60
82- print "Please wait, scanning remote host" , remoteServerIP
83- print "-" * 60
81+ print ( "-" * 60 )
82+ print ( "Please wait, scanning remote host" , remoteServerIP )
83+ print ( "-" * 60 )
8484
8585# Check what time the scan started
8686t1 = datetime .now ()
9494 sock = socket .socket (socket .AF_INET , socket .SOCK_STREAM )
9595 result = sock .connect_ex ((remoteServerIP , port ))
9696 if result == 0 :
97- print "Port {}: Open" .format (port )
97+ print ( "Port {}: Open" .format (port ) )
9898 sock .close ()
9999
100100except KeyboardInterrupt :
101- print "You pressed Ctrl+C"
101+ print ( "You pressed Ctrl+C" )
102102 sys .exit ()
103103
104104except socket .gaierror :
105- print 'Hostname could not be resolved. Exiting'
105+ print ( 'Hostname could not be resolved. Exiting' )
106106 sys .exit ()
107107
108108except socket .error :
109- print "Couldn't connect to server"
109+ print ( "Couldn't connect to server" )
110110 sys .exit ()
111111
112112# Checking the time again
@@ -116,5 +116,5 @@ t2 = datetime.now()
116116total = t2 - t1
117117
118118# Printing the information to screen
119- print 'Scanning Completed in: ' , total
119+ print ( 'Scanning Completed in: ' , total )
120120
0 commit comments