From efec1c5cd9b3caa40df17a6f525dbcd4631d6ee2 Mon Sep 17 00:00:00 2001 From: whackx Date: Sun, 30 Jul 2023 23:58:48 +0200 Subject: [PATCH] linting --- .../EnumScripts/another_port_scanner.py | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/Enumeration/EnumScripts/another_port_scanner.py b/Enumeration/EnumScripts/another_port_scanner.py index 3826243..1077c25 100644 --- a/Enumeration/EnumScripts/another_port_scanner.py +++ b/Enumeration/EnumScripts/another_port_scanner.py @@ -1,11 +1,13 @@ -#!/usr/bin/python3 +#!/usr/bin/env python3 + import socket -host = "1.1.1.1" -portList = [21,22,53,80,443,3306,8443,8080] -for port in portList: - s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - try: - s.connect((host,port)) - print("Port ", port, " is open") - except: - print("Port ", port, " is closed") + +HOST = "1.1.1.1" +port_list = [21, 22, 53, 80, 443, 3306, 8443, 8080] +for port in port_list: + s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + try: + s.connect((HOST, port)) + print("Port ", port, " is open") + except Exception: + print("Port ", port, " is closed")