├── README.md ├── LICENSE ├── main.py └── ipdb.txt /README.md: -------------------------------------------------------------------------------- 1 | # ban-pcdn-ip 2 | 3 | **20250405开始恢复更新,数据来源为本人的CDN异常刷量记录** 4 | 5 | 收集恶意刷取网站CDN流量的PCDN IP段清单。 6 | 一些PCDN的所有者已经将原先的BT流量来源切换为使用CDN的网站,导致许多站长面临大额的账单支出。 7 | 8 | 9 | 10 | ## ip清单 11 | ipdb.txt文件,已经排序。 12 | 13 | ## main.py 14 | 用来对ipdb.txt进行排序和去重的脚本。 15 | 16 | 17 | ## 关于补充ip数据 18 | 本人现在已经没有精力维护他人提交的IP,只不定期更新自己CDN被刷的IP数据。 19 | 20 | 21 | ## 情况介绍部分链接 22 | 23 | ### v2ex 24 | https://www.v2ex.com/t/1056361 25 | 26 | https://www.v2ex.com/t/1055550 27 | 28 | https://www.v2ex.com/t/1055838 29 | 30 | https://www.v2ex.com/t/1055510 31 | 32 | https://www.v2ex.com/t/1055422 33 | 34 | https://www.v2ex.com/t/1052331 35 | 36 | https://www.v2ex.com/t/1045318 37 | 38 | ### 多吉云公告 39 | https://www.dogecloud.com/announcement/26 40 | 41 | ### 其他 42 | https://linux.do/t/topic/169770 43 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 张学友 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /main.py: -------------------------------------------------------------------------------- 1 | # 对ipdb.txt的内容进行去重和排序,并输出到ipdb.txt中 2 | 3 | # 将ipdb.txt备份为ipdb_日期_时间.txt 格式 4 | import datetime 5 | 6 | def main(filename='ipdb.txt'): 7 | date = datetime.datetime.now().strftime('%Y-%m-%d-%H-%M-%S') 8 | with open(filename, 'r') as f: 9 | lines = f.readlines() 10 | print(f"{filename.split('.')[0]}_{date}.txt") 11 | with open(f"{filename.split('.')[0]}_{date}.txt", 'w') as f: 12 | f.write(''.join(lines)) 13 | print('备份完成!') 14 | 15 | with open(filename, 'r') as f: 16 | # 读取内容,并将每行的数据进行排序 17 | lines = f.readlines() 18 | lines_without_newlines = [line.strip() for line in lines] 19 | # 对lines_without_newlines进行去重 20 | lines_without_newlines = list(set(lines_without_newlines)) 21 | # 剔除lines_without_newlines中空的元素和#开头的元素 22 | lines_without_newlines = [line for line in lines_without_newlines if line and not line.startswith('#')] 23 | # 将ip清单中的每个ip地址按照点分十进制进行排序 24 | lines_without_newlines.sort(key=lambda x: tuple(map(int, x.split('/')[0].split('.')))) 25 | # 在lines_without_newlines开头插入新元素 26 | lines_without_newlines.insert(0, '# IP段清单') 27 | print(lines_without_newlines) 28 | # 打印lines_without_newlines的长度 29 | print(len(lines_without_newlines)) 30 | # 将排序后的内容写入文件,要求每个元素一行 31 | with open(filename, 'w') as f: 32 | f.write('\n'.join(lines_without_newlines)) 33 | print('排序完成,更新完成!') 34 | 35 | 36 | 37 | if __name__ == '__main__': 38 | main() -------------------------------------------------------------------------------- /ipdb.txt: -------------------------------------------------------------------------------- 1 | # IP段清单 2 | 27.221.70.0/24 3 | 36.5.81.0/24 4 | 36.35.38.0/24 5 | 36.134.76.0/24 6 | 36.151.55.0/24 7 | 36.249.150.0/24 8 | 39.74.239.0/24 9 | 42.48.90.0/24 10 | 43.254.0.0/16 11 | 49.71.0.0/16 12 | 49.86.0.0/16 13 | 52.81.120.0/24 14 | 54.223.199.0/24 15 | 58.220.0.0/16 16 | 58.222.32.0/24 17 | 58.222.37.0/24 18 | 58.222.48.0/24 19 | 60.190.128.0/24 20 | 60.220.182.0/24 21 | 60.221.195.0/24 22 | 60.221.231.0/24 23 | 61.146.45.0/24 24 | 61.147.95.0/24 25 | 61.160.233.0/24 26 | 61.160.239.0/24 27 | 61.179.15.0/24 28 | 61.241.177.0/24 29 | 101.71.195.0/24 30 | 106.6.215.0/24 31 | 111.121.27.0/24 32 | 111.225.148.0/24 33 | 113.231.202.0/24 34 | 114.230.0.0/16 35 | 116.179.37.0/24 36 | 116.179.152.0/24 37 | 116.246.1.0/24 38 | 117.91.0.0/16 39 | 117.157.66.0/24 40 | 118.81.184.0/23 41 | 121.233.0.0/16 42 | 122.195.22.0/24 43 | 123.6.49.0/24 44 | 123.169.0.0/16 45 | 124.132.156.0/24 46 | 124.163.207.0/24 47 | 124.163.220.0/24 48 | 124.224.38.0/24 49 | 140.75.0.0/16 50 | 150.138.41.0/24 51 | 153.99.251.0/24 52 | 153.101.51.0/24 53 | 153.101.64.0/23 54 | 153.101.141.0/24 55 | 175.42.154.0/23 56 | 175.44.72.0/23 57 | 180.103.52.0/24 58 | 180.118.170.0/24 59 | 180.119.68.0/24 60 | 182.34.0.0/16 61 | 183.131.178.0/24 62 | 183.185.14.0/24 63 | 183.199.230.0/24 64 | 183.222.140.0/23 65 | 183.224.221.0/24 66 | 211.90.146.0/23 67 | 211.93.170.0/24 68 | 218.90.204.0/24 69 | 218.91.0.0/16 70 | 220.248.203.0/24 71 | 221.0.30.0/24 72 | 221.2.164.0/24 73 | 221.6.171.0/24 74 | 221.7.251.0/24 75 | 221.205.168.0/23 76 | 221.230.244.0/24 77 | 222.94.227.0/24 78 | 222.125.57.0/24 79 | 222.180.198.0/24 80 | 222.186.13.0/24 81 | 222.186.16.0/24 82 | 222.186.132.0/24 83 | 222.186.159.0/24 84 | 222.189.163.0/24 --------------------------------------------------------------------------------