-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathASPRfind.py
More file actions
55 lines (37 loc) · 1.54 KB
/
ASPRfind.py
File metadata and controls
55 lines (37 loc) · 1.54 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
'''
Created on June 15, 2017
@author: sp977u
'''
class ASPRACL :
def doIhaveASPRaclInfo(self,logpath, ipadd):
Final = "NF"
serialList = []
rowswritten = 0
juniScan = "N"
try :
sucFile = open(logpath + "\\" + ipadd + ".txt" , 'r')
while 1:
line = sucFile.readline()
if "show" in line or "sho" in line :
continue
if "pl_ssh_access_aspr" in line :
Final = "Yes"
break
if ("access-list" in line and "vty" in line ) or "standard al_vty_access_aspr" in line or "Standard IP access list al_vty_access_aspr" in line or "access list al_vty_access_aspr" in line or "ACL al_vty_access_aspr" in line :
Final = "Yes"
break
if "ssh 9." in line or "ssh 135." in line or "ssh 10." in line:
Final = "Yes"
break
if not line:
break
if line =="\n":
continue
sucFile.close()
#print( partNoList)
return Final
except Exception as ex:
print(ex)
sucFile.close()
return "Fail"
#===