User Tools

Site Tools


ips_office_365_to_proxy.pac_with_regex

How to fill IPs office 365 to proxy.pac with regex

1/ You need IPs of your service : microsoft.support

2/ Need this site with python encode : regex101.com/

3/ Need netmask

netmask.txt
Netmask:   128.0.0.0 = 1
Netmask:   192.0.0.0 = 2
Netmask:   224.0.0.0 = 3
Netmask:   240.0.0.0 = 4
Netmask:   248.0.0.0 = 5
Netmask:   252.0.0.0 = 6
Netmask:   254.0.0.0 = 7
Netmask:   255.0.0.0 = 8
Netmask:   255.128.0.0 = 9
Netmask:   255.192.0.0 = 10
Netmask:   255.224.0.0 = 11
Netmask:   255.240.0.0 = 12
Netmask:   255.248.0.0 = 13
Netmask:   255.252.0.0 = 14
Netmask:   255.254.0.0 = 15
Netmask:   255.255.0.0 = 16
Netmask:   255.255.128.0 = 17
Netmask:   255.255.192.0 = 18
Netmask:   255.255.224.0 = 19
Netmask:   255.255.240.0 = 20
Netmask:   255.255.248.0 = 21
Netmask:   255.255.252.0 = 22
Netmask:   255.255.254.0 = 23
Netmask:   255.255.255.0 = 24
Netmask:   255.255.255.128 = 25
Netmask:   255.255.255.192 = 26
Netmask:   255.255.255.224 = 27
Netmask:   255.255.255.240 = 28
Netmask:   255.255.255.248 = 29
Netmask:   255.255.255.252 = 30
Netmask:   255.255.255.254 = 31
Netmask:   255.255.255.255 = 32

4/Make the dictionary

Dictionary:1=128.0.0.0:2=192.0.0.0:3=224.0.0.0:4=240.0.0.0:5=248.0.0.0:6=252.0.0.0:7=254.0.0.0:8=255.0.0.0:9=255.128.0.0:10=255.192.0.0:11=255.224.0.0:12=255.240.0.0:13=255.248.0.0:14=255.252.0.0:15=255.254.0.0:16=255.255.0.0:17=255.255.128.0:18=255.255.192.0:19=255.255.224.0:20=255.255.240.0:21=255.255.248.0:22=255.255.252.0:23=255.255.254.0:24=255.255.255.0:25=255.255.255.128:26=255.255.255.192:27=255.255.255.224:28=255.255.255.240:29=255.255.255.248:30=255.255.255.252:31=255.255.255.254:32=255.255.255.255

5/Regex

(?s)(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})(/\b)(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)(?=.*:\6=(\w+\.\w+\.\w+\.\w+\b))

6/An example file

example.txt
23.103.132.0/22
23.103.136.0/21
23.103.144.0/20
23.103.198.0/23
40.92.0.0/14
 
Dictionary:1=128.0.0.0:2=192.0.0.0:3=224.0.0.0:4=240.0.0.0:5=248.0.0.0:6=252.0.0.0:7=254.0.0.0:8=255.0.0.0:9=255.128.0.0:10=255.192.0.0:11=255.224.0.0:12=255.240.0.0:13=255.248.0.0:14=255.252.0.0:15=255.254.0.0:16=255.255.0.0:17=255.255.128.0:18=255.255.192.0:19=255.255.224.0:20=255.255.240.0:21=255.255.248.0:22=255.255.252.0:23=255.255.254.0:24=255.255.255.0:25=255.255.255.128:26=255.255.255.192:27=255.255.255.224:28=255.255.255.240:29=255.255.255.248:30=255.255.255.252:31=255.255.255.254:32=255.255.255.255

Source : don't remember


- created date : 2017.09.20 -

ips_office_365_to_proxy.pac_with_regex.txt · Last modified: 2017/09/20 16:12 by admin