Merge pull request #168 from chrisr3d/main
New warning list for unattributed phone numberspull/169/head
						commit
						8828880684
					
				|  | @ -38,6 +38,7 @@ are available in one of the list. The list can be globally enabled or disabled i | |||
| - [lists/mozilla-IntermediateCA](lists/mozilla-IntermediateCA) - Mozilla keystore Intermediate CA | ||||
| - [lists/multicast](lists/multicast) - known IPv4 multicast CIDR blocks | ||||
| - [lists/ovh-cluster](lists/ovh-cluster) - List of known OVH Cluster IP | ||||
| - [lists/phone_numbers](lists/phone_numbers) - Unattributed phone number, reserved for different purposes | ||||
| - [lists/public-dns-v4](lists/public-dns-v4) - IPv4 addresses and reverse of public DNS resolver | ||||
| - [lists/public-dns-v6](lists/public-dns-v6) - IPv6 addresses and reverse of public DNS resolver | ||||
| - [lists/rfc1918](lists/rfc1918) - RFC 1918 network subnets | ||||
|  |  | |||
|  | @ -21,6 +21,7 @@ python3 generate_moz-top500.py | |||
| # Deprecate? | ||||
| #python3 generate-office365-cn.py > lists/microsoft-office365-cn/list.json | ||||
| python3 generate-office365.py | ||||
| python3 generate_phone_numbers.py | ||||
| python3 generate-publicdns.py | ||||
| python3 generate-tlds.py | ||||
| python3 generate_tranco.py | ||||
|  |  | |||
|  | @ -0,0 +1,14 @@ | |||
| { | ||||
|   "description": "Numbers that cannot be attributed because they reserved for different purposes.", | ||||
|   "list": [ | ||||
|     "/((?:\\+|00)33?|0?)(19900|26191|35301|46571|53649|63998)([0-9]{4})/g", | ||||
|     "/((?:\\+|00)33?|0?)(999)([0-9]{6})/g" | ||||
|   ], | ||||
|   "matching_attributes": [ | ||||
|     "phone-number", | ||||
|     "whois-registrant-phone" | ||||
|   ], | ||||
|   "name": "Unattributed phone number.", | ||||
|   "type": "regex", | ||||
|   "version": 20201027 | ||||
| } | ||||
|  | @ -0,0 +1,41 @@ | |||
| #!/usr/bin/env python3 | ||||
| # -*- coding: utf-8 -*- | ||||
| 
 | ||||
| from generator import get_version, write_to_file | ||||
| 
 | ||||
| 
 | ||||
| def generate_french_warninglist(): | ||||
|     regex = '/((?:\+|00)33?|0?)(%s)([0-9]{%s})/g' | ||||
| 
 | ||||
|     # Warning list for numbers dedicated to communications companies internal use: numbers starting with 09 99 | ||||
|     warninglist = [regex % ('999', '6')] | ||||
| 
 | ||||
|     # Warning list for numbers dedicated to audiovisual works: starting with any of the following list | ||||
|     prefixes = ('19900', '26191', '35301', '46571', '53649', '63998') | ||||
|     warninglist.append(regex % ('|'.join(prefixes), '4')) | ||||
| 
 | ||||
|     return warninglist | ||||
| 
 | ||||
| 
 | ||||
| def process(warninglist_name): | ||||
|     description = { | ||||
|         'description': 'Numbers that cannot be attributed because they reserved for different purposes.', | ||||
|         'name': 'Unattributed phone number.', | ||||
|         'matching_attributes': [ | ||||
|             'phone-number', | ||||
|             'whois-registrant-phone' | ||||
|         ], | ||||
|         'type': 'regex', | ||||
|         'version': get_version() | ||||
|     } | ||||
| 
 | ||||
|     warninglist = generate_french_warninglist() | ||||
|     # The list can be extended by adding other entries: `warninglist.extend(generate_some_warninglist())` | ||||
| 
 | ||||
|     description['list'] = warninglist | ||||
|     write_to_file(description, warninglist_name) | ||||
| 
 | ||||
| 
 | ||||
| if __name__ == '__main__': | ||||
|     warninglist_name = 'phone_numbers' | ||||
|     process(warninglist_name) | ||||
		Loading…
	
		Reference in New Issue
	
	 GitHub
							GitHub