From a36a16d43c2f881e5cc97127c67c71ee2dd7963c Mon Sep 17 00:00:00 2001 From: spla Date: Sun, 30 Jan 2022 20:16:07 +0100 Subject: [PATCH] torips.py now downloads the torbulkexitlist file --- README.md | 2 +- torbulkexitlist | 888 +++++++++--------------------------------------- torips.py | 70 +++- 3 files changed, 226 insertions(+), 734 deletions(-) diff --git a/README.md b/README.md index 877721d..5f15f88 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ Within Python Virtual Environment: 3. Run `python torips.py` to write Tor exit nodes IPs to database. You need to get the torbulkexitlist from [here](https://blog.torproject.org/changes-tor-exit-list-service/) -4. Use your favourite scheduling method to set `python spamcheck.py` to run regularly. +4. Use your favourite scheduling method to set `python spamcheck.py` and `python torips.py` to run regularly. diff --git a/torbulkexitlist b/torbulkexitlist index ba73de7..ed9ffec 100644 --- a/torbulkexitlist +++ b/torbulkexitlist @@ -12,7 +12,6 @@ 199.249.230.83 199.249.230.75 104.244.76.13 -23.129.64.132 71.19.144.106 95.143.193.125 185.220.100.241 @@ -25,10 +24,10 @@ 185.82.219.109 185.220.103.4 199.249.230.89 -45.15.16.98 -45.15.16.82 -45.15.16.70 -207.244.70.35 +45.15.16.114 +45.15.16.68 +45.15.16.117 +212.21.66.6 217.79.178.53 185.220.100.242 204.11.50.131 @@ -42,8 +41,6 @@ 109.169.33.163 81.16.33.31 82.221.131.5 -23.129.64.142 -23.129.64.133 46.232.251.191 176.58.100.98 199.249.230.65 @@ -59,7 +56,6 @@ 178.17.171.102 43.251.159.144 178.17.171.197 -23.129.64.147 178.17.174.10 199.249.230.85 5.2.77.146 @@ -68,7 +64,6 @@ 162.247.74.27 162.247.74.204 202.165.228.225 -23.129.64.144 83.96.213.63 178.175.131.194 176.10.104.240 @@ -93,14 +88,11 @@ 178.17.170.164 185.220.100.244 185.165.171.84 -185.100.85.21 -202.165.228.161 45.66.35.35 185.220.103.8 162.247.74.202 46.166.139.111 193.218.118.182 -176.53.90.26 199.249.230.114 162.247.74.201 109.70.100.29 @@ -132,20 +124,15 @@ 87.118.96.154 162.247.74.74 199.249.230.82 -23.239.22.248 139.99.172.11 162.247.74.217 -23.129.64.139 -23.129.64.138 185.65.205.10 95.154.24.73 87.118.122.51 95.142.161.63 94.142.244.16 -23.129.64.143 198.96.155.3 185.130.44.108 -18.27.197.252 82.221.131.71 178.17.170.135 159.89.174.9 @@ -156,7 +143,6 @@ 199.249.230.70 109.70.100.24 162.247.74.216 -185.216.32.130 104.244.74.57 185.100.87.41 188.214.104.146 @@ -165,10 +151,8 @@ 185.220.100.240 109.70.100.32 185.220.100.249 -23.129.64.137 185.56.171.94 164.132.9.199 -23.129.64.134 37.228.129.2 185.42.170.203 185.100.86.154 @@ -184,22 +168,18 @@ 199.249.230.104 123.30.128.138 185.220.103.7 -23.129.64.149 185.220.100.252 104.244.74.97 199.249.230.102 178.17.174.198 199.249.230.64 -51.161.43.235 180.150.226.99 95.128.43.164 189.84.21.44 109.70.100.19 199.249.230.100 -45.140.170.187 109.70.100.33 198.98.51.189 -23.129.64.148 192.42.116.16 181.119.30.26 195.176.3.24 @@ -211,28 +191,18 @@ 51.38.233.93 171.25.193.20 209.141.54.195 -23.129.64.140 185.220.103.5 -23.129.64.135 178.20.55.16 -151.237.185.110 166.70.207.2 -23.129.64.141 180.149.125.139 217.12.221.131 178.17.174.211 -185.65.206.154 125.212.241.131 178.17.170.23 103.28.52.93 95.216.145.1 204.85.191.9 -23.129.64.146 -46.194.42.94 -46.194.149.79 -46.194.57.149 -46.194.130.137 -46.194.138.182 +46.194.11.186 185.35.202.222 71.174.105.126 104.244.72.115 @@ -242,7 +212,6 @@ 195.80.151.30 45.79.177.190 104.244.73.193 -178.17.170.13 185.170.114.25 208.68.7.129 103.228.53.155 @@ -251,11 +220,6 @@ 91.132.147.168 107.189.10.237 82.146.55.139 -23.129.64.130 -23.129.64.131 -23.129.64.136 -217.79.179.7 -134.249.106.21 185.38.175.130 195.144.21.219 94.140.114.190 @@ -316,9 +280,7 @@ 185.220.102.249 185.220.102.248 185.38.175.131 -74.82.47.194 185.107.47.215 -84.53.225.118 193.189.100.202 193.189.100.194 193.189.100.199 @@ -326,9 +288,9 @@ 193.189.100.198 193.189.100.196 193.189.100.197 -219.91.10.8 -219.91.12.146 -219.91.14.213 +101.3.122.52 +101.3.119.221 +101.3.121.135 104.244.76.170 88.80.20.86 199.249.230.67 @@ -361,8 +323,6 @@ 193.239.232.101 71.19.154.84 64.113.32.29 -163.172.29.30 -45.79.144.222 204.17.56.42 5.2.78.69 107.189.30.86 @@ -371,7 +331,6 @@ 92.246.84.133 205.185.124.200 104.244.74.28 -192.34.80.176 199.195.254.254 200.122.181.2 193.218.118.90 @@ -387,14 +346,12 @@ 45.153.160.129 45.153.160.130 81.6.43.9 -81.6.43.167 5.2.77.22 199.195.254.81 104.244.73.205 51.83.131.42 51.195.42.226 51.178.86.137 -198.98.51.151 141.239.152.254 45.153.160.138 45.153.160.132 @@ -454,7 +411,6 @@ 192.42.116.25 192.42.116.28 192.42.116.26 -192.42.116.13 192.42.116.23 192.42.116.17 192.42.116.24 @@ -466,9 +422,7 @@ 213.164.204.165 107.189.31.181 216.218.134.12 -199.184.215.11 213.164.204.171 -104.244.77.95 193.218.118.167 193.218.118.62 107.174.244.102 @@ -511,7 +465,6 @@ 193.189.100.206 199.249.230.109 193.189.100.205 -172.81.131.110 185.233.100.23 172.81.131.111 193.31.24.154 @@ -536,10 +489,8 @@ 193.218.118.101 45.95.235.86 193.218.118.147 -66.175.208.248 185.100.87.129 45.151.167.11 -185.10.68.65 190.10.8.166 139.99.239.135 51.79.204.46 @@ -551,56 +502,12 @@ 62.171.142.3 176.126.253.190 45.121.147.218 -198.54.128.94 -192.195.80.10 -198.167.206.246 -198.167.206.232 -198.167.206.156 -198.167.206.194 -198.167.206.131 -198.167.206.222 -198.167.206.149 -198.167.206.182 -198.167.206.129 -198.167.206.183 -198.167.206.242 -198.167.206.197 -198.167.206.244 -198.167.206.237 -198.167.206.166 -198.167.206.152 -198.167.206.167 -198.167.206.185 -198.167.206.180 -198.167.206.162 -198.167.206.170 -198.167.206.225 -198.167.206.174 -198.167.206.238 -198.167.206.253 -198.167.206.220 -198.167.206.154 -198.167.206.228 -198.167.206.233 -198.167.206.230 -198.167.206.200 -198.167.206.241 -198.167.206.192 -198.167.206.186 -198.167.206.153 -198.167.206.248 -198.167.206.227 -198.167.206.160 -198.167.206.213 -198.167.206.184 -198.167.206.205 +198.54.128.62 51.158.183.63 45.192.176.44 -51.161.43.237 209.141.49.232 72.167.47.69 91.219.237.21 -114.199.75.111 213.164.206.124 213.164.206.123 176.123.7.102 @@ -610,38 +517,23 @@ 173.249.57.253 104.244.73.126 209.141.34.232 -94.140.115.133 -50.254.218.37 185.117.118.15 -95.211.118.194 -23.160.193.176 +149.56.44.47 212.102.50.33 5.2.69.50 185.83.214.69 -203.159.80.73 -45.144.225.119 156.146.34.193 -89.163.243.88 89.163.252.30 -89.163.154.91 89.163.252.230 5.199.143.202 89.163.249.192 213.202.216.189 89.163.249.244 -89.163.150.213 -31.210.20.110 51.81.160.187 185.100.87.192 173.212.219.49 -135.125.46.180 -185.142.239.49 -46.226.105.119 159.65.50.174 -68.183.184.174 96.66.15.152 -107.189.6.166 -209.141.51.252 216.186.250.53 185.107.47.171 138.68.69.37 @@ -653,56 +545,33 @@ 45.137.184.31 185.100.87.72 31.42.185.24 -199.195.253.53 91.219.236.228 -199.195.253.184 107.189.5.248 -141.136.0.129 -185.82.127.25 -94.140.115.76 -141.136.0.117 51.195.107.236 205.185.126.167 -94.140.114.213 213.164.204.177 -198.98.48.203 205.185.123.97 199.195.253.149 -205.185.115.45 205.185.113.225 5.2.76.221 66.220.242.222 5.2.72.226 -107.152.43.154 45.142.214.89 194.156.98.85 198.98.59.35 -185.191.127.212 -185.191.127.214 -5.183.209.134 -185.191.127.231 -185.191.127.213 -5.183.209.136 -5.183.209.135 -185.191.127.215 -198.98.51.222 193.239.232.102 51.15.227.109 51.15.127.227 -135.148.43.32 107.189.8.65 107.189.30.23 107.189.29.41 -85.202.80.35 104.244.77.235 107.189.31.241 205.185.117.149 185.82.126.13 104.244.72.239 -217.160.174.204 107.189.30.75 107.189.31.87 -129.159.35.205 139.162.43.196 107.189.7.243 185.129.62.62 @@ -718,9 +587,7 @@ 107.189.1.160 104.244.72.65 213.61.215.54 -107.189.10.218 45.61.186.113 -163.172.213.212 45.61.186.169 185.212.149.103 41.77.136.114 @@ -736,6 +603,7 @@ 93.95.227.202 107.189.7.156 185.112.144.49 +187.20.55.213 209.141.46.81 45.61.184.239 104.244.76.44 @@ -750,28 +618,13 @@ 192.160.102.166 185.165.168.77 199.195.251.182 -176.58.121.177 -59.115.123.139 -61.230.160.44 -61.230.162.191 -61.230.161.95 -59.115.116.5 -59.115.120.248 -59.115.118.231 -36.227.169.17 -36.227.174.70 -36.227.165.170 -59.115.116.103 -36.227.164.189 -36.227.162.217 -59.115.124.192 +36.227.165.125 192.160.102.165 192.160.102.168 107.189.31.195 107.189.7.175 107.189.5.68 198.98.62.120 -31.42.184.34 172.107.201.134 185.220.102.4 185.165.169.18 @@ -781,18 +634,14 @@ 144.172.118.4 46.182.21.248 107.189.31.227 -23.106.122.112 185.100.87.139 45.61.185.53 45.61.184.244 -49.50.107.221 195.37.209.9 95.211.100.149 5.182.210.216 -5.182.210.155 82.118.253.153 185.100.87.253 -5.255.97.149 107.189.5.5 5.2.188.23 104.244.79.6 @@ -803,7 +652,6 @@ 107.189.14.165 184.105.146.50 104.244.72.132 -51.68.190.9 109.201.133.100 102.130.113.37 102.130.113.9 @@ -811,52 +659,30 @@ 198.98.50.112 199.195.252.18 198.98.60.19 -185.31.175.243 -185.31.175.226 -185.31.175.240 -185.31.175.220 -185.31.175.228 -185.31.175.231 -185.31.175.213 -185.31.175.235 -185.31.175.247 -185.31.175.207 -185.31.175.252 -185.31.175.215 107.189.13.143 -111.90.145.190 107.189.12.240 107.189.12.238 185.112.144.191 185.130.47.58 107.189.29.207 -201.22.99.17 -177.205.183.0 -51.81.143.174 -51.68.214.45 -107.189.30.151 95.216.107.148 81.17.18.62 103.171.85.126 -107.189.14.47 107.189.14.182 107.189.28.253 104.244.77.80 107.189.8.33 -209.127.17.234 45.61.187.205 104.244.78.168 213.164.204.146 45.12.134.108 198.98.57.191 -31.42.186.101 141.95.18.225 -185.82.126.222 -94.140.114.174 107.189.12.148 209.141.60.19 104.244.76.127 141.95.18.207 +205.185.116.201 213.164.206.127 185.220.101.1 185.220.101.3 @@ -913,71 +739,48 @@ 185.220.101.59 185.220.101.58 81.17.18.60 -107.189.29.16 107.189.28.84 -107.189.13.94 107.189.28.241 89.236.112.100 51.75.161.78 51.38.127.41 146.59.18.159 -151.115.60.113 93.115.84.143 -185.82.126.31 -198.98.59.49 185.14.97.147 23.129.64.250 81.17.18.59 209.141.41.103 107.189.13.172 107.189.2.91 -199.195.253.119 37.123.163.58 -23.129.64.145 5.255.97.176 176.58.89.182 185.112.144.68 193.32.127.153 -193.32.127.152 193.32.127.156 -193.32.127.155 185.113.128.30 193.32.127.157 -193.32.127.158 -91.221.57.179 209.141.51.30 104.244.78.160 104.244.72.7 -198.98.48.231 -45.61.187.222 -104.244.75.225 -199.195.249.16 185.100.86.74 51.159.70.42 -205.185.124.231 -205.185.114.229 -104.244.73.8 -107.189.14.119 -205.185.116.157 178.17.174.162 5.2.75.253 185.165.168.229 5.2.70.223 5.2.70.192 5.2.70.198 -210.114.1.172 107.189.12.135 128.31.0.13 185.107.195.109 51.15.250.93 107.189.7.88 185.100.87.136 -5.2.73.66 23.184.48.9 107.189.1.90 185.38.175.132 54.37.16.241 -104.244.76.167 185.129.61.6 185.129.61.5 185.129.61.2 @@ -990,23 +793,8 @@ 93.95.228.205 107.189.4.253 185.100.85.61 -107.189.10.120 -122.117.91.144 -212.192.246.95 -194.135.33.152 -5.2.79.187 -5.2.79.184 -198.144.121.93 -185.191.124.143 37.228.129.5 -54.36.101.21 -45.9.150.112 -107.189.3.60 -212.193.30.142 -83.97.20.206 -212.193.30.143 23.129.64.213 -173.237.206.68 23.129.64.210 23.129.64.212 23.129.64.211 @@ -1016,23 +804,14 @@ 195.254.135.76 185.100.85.132 199.195.248.29 -5.255.96.245 204.85.191.7 -193.32.127.227 107.189.3.244 -185.243.218.50 -152.67.229.162 5.79.109.48 -107.189.12.47 193.218.118.231 -45.61.185.54 107.189.12.97 104.244.75.74 83.97.20.189 -185.10.68.22 -193.32.126.151 107.189.14.27 -152.70.59.26 185.100.86.182 51.195.45.190 193.110.95.34 @@ -1040,7 +819,6 @@ 23.129.64.215 23.129.64.219 23.129.64.217 -185.130.45.170 23.129.64.218 23.129.64.214 5.2.72.113 @@ -1050,20 +828,15 @@ 198.98.61.102 41.215.242.42 178.17.171.150 -31.13.195.124 185.107.70.56 -5.2.77.64 85.93.218.204 62.102.148.68 62.102.148.69 198.46.166.157 185.220.101.17 185.220.101.18 -144.172.118.74 45.61.185.88 -5.2.77.74 68.99.156.190 -23.120.182.121 5.255.97.170 185.165.171.175 41.77.137.114 @@ -1090,69 +863,28 @@ 185.220.103.117 185.220.103.118 185.220.103.119 -91.90.120.138 -91.90.120.131 -86.107.104.249 -86.107.104.232 -156.146.50.153 -156.146.50.130 -156.146.34.78 -185.112.147.12 -185.31.175.191 -185.31.175.188 -185.31.175.196 51.15.76.60 -220.135.161.136 142.4.205.238 45.13.104.179 -31.13.195.94 185.51.76.187 -107.189.13.251 160.119.249.240 -5.188.108.126 -107.189.12.169 51.15.244.188 -107.189.12.7 87.120.8.57 -209.127.17.242 -23.236.146.162 23.154.177.2 23.154.177.6 23.154.177.3 23.154.177.5 23.154.177.7 23.154.177.4 -49.36.228.202 -219.100.37.243 5.2.72.124 5.2.72.73 5.2.72.168 5.2.73.169 5.2.73.229 -92.35.79.252 -92.35.70.172 -219.100.36.177 -198.98.57.230 5.2.75.218 -5.8.95.201 -38.34.184.213 -204.27.60.147 -85.208.110.228 -154.94.7.88 -154.92.22.125 107.189.1.175 81.17.18.58 199.195.253.156 -45.61.186.251 -45.61.186.103 -209.141.36.206 -209.141.44.158 -107.189.14.76 -104.244.72.136 -198.98.62.6 -198.98.56.60 -107.189.10.137 -45.61.184.34 198.98.49.20 185.220.101.146 185.220.101.178 @@ -1202,7 +934,6 @@ 185.220.101.184 185.220.101.187 185.220.101.188 -185.220.101.128 185.220.101.181 185.220.101.154 185.220.101.191 @@ -1215,506 +946,100 @@ 185.220.101.185 185.220.101.190 185.220.101.189 -185.220.101.129 151.80.148.159 -209.141.41.127 5.2.79.111 -86.52.209.68 178.170.37.11 104.244.74.23 209.141.37.94 107.189.29.103 205.185.119.35 192.81.223.177 -5.2.72.75 194.60.87.46 185.117.215.9 -135.125.188.22 -89.212.183.135 -93.103.244.79 -185.220.101.131 -185.220.101.130 -37.120.183.100 -209.141.51.187 -37.120.183.97 -209.141.38.146 -209.141.39.187 -209.141.39.99 -37.120.183.91 -209.141.38.209 -205.185.122.149 +89.58.27.84 +89.248.168.41 158.69.63.54 -185.165.169.200 104.149.136.246 -172.106.16.74 -54.39.209.228 -209.141.59.243 -205.185.116.159 -37.120.183.99 -205.185.125.147 -209.141.38.232 -37.120.183.98 -209.141.43.51 -209.141.39.49 -37.120.183.101 -209.141.41.62 -209.141.38.46 +209.141.36.211 104.244.77.139 51.15.180.36 209.141.58.146 -46.173.218.146 104.244.72.129 -209.141.53.99 -209.141.36.177 -46.161.27.142 -107.189.31.26 -107.189.3.246 -107.189.30.111 -89.34.27.203 -5.180.107.20 -149.28.93.88 -45.136.5.245 -107.189.14.55 -103.214.5.13 -85.254.72.56 104.149.133.54 -172.106.17.218 -158.101.219.32 -185.17.121.254 -185.17.121.250 -185.17.121.251 185.100.87.174 194.32.107.51 -194.85.248.174 95.214.54.97 -156.146.63.138 -156.146.63.16 -191.101.217.16 -156.146.63.137 -156.146.63.21 -176.125.230.28 -185.157.162.201 +191.101.217.20 5.2.70.140 5.255.102.127 -213.203.177.219 -213.203.177.217 5.255.100.243 -185.181.60.16 -194.32.107.72 -194.32.107.59 -194.32.107.55 -194.32.107.56 -194.32.107.71 -194.32.107.58 -194.32.107.69 -185.181.60.99 -185.243.218.60 -194.32.107.57 -194.32.107.54 -185.243.218.40 -194.32.107.68 -194.32.107.70 83.97.20.151 -198.98.49.184 -185.29.10.251 -149.129.250.26 -149.129.254.15 -47.90.252.161 -74.208.87.158 -205.185.115.207 -205.185.113.35 -209.141.45.168 -141.95.159.52 -206.188.197.120 -82.165.183.88 -185.157.80.70 -142.44.133.80 -20.123.18.209 -52.138.168.233 -209.141.44.112 -23.183.81.25 -23.183.82.222 -209.141.56.243 -23.183.83.71 -45.61.188.145 -45.61.185.65 -45.61.185.98 -45.61.184.103 -45.61.187.34 -23.183.82.153 -45.61.186.15 -185.142.236.193 185.247.226.89 -45.61.188.168 37.228.129.109 -195.144.21.228 185.165.171.46 -45.61.185.19 -185.142.236.236 91.234.19.55 198.98.62.150 -95.111.255.193 -82.165.223.202 -45.61.186.171 194.32.107.187 -71.19.150.73 -45.61.186.233 -45.61.186.7 -45.61.184.114 -45.61.188.230 -45.61.184.247 -45.61.186.61 -45.61.186.21 -209.141.48.150 -45.61.185.169 -185.10.68.168 -209.141.54.234 -209.141.55.199 -107.189.31.223 -209.141.55.38 -138.68.155.147 -104.244.72.247 -107.189.11.228 -89.44.197.136 -31.42.176.162 -104.192.3.118 -205.185.124.66 -185.82.217.178 185.220.101.19 185.220.101.24 -185.220.101.30 -185.220.101.25 -185.220.101.27 185.220.101.22 -185.220.101.26 -185.220.101.28 -179.43.187.138 185.220.101.21 185.220.101.20 -185.220.101.29 -199.19.224.239 -185.220.101.31 -107.189.29.105 -107.189.29.107 185.220.101.23 147.135.62.203 -107.189.31.112 -107.189.12.227 -54.146.233.218 -107.189.13.100 -104.244.76.180 -104.244.75.199 -104.244.77.102 -107.189.13.238 -34.126.213.76 -107.189.14.98 -185.220.101.0 -24.151.1.50 45.151.167.12 45.151.167.13 -45.79.58.157 -185.217.1.6 -173.82.68.78 -94.186.197.21 +185.142.239.49 212.47.229.4 107.174.138.172 -193.32.126.161 -89.238.178.75 -181.174.164.37 -65.21.80.142 -65.21.80.138 -135.181.122.185 -89.44.197.33 185.100.87.133 51.15.43.205 -65.21.80.140 -65.21.80.137 -5.230.72.176 -206.166.251.86 -45.61.136.89 -195.90.200.211 -51.81.147.81 -185.232.71.81 -195.123.247.209 -92.205.29.217 -96.22.31.6 193.46.254.26 -31.207.47.47 -51.195.166.171 -195.123.246.144 -23.128.248.11 -198.98.59.65 -45.61.188.164 -199.195.253.162 -23.128.248.13 -198.98.56.81 -205.185.113.72 -45.61.185.168 -23.128.248.12 -209.141.45.227 -209.141.46.47 -91.219.236.176 -104.244.79.203 -104.244.75.155 -107.189.1.187 -107.189.29.249 -107.189.13.219 -107.189.8.46 -185.163.204.160 -185.163.204.111 -104.244.73.66 -107.189.10.131 -104.244.74.112 -185.163.204.197 -185.163.204.125 -91.219.237.18 -107.189.3.89 -107.189.6.173 -185.163.204.237 -107.189.31.141 -104.244.73.158 -107.189.1.211 -185.163.204.128 -107.189.12.87 -107.189.13.43 -107.189.30.72 -104.244.77.167 -107.189.11.96 -107.189.8.126 -107.189.12.120 -104.244.76.82 -107.189.14.46 -107.189.2.236 -91.219.237.229 -107.189.12.105 -107.189.30.88 -107.189.13.230 -107.189.14.123 -107.189.14.96 -107.189.14.163 -107.189.14.180 -107.189.14.78 -107.189.28.197 -45.61.185.74 -107.189.4.201 -107.189.1.219 -107.189.10.68 -107.189.4.135 -107.189.5.13 -104.244.76.190 -104.244.76.102 -107.189.8.233 -107.189.11.250 -91.219.238.96 -107.189.12.70 -185.163.204.136 -107.189.11.120 -107.189.29.252 -107.189.13.113 -107.189.3.83 -107.189.28.214 -213.159.244.99 -107.189.6.50 -107.189.5.39 -104.244.75.60 -104.244.75.6 -104.244.73.55 -107.189.14.140 -107.189.31.16 -107.189.8.135 -91.219.236.200 -107.189.14.10 -104.244.79.192 -107.189.1.203 -107.189.6.37 -101.127.180.196 -45.61.186.225 -188.68.62.150 -188.68.62.139 -94.45.137.158 -178.158.233.93 -188.68.62.149 -84.249.59.60 -65.108.154.115 -51.159.67.223 -185.113.140.90 +89.58.30.164 144.217.86.109 -198.98.59.195 -82.165.111.147 -24.214.252.110 -179.43.175.65 -83.149.110.185 23.184.48.209 -194.195.242.65 -146.59.45.142 45.61.187.26 -5.255.97.211 -84.140.163.31 -37.221.66.128 -103.73.64.111 -209.141.45.215 -185.17.123.84 185.143.220.236 -185.17.123.82 194.147.84.41 -185.17.123.85 -45.95.11.159 -185.157.160.115 -45.141.56.79 -213.232.235.228 -93.95.231.13 -163.172.60.213 -83.97.20.80 199.195.248.20 -192.53.162.179 45.61.187.94 -107.189.30.70 -45.61.139.90 45.154.168.39 -152.70.161.130 -94.140.114.193 117.53.155.129 185.36.81.95 -52.26.52.123 -78.24.219.51 -37.120.182.1 -188.68.62.252 -188.68.62.244 -23.254.142.207 -79.141.167.2 -185.41.69.47 -150.95.214.190 -18.190.114.245 -203.206.117.28 93.95.230.253 89.58.19.2 -194.233.166.189 -185.191.124.150 -185.191.124.151 147.135.62.201 -103.214.5.127 -152.70.208.182 -172.107.241.110 -93.95.231.58 -5.255.97.237 -70.34.203.203 51.15.67.157 185.170.114.243 -104.244.75.164 -89.221.219.185 -104.244.76.233 -51.195.166.177 -140.238.156.114 -185.209.196.164 -146.59.10.127 -147.182.213.236 -34.131.223.10 -34.124.209.100 -202.61.205.29 +173.237.206.68 93.95.231.27 194.32.107.159 5.45.100.222 -107.189.1.34 194.32.107.161 -150.230.29.26 -198.98.60.54 152.89.107.127 -5.255.100.26 -150.230.26.151 -172.245.190.118 -72.14.189.179 -194.233.160.145 -139.177.199.216 -109.74.203.74 -159.223.56.232 -31.222.238.75 -86.127.133.22 -188.27.79.140 -5.12.198.40 -146.59.10.130 -135.125.147.170 -89.137.155.17 -51.81.33.224 -207.188.139.168 -185.186.142.34 -188.130.139.178 -109.248.201.48 +51.81.85.168 +198.98.49.184 194.32.107.171 -27.32.12.118 -164.90.168.77 -142.44.156.144 -106.68.165.195 -193.119.46.71 -104.219.236.100 -185.193.125.42 -5.255.98.156 -45.77.4.154 -87.229.6.65 192.144.39.121 -45.61.188.32 -104.168.44.51 -79.112.133.210 -79.112.158.237 -79.112.143.23 -108.61.229.72 185.247.226.69 202.61.224.72 -54.38.185.176 -27.33.157.178 -58.104.185.68 -23.128.248.17 -23.128.248.16 -23.128.248.15 -23.128.248.14 -107.189.13.42 -198.98.60.43 -23.128.248.18 -185.191.124.152 -185.191.124.153 -167.172.43.61 -2.84.8.172 -198.251.88.26 -217.133.35.146 -194.32.107.157 -82.118.18.244 -185.146.232.20 +5.255.98.156 +104.219.236.100 124.156.9.65 -34.131.111.117 51.15.7.157 -185.105.116.219 -107.189.14.3 144.172.118.37 40.71.125.29 -138.124.183.65 -80.92.205.188 213.66.116.248 -23.175.32.11 -209.127.78.218 23.184.48.238 51.158.147.221 -212.192.216.105 -71.19.148.87 -185.243.218.46 -185.243.218.41 -67.249.107.195 162.219.176.3 -184.75.223.195 -184.75.221.171 +74.82.47.194 93.95.230.245 -31.13.195.141 37.48.117.204 -45.9.148.215 -138.197.162.69 185.112.144.158 -45.61.173.71 45.61.173.73 -23.236.146.166 -78.60.180.159 46.226.105.168 37.187.49.191 -198.144.120.177 -198.144.120.234 -209.141.50.247 209.141.55.96 185.130.47.82 23.154.177.19 @@ -1723,37 +1048,156 @@ 23.154.177.20 89.58.17.76 188.68.58.0 -37.221.211.54 +185.243.218.41 +185.243.218.46 185.193.127.45 -31.220.2.100 -161.97.116.228 185.225.68.13 -31.42.186.114 -62.182.84.30 -31.42.186.113 -62.182.84.155 -199.195.250.229 -199.195.251.151 -198.98.49.221 -45.61.187.111 69.61.38.236 -193.119.39.173 -110.175.240.206 +104.192.3.118 103.234.220.205 -198.98.51.65 -199.195.251.68 104.219.236.119 -193.218.118.55 31.42.184.136 -195.2.74.173 -164.92.250.62 +172.81.131.110 172.107.94.154 -185.150.119.132 +185.247.225.60 +23.175.32.11 193.218.118.158 81.16.33.42 -72.11.137.182 46.38.247.22 185.243.216.93 -185.243.216.92 185.243.216.17 -185.243.216.91 +167.71.5.126 +85.165.185.74 +23.175.32.13 +109.70.100.76 +109.70.100.82 +109.70.100.83 +109.70.100.75 +109.70.100.81 +109.70.100.78 +109.70.100.84 +109.70.100.77 +109.70.100.79 +109.70.100.80 +185.220.101.76 +185.220.101.65 +185.220.101.85 +185.220.101.71 +185.220.101.69 +185.220.101.80 +185.220.101.72 +185.220.101.84 +185.220.101.79 +185.220.101.68 +185.220.101.86 +185.220.101.74 +185.220.101.87 +185.220.101.83 +185.220.101.78 +185.220.101.73 +185.220.101.66 +185.220.101.81 +185.220.101.75 +185.220.101.67 +185.220.101.77 +185.220.101.82 +185.220.101.64 +185.220.101.70 +135.148.138.206 +51.81.87.149 +45.56.70.111 +45.33.106.16 +185.254.75.32 +185.247.225.62 +80.78.22.210 +87.120.254.105 +118.163.74.160 +45.227.255.35 +212.102.39.137 +185.247.226.96 +185.247.226.97 +185.247.226.98 +83.97.20.84 +185.112.147.12 +185.247.225.61 +185.247.225.64 +185.247.225.63 +209.141.44.64 +193.38.54.131 +216.239.90.19 +5.255.99.188 +212.227.10.157 +23.128.248.10 +23.128.248.13 +23.128.248.11 +23.128.248.14 +23.128.248.12 +23.128.248.18 +23.128.248.16 +23.128.248.20 +23.128.248.17 +23.128.248.19 +23.128.248.15 +198.98.50.199 +185.146.232.25 +87.249.134.84 +205.185.122.29 +37.221.209.148 +192.109.119.104 +23.128.248.24 +23.128.248.28 +23.128.248.27 +23.128.248.25 +23.128.248.23 +23.128.248.26 +23.128.248.29 +23.128.248.22 +185.10.68.126 +23.128.248.21 +195.238.126.90 +23.184.48.252 +65.21.217.81 +23.184.48.250 +23.184.48.253 +23.184.48.249 +5.199.174.107 +23.184.48.248 +23.184.48.251 +71.19.144.235 +23.184.48.28 +23.184.48.27 +23.184.48.29 +91.211.89.198 +23.184.48.30 +91.211.89.30 +103.242.117.120 +109.220.104.162 +193.189.100.167 +193.189.100.168 +193.189.100.169 +185.14.97.117 +185.14.97.76 +185.14.97.192 +45.82.67.10 +185.14.97.89 +185.14.97.75 +185.14.97.188 +185.14.97.185 +185.14.97.191 +185.14.97.74 +193.218.118.73 +91.211.91.212 +91.211.91.214 +91.211.91.210 +91.211.91.76 +91.211.91.220 +91.211.91.219 +91.211.91.78 +91.211.91.213 +91.211.91.183 +91.211.91.218 +91.211.91.215 +91.211.91.217 +91.211.91.216 +216.10.247.146 +176.119.159.28 diff --git a/torips.py b/torips.py index de60259..0e3f6c5 100644 --- a/torips.py +++ b/torips.py @@ -1,6 +1,8 @@ import os import datetime import psycopg2 +import requests +import sys import pdb def insert_tor_ip(tor_ip): @@ -33,6 +35,36 @@ def insert_tor_ip(tor_ip): conn.close() +def get_torbulk_list(): + + is_saved = False + + try: + + user_agent = {'User-agent': 'Mozilla/5.0'} + + response = requests.get('https://check.torproject.org/torbulkexitlist', headers = user_agent, timeout=3) + + if response.status_code == 200: + + with open('torbulkexitlist', 'wb') as f: + + f.write(response.content) + + is_saved = True + + else: + + sys.exit(f'download error: {response.status_code}') + + except requests.exceptions.ConnectionError as conn_error: + + print(f'{conn_error}') + + pass + + return is_saved + def db_config(): # Load db configuration from config file @@ -43,7 +75,7 @@ def db_config(): return (spamcheck_db, spamcheck_db_user) def get_parameter( parameter, file_path ): - # Check if secrets file exists + if not os.path.isfile(file_path): print("File %s not found, exiting."%file_path) sys.exit(0) @@ -63,16 +95,32 @@ if __name__ == '__main__': spamcheck_db, spamcheck_db_user = db_config() now = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S") + + is_saved = get_torbulk_list() + + if is_saved: - filepath = 'torbulkexitlist' - with open(filepath) as fp: - line = fp.readline() - cnt = 1 - while line: - #print("Line {}: {}".format(cnt, line.strip())) - line = fp.readline().rstrip('\n') - if line != '': - insert_tor_ip(line) - cnt += 1 + filepath = 'torbulkexitlist' + + with open(filepath) as fp: + + line = fp.readline() + cnt = 1 + + while line: + + line = fp.readline().rstrip('\n') + + if line != '': + + insert_tor_ip(line) + + cnt += 1 + + print(f'Tor exit nodes: {cnt-1}') + + else: + + sys.exit('error downloading torbulkexitlist file')