Merge branch 'master' of https://github.com/kx499/misp-warninglists into kx499-master
commit
0cc3ad9d82
File diff suppressed because it is too large
Load Diff
|
@ -2,16 +2,18 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
import requests
|
||||
import xml.etree.ElementTree as ET
|
||||
import json
|
||||
import datetime
|
||||
|
||||
url = 'https://support.content.office.net/en-us/static/O365IPAddresses.xml'
|
||||
url = 'https://endpoints.office.com/endpoints/worldwide?clientrequestid=b10c5ed1-bad1-445f-b386-b919946339a7'
|
||||
r = requests.get(url)
|
||||
office365 = ET.fromstring(r.text)
|
||||
service_list = r.json()
|
||||
l = []
|
||||
for address in office365.iter('address'):
|
||||
l.append(address.text.replace('*', ''))
|
||||
for service in service_list:
|
||||
for url in service.get('urls', []):
|
||||
l.append(url.replace('*', ''))
|
||||
for ip in service.get('ips', []):
|
||||
l.append(ip)
|
||||
|
||||
warninglist = {}
|
||||
warninglist['name'] = 'List of known Office 365 URLs and IP address ranges'
|
||||
|
@ -20,5 +22,5 @@ warninglist['description'] = 'Office 365 URLs and IP address ranges'
|
|||
warninglist['list'] = sorted(set(l))
|
||||
warninglist['matching_attributes'] = ["ip-src", "ip-dst", "domain|ip", "hostname"]
|
||||
|
||||
|
||||
print(json.dumps(warninglist))
|
||||
with open('../lists/microsoft-office365/list.json', 'w') as data_file:
|
||||
json.dump(warninglist, data_file, indent=4, sort_keys=True)
|
||||
|
|
Loading…
Reference in New Issue