From ec5c99211e39673c0704ab2bafb75d880a26588c Mon Sep 17 00:00:00 2001 From: Jeff Moe Date: Mon, 9 Sep 2024 10:38:29 -0600 Subject: [PATCH] DROP microsoft --- DROP-microsoft | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 DROP-microsoft diff --git a/DROP-microsoft b/DROP-microsoft new file mode 100755 index 0000000..e562d25 --- /dev/null +++ b/DROP-microsoft @@ -0,0 +1,18 @@ +#!/bin/bash + +# Microsoft doesn't appear to have a permanent address for this. +# You may have to get the latest URL from here: +# https://www.microsoft.com/en-us/download/details.aspx?id=53602 + +wget -O /tmp/msft-public-ips.csv \ + https://download.microsoft.com/download/B/2/A/B2AB28E1-DAE1-44E8-A867-4987FE089EBE/msft-public-ips.csv + +grep -v -e "::" -e "Prefix,Type" /tmp/msft-public-ips.csv | \ + sort -V | cut -f 1 -d "," > /tmp/msft-public-ips-ipv4.csv + +for i in `cat /tmp/msft-public-ips-ipv4.csv ` + do echo "-A INPUT -p tcp -s $i -j DROP" +done > /tmp/msft-public-ips-ipv4-DROP.txt + +cat /tmp/msft-public-ips-ipv4-DROP.txt +