Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from socket import *
- def text_convert():
- user_list = input("Enter List Location: ")
- with open(user_list) as file_in:
- file_out = file_in.readlines()
- content = [i.strip() for i in file_out]
- return content
- def port_scan(ip_addr, port):
- s = socket(AF_INET, SOCK_STREAM)
- s.settimeout(2)
- port_connect = s.connect_ex((str(ip_addr), port))
- if port_connect is 0:
- print("[*] %s:%s - OPEN" % (ip_addr, port))
- s.close()
- else:
- print("[ ] %s:%s - CLOSED" % (ip_addr, port))
- s.close()
- def main():
- content = text_convert()
- for b in range(0, len(content)):
- port_scan(content[b], 3389)
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement