-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMaliciousIPBlocker.py
56 lines (39 loc) · 1.1 KB
/
MaliciousIPBlocker.py
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
56
__author__ = 'tomerz'
from datetime import datetime
from stracture.servicetypes import *
from json import dumps
#from time import sleep
#Update Interval In Minutes
UPDATE_INTERVAL = 30
class IronBlockIPS(ServiceTypes):
"""
IronBlock Collector
"""
@staticmethod
def get_ips():
#Create Ips Object
ips = dict()
#Create TorIPS Instance And Update
tor_ips = TorIPS().get_ips()
ips.update(tor_ips)
#Create MaliciousIPS Instance And Update
malicious_ips = MaliciousIPS().get_ips()
ips.update(malicious_ips)
#Create MaliciousIPS Instance And Update
proxy_ips = ProxyIPS().get_ips()
ips.update(proxy_ips)
#Create DateTime Instance And Update
ips.update({'DateTime': str(datetime.now())})
#Return Ips Object
return ips
def get_ips_length(ip_dicts):
size = 0
val = ip_dicts.values()
for i in range(len(val) - 1):
size += len(val[i])
return size
def main():
#Configuration
print dumps(IronBlockIPS.get_ips())
if __name__ == "__main__":
main()