diff --git a/Cargo.lock b/Cargo.lock index 7e708f5..39fc028 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -56,7 +56,7 @@ checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" [[package]] name = "cloudcheck" -version = "8.4.1" +version = "8.4.2" dependencies = [ "openssl", "pyo3", diff --git a/Cargo.toml b/Cargo.toml index 36e4a60..2ed3ff4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cloudcheck" -version = "8.4.1" +version = "8.4.2" edition = "2024" description = "CloudCheck is a simple Rust tool to check whether an IP address or hostname belongs to a cloud provider." license = "GPL-3.0" diff --git a/cloud_providers_v2.json b/cloud_providers_v2.json index 310692f..4256c87 100644 --- a/cloud_providers_v2.json +++ b/cloud_providers_v2.json @@ -8,7 +8,7 @@ "ORG-OS3-RIPE" ], "v2fly_company": "", - "last_updated": 1765991171.3882864, + "last_updated": 1766008490.7504184, "asns": [ 16276, 35540 @@ -543,7 +543,7 @@ "SKYCA-3-ARIN" ], "v2fly_company": "fastly", - "last_updated": 1765991173.7079117, + "last_updated": 1766008492.4754348, "asns": [ 895, 54113, @@ -1596,7 +1596,7 @@ ], "org_ids": [], "v2fly_company": "heroku", - "last_updated": 1765991173.992137, + "last_updated": 1766008492.719316, "asns": [], "cidrs": [], "domains": [ @@ -1638,7 +1638,7 @@ "WEX-ARIN" ], "v2fly_company": "cisco", - "last_updated": 1765991184.707938, + "last_updated": 1766008503.9588478, "asns": [ 109, 1343, @@ -2443,7 +2443,7 @@ "GITHU-ARIN" ], "v2fly_company": "github", - "last_updated": 1765991186.1348774, + "last_updated": 1766008505.3642943, "asns": [ 36459 ], @@ -2753,6 +2753,7 @@ "135.130.176.0/23", "135.130.180.0/22", "135.130.184.0/22", + "135.130.196.0/23", "135.130.24.0/24", "135.130.25.128/25", "135.130.26.0/23", @@ -2813,6 +2814,7 @@ "145.190.130.0/24", "145.190.133.0/24", "145.190.134.0/23", + "145.190.137.0/24", "145.190.32.0/20", "145.190.48.0/22", "145.190.59.0/24", @@ -3311,11 +3313,7 @@ "20.20.101.160/27", "20.20.101.192/26", "20.20.102.0/26", - "20.20.102.128/26", - "20.20.102.192/27", - "20.20.102.224/29", - "20.20.102.232/30", - "20.20.102.236/31", + "20.20.102.128/25", "20.20.102.64/28", "20.20.102.80/29", "20.20.102.90/31", @@ -3333,19 +3331,12 @@ "20.20.53.32/27", "20.20.53.64/26", "20.20.55.0/27", - "20.20.76.0/23", - "20.20.78.0/24", - "20.20.79.0/25", - "20.20.79.128/26", - "20.20.79.192/29", - "20.20.79.200/30", - "20.20.79.204/31", + "20.20.76.0/22", "20.20.92.0/23", "20.20.94.0/25", - "20.20.94.128/27", - "20.20.94.160/28", - "20.20.94.176/29", - "20.20.94.184/31", + "20.20.94.128/26", + "20.20.94.192/30", + "20.20.94.196/31", "20.200.245.241/32", "20.200.245.245/32", "20.200.245.247/32", @@ -4174,7 +4165,14 @@ "2603:1030:401:a30::/61", "2603:1030:401:a38::/63", "2603:1030:401:a3c::/64", + "2603:1030:401:a3f::/64", + "2603:1030:401:a40::/61", + "2603:1030:401:a48::/62", "2603:1030:401:a4::/63", + "2603:1030:401:a4c::/63", + "2603:1030:401:a4e::/64", + "2603:1030:401:a51::/64", + "2603:1030:401:a52::/64", "2603:1030:401:a7::/64", "2603:1030:401:a8::/61", "2603:1030:401:b0::/60", @@ -4266,7 +4264,8 @@ "2603:1030:804:53::/64", "2603:1030:804:540::/59", "2603:1030:804:54::/64", - "2603:1030:804:560::/61", + "2603:1030:804:560::/60", + "2603:1030:804:570::/64", "2603:1030:804:5a::/63", "2603:1030:804:5c::/62", "2603:1030:804:60::/62", @@ -4472,9 +4471,8 @@ "2603:1030:9:7c0::/58", "2603:1030:9:800::/59", "2603:1030:9:80::/59", - "2603:1030:9:820::/62", - "2603:1030:9:824::/63", - "2603:1030:9:826::/64", + "2603:1030:9:820::/60", + "2603:1030:9:830::/62", "2603:1030:9:8::/61", "2603:1030:9:a0::/60", "2603:1030:9:b2::/63", @@ -4501,8 +4499,6 @@ "2603:1030:b06::/48", "2603:1030:b07::/56", "2603:1030:b08::/48", - "2603:1030:b40::/48", - "2603:1030:b80::/56", "2603:1030:c00::/48", "2603:1030:c02::/47", "2603:1030:c04::/46", @@ -6535,11 +6531,15 @@ "57.157.1.96/29", "57.157.12.0/23", "57.157.128.0/25", - "57.157.128.128/29", - "57.157.128.136/30", - "57.157.128.140/31", + "57.157.128.128/28", + "57.157.128.144/30", + "57.157.128.148/31", "57.157.14.0/24", - "57.157.15.0/28", + "57.157.15.0/26", + "57.157.15.112/29", + "57.157.15.120/30", + "57.157.15.64/27", + "57.157.15.96/28", "57.157.2.0/26", "57.157.2.112/29", "57.157.2.120/30", @@ -6552,8 +6552,10 @@ "57.157.2.96/28", "57.157.28.0/24", "57.157.29.0/25", - "57.157.29.128/30", - "57.157.29.132/31", + "57.157.29.128/27", + "57.157.29.160/29", + "57.157.29.168/30", + "57.157.29.172/31", "57.157.3.0/25", "57.157.3.128/27", "57.157.3.160/28", @@ -6564,18 +6566,24 @@ "57.157.3.204/30", "57.157.3.208/28", "57.157.3.224/27", - "57.157.32.0/25", - "57.157.32.128/26", - "57.157.32.192/27", - "57.157.32.224/30", - "57.157.32.228/31", + "57.157.32.0/24", + "57.157.33.0/30", "57.157.4.0/24", "57.157.44.0/27", - "57.157.44.32/31", + "57.157.44.32/28", + "57.157.44.48/29", + "57.157.44.56/30", "57.157.48.0/27", "57.157.48.128/27", "57.157.48.160/30", "57.157.48.168/31", + "57.157.48.174/31", + "57.157.48.176/28", + "57.157.48.192/29", + "57.157.48.200/30", + "57.157.48.204/31", + "57.157.48.210/31", + "57.157.48.212/31", "57.157.48.32/29", "57.157.48.40/30", "57.157.48.46/31", @@ -6598,6 +6606,7 @@ "57.157.7.52/30", "57.157.7.56/29", "57.157.7.64/26", + "57.157.72.0/29", "57.157.8.0/22", "64.236.0.0/16", "64.4.54.0/24", @@ -6786,7 +6795,7 @@ "ORG-SCG6-RIPE" ], "v2fly_company": "ibm", - "last_updated": 1765991203.6873004, + "last_updated": 1766008523.2625492, "asns": [ 163, 547, @@ -7281,7 +7290,7 @@ "IMPER-62-ARIN" ], "v2fly_company": "", - "last_updated": 1765991204.40327, + "last_updated": 1766008523.9751034, "asns": [ 62571 ], @@ -7327,7 +7336,7 @@ "ORG-HTB10-RIPE" ], "v2fly_company": "huawei", - "last_updated": 1765991207.2331975, + "last_updated": 1766008526.8373091, "asns": [ 131444, 136907, @@ -7963,7 +7972,7 @@ "ORG-TCL14-AP-APNIC" ], "v2fly_company": "tencent", - "last_updated": 1765991209.0214534, + "last_updated": 1766008528.6816173, "asns": [ 132203, 132591, @@ -8342,6 +8351,8 @@ ], "domains": [ "17roco.com", + "acctdns.com", + "acctdns.net", "acimg.cn", "ad.browser.qq.com", "ad.qq.com", @@ -8364,26 +8375,149 @@ "adsview2.qq.com", "adv.app.qq.com", "adver.qq.com", + "aegis.qq.com", + "aitransfy.com", "alloyteam.com", "anticheatexpert.com", + "ap-bangkok.myqcloud.com", + "ap-bangkok.tencentcos.cn", + "ap-bangkok.tencentcos.com", + "ap-bangkok.tencentcos.com.cn", + "ap-hongkong.myqcloud.com", + "ap-hongkong.tencentcos.cn", + "ap-hongkong.tencentcos.com", + "ap-hongkong.tencentcos.com.cn", + "ap-jakarta.myqcloud.com", + "ap-jakarta.tencentcos.cn", + "ap-jakarta.tencentcos.com", + "ap-jakarta.tencentcos.com.cn", + "ap-mumbai.myqcloud.com", + "ap-mumbai.tencentcos.cn", + "ap-mumbai.tencentcos.com", + "ap-mumbai.tencentcos.com.cn", + "ap-seoul.myqcloud.com", + "ap-seoul.tencentcos.cn", + "ap-seoul.tencentcos.com", + "ap-seoul.tencentcos.com.cn", + "ap-singapore.myqcloud.com", + "ap-singapore.tencentcos.cn", + "ap-singapore.tencentcos.com", + "ap-singapore.tencentcos.com.cn", + "ap-tokyo.myqcloud.com", + "ap-tokyo.tencentcos.cn", + "ap-tokyo.tencentcos.com", + "ap-tokyo.tencentcos.com.cn", + "apaas-zone-test.com", "apcdns.net", + "apdcdn.com", + "apdcdn.net", + "apigwtencent.com", "badjs.weixinbridge.com", "battlecare.net", "bcfmglobal.com", "beacon.cdn.qq.com", "beacon.qq.com", "beaconcdn.qq.com", + "bj.file.myqcloud.com", + "bkapigw.com", + "bkapps.com", + "bkclouds.cc", + "bktencent.com", "brawlstars.cn", "btrace.qq.com", "bugly.qq.com", + "build9s.io", + "byodonline.com", + "ca.file.myqcloud.com", + "cd.file.myqcloud.com", + "cdn-go.cn", + "cdndoctor.com", + "cdngot.com", + "cdntip.com", + "cdntips.com", + "cdntips.net", + "cdnv1.cn", + "cdnv2.cn", + "cdnv3.cn", + "cloud-industry-delivery.site", + "cloudbase.cn", + "cloudbase.net", + "cloudidaas.com", + "cloudsite.vip", "cnb.cool", + "cncqcloud.com", "coding.me", "coding.net", "codm.com", + "computeinit.com", + "comsenz.com", + "coolsite.vip", + "cosbj.myqcloud.com", + "cosca.myqcloud.com", + "coscd.myqcloud.com", + "cosger.myqcloud.com", + "cosgz.myqcloud.com", + "coshk.myqcloud.com", + "cossgp.myqcloud.com", + "cossh.myqcloud.com", + "costj.myqcloud.com", + "dcloudlive.com", + "dcloudlive.net", + "dcloudsp.com", + "dcloudsp.net", + "dcloudstc.com", + "dcloudstc.net", + "dcloudvod.com", + "dcloudvod.net", + "discuz.net", + "discuz.org", + "dns.pub", + "dnsapi.cn", + "dnse0.cn", + "dnse0.com", + "dnse1.cn", + "dnse1.com", + "dnse2.cn", + "dnse2.com", + "dnse3.cn", + "dnse3.com", + "dnse4.cn", + "dnse4.com", + "dnse5.cn", + "dnse5.com", + "dnspod.cn", + "dnspod.com", + "dnspod.com.cn", + "dnspod.mobi", + "dnspod.net", + "dnspod.org", + "dnsv1.com", + "dnsv1.com.cn", + "dnsv2.com", + "dnsv3.com", + "dnsv4.com", + "dnsv5.com", + "doh.pub", + "dot.pub", + "dothework.cn", "e.qq.com", + "ectencent.cn", + "ectencent.com.cn", + "edgeonedy1.com", + "essurl.com", + "eu-frankfurt.myqcloud.com", + "eu-frankfurt.tencentcos.cn", + "eu-frankfurt.tencentcos.com", + "eu-frankfurt.tencentcos.com.cn", + "eu-moscow.myqcloud.com", + "eu-moscow.tencentcos.cn", + "eu-moscow.tencentcos.com", + "eu-moscow.tencentcos.com.cn", + "exmailgz.com", "ffbuddy.com", "foxmail.com", "foxmail.com.cn", + "fsphere.cn", "fyeds.com", "fyeds0.com", "fyeds1.com", @@ -8406,6 +8540,7 @@ "fymallqa4.com", "fymallqa7.com", "fymallqa9.com", + "gaapqcloud.com", "gamebonfire.com", "gameitop.com", "gameloop.com", @@ -8417,36 +8552,58 @@ "gcloudsvcs.com", "gdt.qq.com", "gdtimg.com", + "ger.file.myqcloud.com", + "gitdrone.cn", + "gmedev.cn", "goto-game.com", "goto-game.mobi", "goto-game.net.cn", "goto-game.org", "gotolink.net", "gouhuo.qq.com", + "govqcloud.com", + "gsadds.com", "gtgres.com", "gtimg.cn", "gtimg.com", "gtimg.com.cn", + "gtm.pub", + "gz.file.myqcloud.com", "happyhlddz.com", "haydaypop.cn", "hdyxgame.com", + "hk.file.myqcloud.com", "hkgcloudcs.com", "hongxiu.com", "hq-tracking.qq.com", + "hr-welink.com", "htrace.wetvinfo.com", + "idcgcloudcs.com", "idqqimg.com", + "iemiq.com", + "igtm-meeting-tencent.com", + "igtm.pub", "ihappystudio.cn", "ihappystudio.com", "imqq.com", "imweb.io", "in.th", + "intltencentcos.com", + "isd.com", "isdspeed.qq.com", + "ispqcloud.com", + "itopsdk.com", "ivweb.io", + "jrzk.net.cn", "labycore.cn", "log.tbs.qq.com", "lrts.me", "ludosuperstar.cn", "ludoworld.net", + "m1.run", + "m6.run", + "m9.run", + "ma.run", "mahjongai.net", "mahjongcup.cn", "mahjongcup.com", @@ -8460,19 +8617,69 @@ "mszdld.com", "mszdld.net", "mtrace.qq.com", + "my-qcloud.com", "myapp.com", + "myelasticsearch.com", + "myqcloud.com", + "na-ashburn.myqcloud.com", + "na-ashburn.tencentcos.cn", + "na-ashburn.tencentcos.com", + "na-ashburn.tencentcos.com.cn", + "na-siliconvalley.myqcloud.com", + "na-siliconvalley.tencentcos.cn", + "na-siliconvalley.tencentcos.com", + "na-siliconvalley.tencentcos.com.cn", + "na-toronto.myqcloud.com", + "na-toronto.tencentcos.cn", + "na-toronto.tencentcos.com", + "na-toronto.tencentcos.com.cn", "nagcloudcs.com", "nextstudios.com", "nextworkshop.net", + "onexmail.com", + "openapp.run", "openmidas.com", + "oracle-tencent.cn", + "oracle-tencent.com", + "oracle-tencent.com.cn", + "oracle-tencent.net", + "oracle-tencent.net.cn", + "ovscdns.com", + "ovscdns.net", "pgdt.gtimg.cn", "pingjs.qq.com", + "pn1waq.com", "proximabeta.com", "pubghelper.com", "pubgno1.cn", "pubgtool.com", "push.qq.com", + "qcloud-edumall.com", + "qcloud.com", + "qcloud.la", + "qcloudapps.com", + "qcloudcdn.com", + "qcloudcdntest.cn", + "qcloudclass.com", + "qcloudcos.cn", + "qcloudcos.com", + "qcloudcos.com.cn", + "qclouder.com", + "qcloudgme.com", + "qcloudimg.com", + "qcloudipv6.com", + "qcloudmarket.com", + "qcloudns.com", + "qcloudsmartiot.com", + "qcloudtcic.com", + "qcloudtiw.com", + "qcloudtrip.com", + "qcloudtt.com", + "qcloudwaf.com", "qdmm.com", + "qdwebim.com", + "qeodns.com", + "qeodns.net", "qidian.com", "qlivecdn.com", "qlogo.cn", @@ -8486,6 +8693,9 @@ "qqgameapp.com", "qqgamedesign.com", "qqmail.com", + "qqmra.cn", + "qqmra.com", + "qyunapp.com", "qzone.com", "readnovel.com", "realcybertron.com", @@ -8497,23 +8707,102 @@ "roco.qq.com", "rongshuxia.com", "rtx.com.cn", + "rumt-sg.com", + "rumt-us.com", + "rumt-zh.com", + "sa-saopaulo.myqcloud.com", + "sa-saopaulo.tencentcos.cn", + "sa-saopaulo.tencentcos.com", + "sa-saopaulo.tencentcos.com.cn", "sccreator.cn", "sccreators.cn", "scescdn.cn", "scid.cn", "scsentry.cn", + "serverlesscloud.cn", "servicewechat.com", + "sgp.file.myqcloud.com", + "sh.file.myqcloud.com", "skydweller.cn", + "smtcdns.com", + "smtcdns.net", "sngmta.qq.com", + "spcdntip.com", + "spcdntipbak.com", + "spcloudhw.com", + "spcloudhw.net", + "srmkp.cn", + "starlakelab.com", "stat.y.qq.com", "supercellcommunity.cn", "supercellsupport.cn", "syxlgame.com", "tajs.qq.com", + "tamaegis.com", + "tapd.cn", + "tcdlive.com", + "tcdnhw.com", + "tcdnkcbak.com", + "tcdnlive.com", + "tcdnlivebak1.com", + "tcdnlivebak2.com", + "tcdnos.com", + "tcdnos.net", + "tcdntip.com", + "tcdnvod.com", + "tcdnvodbak.com", "tcfmglobal.com", + "tcloudbase.com", + "tcloudbase.net", + "tcloudbaseapp.com", + "tcloudbi.com", + "tclouddrive.com", + "tcloudedu.com", + "tcloudhw.com", + "tcloudhw.net", + "tcloudscdn.com", + "tcloudscdn.net", "tcss.qq.com", + "tdnsstic1.cn", + "tdnsv1.com", + "tdnsv1.net", + "tdnsv10.com", + "tdnsv10.net", + "tdnsv11.com", + "tdnsv11.net", + "tdnsv12.com", + "tdnsv12.net", + "tdnsv13.com", + "tdnsv13.net", + "tdnsv14.com", + "tdnsv14.net", + "tdnsv15.com", + "tdnsv15.net", + "tdnsv2.com", + "tdnsv2.net", + "tdnsv3.com", + "tdnsv3.net", + "tdnsv4.com", + "tdnsv4.net", + "tdnsv5.com", + "tdnsv5.net", + "tdnsv6.com", + "tdnsv6.net", + "tdnsv7.com", + "tdnsv7.net", + "tdnsv8.com", + "tdnsv8.net", + "tdnsv9.com", + "tdnsv9.net", + "tdnsx1.com", + "techo.chat", + "tefscloud.com", + "tefscloud.net", + "tenant-zone-dev.com", + "tencdns.net", "tencent-cloud.cn", "tencent-cloud.com", + "tencent-cloud.net", "tencent-gcloud.com", "tencent.cn", "tencent.co.id", @@ -8523,22 +8812,87 @@ "tencent.design", "tencent.net", "tencent.net.cn", + "tencentapps.com", + "tencentbyod.com", + "tencentcdb.cn", + "tencentcdb.com", + "tencentcdb.com.cn", + "tencentclb.com", + "tencentcloud-aiot.com", "tencentcloud.com", + "tencentcloudapi.com", + "tencentcloudclub.com", + "tencentcloudcr.com", + "tencentcloudmarket.com", + "tencentcloudns.com", + "tencentcloudsec.com", + "tencentcloudses.com", + "tencentcos.cn", + "tencentcos.com", + "tencentcos.com.cn", + "tencentcs.cn", + "tencentcs.com", + "tencentdayu.com", + "tencentdb.com", + "tencentdevices.com", + "tencentdigitalassistant.com", + "tencentdms.com", + "tencenteiam.com", + "tencentelasticsearch.com", + "tencentid.com", + "tencentidentity.com", "tencentmusic.com", + "tencentproxy.com", + "tencentrio.com", "tencentstart.com", + "tencenttid.com", + "tencentwemeet.club", + "tencentwepark.com", + "tencentyun.com", + "tendbcluster.com", + "tendis.net", "tenpay.com", + "testjrzk.net.cn", + "testmeet.cn", + "testwaf.com", "texasholdemcup.cn", "texasholdemcup.com", "texasholdemcup.net", "tfogc.com", + "tgovcloud.com", + "tidaas.com", + "timatrix.com.cn", "timibase.com", + "timmerse.com", "tingbook.com", + "tj.file.myqcloud.com", "tjstats.com", + "tlivecdn.com", + "tlivemcdn.com", + "tlivepush.com", + "tlivesource.com", "tmead.y.qq.com", "tmeadcomm.y.qq.com", + "tourismshow.cn", + "tourismuser.cn", "trace.qq.com", + "tsparkling.com", + "tx-exhibition.com", + "txbyod.com", + "txidc.wang", + "txlivecdn.com", + "txtyxg.com", + "txyscdn.com", + "txyscdn.net", "ugdtimg.com", + "um.run", + "uncnn.cn", + "vcloudstc.com", + "vcloudstc.net", + "vcloudvod.com", "videoxiaoyouxi.com", + "vodtcbk.com", + "vxo7tu.com", "wcbygame.com", "wechat.com", "wechatpay.cn", @@ -8553,16 +8907,23 @@ "wetv.vip", "wetvinfo.com", "weui.io", + "wework-studio.com", "wit.qq.com", "wxcloudrun.com", "wxgateway.com", "wxlivecdn.com", - "xn--owtw8cc49ajfl.cn #\u78a7\u84dd\u5e7b\u60f3.cn", + "xn--owtw8cc49ajfl.cn", "xn--r70as2s.xn--fiqs8s", + "xqymuy.com", "xs.cn", "xs8.cn", "xxsy.net", + "ym.run", "yuewen.com", + "yufuid.com", + "yufuid.com.cn", + "yufuid.net", + "yunjitele.com", "yxdmgame.com", "yximg.cn", "yxwsgame.com", @@ -8583,7 +8944,7 @@ "SALESF-3-ARIN" ], "v2fly_company": "salesforce", - "last_updated": 1765991212.0903027, + "last_updated": 1766008531.7230027, "asns": [ 14340, 22606, @@ -8705,7 +9066,7 @@ "ZOHOC-ARIN" ], "v2fly_company": "zoho", - "last_updated": 1765991216.259446, + "last_updated": 1766008535.7371716, "asns": [ 2639, 56201, @@ -8835,7 +9196,7 @@ ], "org_ids": [], "v2fly_company": "", - "last_updated": 1765991218.0236378, + "last_updated": 1766008537.5017958, "asns": [], "cidrs": [ "108.138.0.0/15", @@ -9025,7 +9386,7 @@ "ORG-ATI1-AP-APNIC" ], "v2fly_company": "akamai", - "last_updated": 1765991230.6682491, + "last_updated": 1766008549.089396, "asns": [ 12222, 16625, @@ -15550,7 +15911,7 @@ "ORG-OSA29-RIPE" ], "v2fly_company": "oracle", - "last_updated": 1765991246.0417256, + "last_updated": 1766008564.387157, "asns": [ 90, 792, @@ -18004,7 +18365,7 @@ "ORG-AI2-AP-APNIC" ], "v2fly_company": "amazon", - "last_updated": 1765991257.102138, + "last_updated": 1766008575.5159352, "asns": [ 699, 801, @@ -32376,7 +32737,7 @@ "ORG-ASEP1-AP-APNIC" ], "v2fly_company": "alibaba", - "last_updated": 1765991257.7272255, + "last_updated": 1766008576.2053795, "asns": [ 134963 ], @@ -32881,7 +33242,7 @@ "ORG-HOA1-RIPE" ], "v2fly_company": "hetzner", - "last_updated": 1765991259.0301955, + "last_updated": 1766008577.527033, "asns": [ 24940, 212317, @@ -33066,7 +33427,7 @@ "ORG-GSPL5-AP-APNIC" ], "v2fly_company": "google", - "last_updated": 1765991271.1985247, + "last_updated": 1766008589.9344804, "asns": [ 6432, 13949, @@ -35884,16 +36245,15 @@ "www.recaptcha.net", "x.company", "x.team", - "xn--9kr7l.com # \u53e4\u535a.com", - "xn--9trs65b.com # \u5495\u679c.com", + "xn--9kr7l.com", + "xn--9trs65b.com", "xn--flw351e", "xn--flw351e.com", - "xn--flw351e.com # \u8c37\u6b4c.com", - "xn--ggle-55da.com # g\u043e\u043egle.com", - "xn--gogl-0nd52e.com # g\u03bfogl\u0435.com", - "xn--gogl-1nd42e.com # go\u03bfgl\u0435.com", + "xn--ggle-55da.com", + "xn--gogl-0nd52e.com", + "xn--gogl-1nd42e.com", "xn--ngstr-lra8j.com", - "xn--p8j9a0d9c9a.xn--q9jyb4c # \u306f\u3058\u3081\u3088\u3046.\u307f\u3093\u306a", + "xn--p8j9a0d9c9a.xn--q9jyb4c", "xn--qcka1pmc", "xplr.co", "youtu.be", @@ -36081,7 +36441,7 @@ "BACKB-7-ARIN" ], "v2fly_company": "", - "last_updated": 1765991271.7985086, + "last_updated": 1766008590.4959126, "asns": [ 40401, 396865 @@ -36133,7 +36493,7 @@ "RACKS-8-ARIN" ], "v2fly_company": "", - "last_updated": 1765991276.4019706, + "last_updated": 1766008595.1754928, "asns": [ 10532, 12200, @@ -36376,7 +36736,7 @@ "DO-13-ARIN" ], "v2fly_company": "digitalocean", - "last_updated": 1765991278.2486658, + "last_updated": 1766008597.0108418, "asns": [ 14061, 46652, @@ -36681,7 +37041,7 @@ "ORG-CSL5-AP-APNIC" ], "v2fly_company": "cloudflare", - "last_updated": 1765991282.9378119, + "last_updated": 1766008601.3846335, "asns": [ 13335, 14789, @@ -39467,7 +39827,7 @@ "ORG-MSPL4-AP-APNIC" ], "v2fly_company": "azure", - "last_updated": 1765991298.3605773, + "last_updated": 1766008616.7066576, "asns": [ 3598, 5761, @@ -42148,7 +42508,7 @@ "ORG-AGTL2-RIPE" ], "v2fly_company": "", - "last_updated": 1765991299.6154938, + "last_updated": 1766008617.9570665, "asns": [ 57568, 208006, @@ -42190,7 +42550,7 @@ "DCC-25-ARIN" ], "v2fly_company": "dell", - "last_updated": 1765991303.1708388, + "last_updated": 1766008621.6322978, "asns": [ 3612, 3613, @@ -42564,7 +42924,7 @@ "ORG-WTI2-AP-APNIC" ], "v2fly_company": "", - "last_updated": 1765991304.1284807, + "last_updated": 1766008622.4345474, "asns": [ 140642, 395717 @@ -42607,7 +42967,7 @@ "ORG-KI4-AP-APNIC" ], "v2fly_company": "", - "last_updated": 1765991306.5651574, + "last_updated": 1766008624.8682008, "asns": [ 36007, 41436, @@ -42798,7 +43158,7 @@ "HPE-15-ARIN" ], "v2fly_company": "hpe", - "last_updated": 1765991311.3164923, + "last_updated": 1766008629.6196635, "asns": [ 157, 1033, @@ -42892,7 +43252,7 @@ "SUC-48-ARIN" ], "v2fly_company": "", - "last_updated": 1765991312.4961538, + "last_updated": 1766008630.8590822, "asns": [ 12876, 29447, diff --git a/cloudcheck/helpers.py b/cloudcheck/helpers.py index 55c259e..b571830 100644 --- a/cloudcheck/helpers.py +++ b/cloudcheck/helpers.py @@ -1,7 +1,8 @@ import ipaddress import os import requests -from typing import List, Union +from pathlib import Path +from typing import List, Set, Union def defrag_cidrs( @@ -209,3 +210,40 @@ def request(url, include_api_key=False, browser_headers=False, **kwargs): headers["Authorization"] = f"Bearer {bbot_io_api_key}" kwargs["headers"] = headers return requests.get(url, **kwargs) + + +def parse_v2fly_domain_file(file_path: Path) -> Set[str]: + """Parse a domain list file and extract domains.""" + print(f"Parsing {file_path}") + domains = set() + if not file_path.exists(): + print(f"File {file_path} does not exist") + return domains + + with open(file_path, "r", encoding="utf-8") as f: + for line in f: + line = line.strip() + # Handle inline comments by splitting on # and taking the first part + line = line.split("#")[0].strip() + if not line: + continue + + if line.startswith("include:"): + include_file = line[8:] + include_path = file_path.parent / include_file + domains.update(parse_v2fly_domain_file(include_path)) + continue + + if line.startswith("domain:"): + domain = line[7:] + elif line.startswith("full:"): + domain = line[5:] + elif line.startswith("keyword:") or line.startswith("regexp:"): + continue + else: + domain = line + + domain = domain.split("@")[0].strip() + if domain: + domains.add(domain.lower()) + return domains diff --git a/cloudcheck/providers/__init__.py b/cloudcheck/providers/__init__.py new file mode 100644 index 0000000..b00693a --- /dev/null +++ b/cloudcheck/providers/__init__.py @@ -0,0 +1,48 @@ +import importlib +from pathlib import Path +from typing import Dict, Type + +from cloudcheck.providers.base import BaseProvider + +# Dictionary to store loaded provider classes +_provider_classes: Dict[str, Type[BaseProvider]] = {} + + +def load_provider_classes() -> Dict[str, Type[BaseProvider]]: + """Dynamically load all cloud provider classes from the providers directory.""" + global _provider_classes + + if _provider_classes: + return _provider_classes + + providers_path = Path(__file__).parent + + for file in providers_path.glob("*.py"): + if file.stem in ("base", "__init__"): + continue + + try: + import_path = f"cloudcheck.providers.{file.stem}" + module = importlib.import_module(import_path) + + # Look for classes that inherit from BaseProvider + for attr_name in dir(module): + attr = getattr(module, attr_name) + if ( + isinstance(attr, type) + and issubclass(attr, BaseProvider) + and attr != BaseProvider + ): + provider_name = attr.__name__ + _provider_classes[provider_name] = attr + print(f"Loaded provider class: {attr.__name__}") + + except Exception as e: + print(f"Failed to load provider from {file}: {e}") + raise + + return _provider_classes + + +for provider_name, provider_class in load_provider_classes().items(): + globals()[provider_name] = provider_class() diff --git a/cloudcheck/providers/base.py b/cloudcheck/providers/base.py index ab2fefd..7a7712c 100644 --- a/cloudcheck/providers/base.py +++ b/cloudcheck/providers/base.py @@ -4,10 +4,10 @@ import subprocess import time from pathlib import Path -from typing import Dict, List, Union, Set +from typing import Dict, List, Union from pydantic import BaseModel, field_validator, computed_field -from ..helpers import defrag_cidrs, request +from ..helpers import defrag_cidrs, parse_v2fly_domain_file, request v2fly_repo_pulled = False @@ -215,7 +215,7 @@ def fetch_v2fly_domains(self) -> List[str]: repo_path, _success = self._ensure_v2fly_repo_cached() company_file = repo_path / "data" / self.v2fly_company try: - domains = self._parse_v2fly_domain_file(company_file) + domains = parse_v2fly_domain_file(company_file) except Exception as e: errors.append( f"Failed to parse {self.v2fly_company} domains: {e}:\n{traceback.format_exc()}" @@ -259,40 +259,6 @@ def _ensure_v2fly_repo_cached(self) -> Path: ) return repo_dir, errors - def _parse_v2fly_domain_file(self, file_path: Path) -> Set[str]: - """Parse a domain list file and extract domains.""" - print(f"Parsing {file_path}") - domains = set() - if not file_path.exists(): - print(f"File {file_path} does not exist") - return domains - - with open(file_path, "r", encoding="utf-8") as f: - for line in f: - line = line.strip() - if not line or line.startswith("#"): - continue - - if line.startswith("include:"): - include_file = line[8:] - include_path = file_path.parent / include_file - domains.update(self._parse_v2fly_domain_file(include_path)) - continue - - if line.startswith("domain:"): - domain = line[7:] - elif line.startswith("full:"): - domain = line[5:] - elif line.startswith("keyword:") or line.startswith("regexp:"): - continue - else: - domain = line - - domain = domain.split("@")[0].strip() - if domain: - domains.add(domain.lower()) - return domains - def request(self, *args, **kwargs): return request(*args, **kwargs) diff --git a/cloudcheck_update/__init__.py b/cloudcheck_update/__init__.py index 29ceafa..46630db 100644 --- a/cloudcheck_update/__init__.py +++ b/cloudcheck_update/__init__.py @@ -1,11 +1,9 @@ -import importlib import json import logging import traceback from pathlib import Path -from typing import Dict, Type -from cloudcheck.providers.base import BaseProvider +from cloudcheck.providers import load_provider_classes # Set up logging logging.basicConfig(level=logging.INFO) diff --git a/pyproject.toml b/pyproject.toml index 467e2a5..0cd6651 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "maturin" [project] name = "cloudcheck" -version = "8.4.1" +version = "8.4.2" description = "Detailed database of cloud providers. Instantly look up a domain or IP address" readme = "README.md" requires-python = ">=3.9" diff --git a/test_cloudcheck.py b/test_cloudcheck.py index a2c3968..5f6054b 100644 --- a/test_cloudcheck.py +++ b/test_cloudcheck.py @@ -19,6 +19,9 @@ async def test_lookup_amazon_domain(): def test_import_provider(): - from cloudcheck.providers.amazon import Amazon + import cloudcheck.providers as providers - assert Amazon().regexes + print(dir(providers)) + from cloudcheck.providers import Amazon + + assert Amazon.regexes diff --git a/uv.lock b/uv.lock index 36d642f..c1e087f 100644 --- a/uv.lock +++ b/uv.lock @@ -140,7 +140,7 @@ wheels = [ [[package]] name = "cloudcheck" -version = "8.4.1" +version = "8.4.2" source = { editable = "." } [package.dev-dependencies]