forked from NULLify-UNO/Scripting-Exercises
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLists.py
More file actions
35 lines (29 loc) · 723 Bytes
/
Lists.py
File metadata and controls
35 lines (29 loc) · 723 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
'''
Created on Jan 23, 2013
Simple script that is used to demonstrate lists and sockets
@author: various authors
'''
import socket, sys
if __name__ == '__main__':
portList = []
portList.append(21)
portList.append(80)
portList.append(443)
portList.append(25)
portList.append(3389)
portList.append(5000)
print portList
portList.sort()
print portList
host = sys.argv[1]
socket.setdefaulttimeout(2)
s = socket.socket()
for x in portList:
try:
print x
s.connect((host,x))
print "[+] Port open... closing connection"
s.close()
except:
print "[-] Port Closed"
pass