Merge pull request #130 from samwafgo/fix_bot_spider

Fix bot spider
This commit is contained in:
samwafgo
2025-02-05 10:39:30 +08:00
committed by GitHub
15 changed files with 5472 additions and 52 deletions
+2
View File
@@ -5,4 +5,6 @@ const (
CACHE_NOTICE_PRE = "CACHE_NOTICE_PRE" //通知前缀
CACHE_CCVISITBAN_PRE = "CACHE_CCVISITBAN_PRE_" //CC封禁前缀
CACHE_TOKEN = "CACHE_TOKEN" //鉴权信息
CACHE_DNS_BOT_IP = "CACHE_DNS_BOT_IP" //IP反向域名解析
CACHE_DNS_NORMAL_IP = "CACHE_DNS_NORMAL_IP" //正常IP
)
File diff suppressed because it is too large Load Diff
+173
View File
@@ -0,0 +1,173 @@
{
"BotDesc": "These Json files are collected by SamWaf",
"BotList": [
{
"ip": "157.55.39.0/24",
"updatetime": "2024-01-03 10:00:00 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "207.46.13.0/24",
"updatetime": "2024-01-03 10:00:00 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "40.77.167.0/24",
"updatetime": "2024-01-03 10:00:00 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "13.66.139.0/24",
"updatetime": "2024-01-03 10:00:00 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "13.66.144.0/24",
"updatetime": "2024-01-03 10:00:00 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "52.167.144.0/24",
"updatetime": "2024-01-03 10:00:00 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "13.67.10.16/28",
"updatetime": "2024-01-03 10:00:00 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "13.69.66.240/28",
"updatetime": "2024-01-03 10:00:00 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "13.71.172.224/28",
"updatetime": "2024-01-03 10:00:00 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "139.217.52.0/28",
"updatetime": "2024-01-03 10:00:00 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "191.233.204.224/28",
"updatetime": "2024-01-03 10:00:00 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "20.36.108.32/28",
"updatetime": "2024-01-03 10:00:00 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "20.43.120.16/28",
"updatetime": "2024-01-03 10:00:00 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "40.79.131.208/28",
"updatetime": "2024-01-03 10:00:00 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "40.79.186.176/28",
"updatetime": "2024-01-03 10:00:00 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "52.231.148.0/28",
"updatetime": "2024-01-03 10:00:00 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "20.79.107.240/28",
"updatetime": "2024-01-03 10:00:00 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "51.105.67.0/28",
"updatetime": "2024-01-03 10:00:00 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "20.125.163.80/28",
"updatetime": "2024-01-03 10:00:00 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "40.77.188.0/22",
"updatetime": "2024-01-03 10:00:00 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "65.55.210.0/24",
"updatetime": "2024-01-03 10:00:00 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "199.30.24.0/23",
"updatetime": "2024-01-03 10:00:00 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "40.77.202.0/24",
"updatetime": "2024-01-03 10:00:00 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "40.77.139.0/25",
"updatetime": "2024-01-03 10:00:00 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "20.74.197.0/28",
"updatetime": "2024-01-03 10:00:00 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "20.15.133.160/27",
"updatetime": "2024-01-03 10:00:00 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "40.77.177.0/24",
"updatetime": "2024-01-03 10:00:00 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "40.77.178.0/23",
"updatetime": "2024-01-03 10:00:00 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
}
]
}
+65
View File
@@ -0,0 +1,65 @@
{
"BotDesc": "These Json files are collected by SamWaf",
"BotList": [
{
"ip": "110.249.201.0/24",
"updatetime": "2024-01-26 03:50:51 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "110.249.202.0/24",
"updatetime": "2024-01-26 03:50:51 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "111.225.148.0/24",
"updatetime": "2024-01-26 03:50:51 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "111.225.149.0/24",
"updatetime": "2024-01-26 03:50:51 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "220.243.135.0/24",
"updatetime": "2024-01-26 03:50:51 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "220.243.136.0/24",
"updatetime": "2024-01-26 03:50:51 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "220.243.188.0/24",
"updatetime": "2024-01-26 03:50:51 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "220.243.189.0/24",
"updatetime": "2024-01-26 03:50:51 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "60.8.123.0/24",
"updatetime": "2024-01-26 03:50:51 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "60.8.151.0/24",
"updatetime": "2024-01-26 03:50:51 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
}
]
}
+635
View File
@@ -0,0 +1,635 @@
{
"BotDesc": "These Json files are collected by SamWaf",
"BotList": [
{
"ip": "192.178.17.0/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "209.85.238.0/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "209.85.238.128/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "209.85.238.160/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "209.85.238.192/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "209.85.238.224/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "209.85.238.32/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "209.85.238.64/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "209.85.238.96/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.87.0/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.87.128/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.87.160/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.87.192/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.87.224/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.87.32/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.87.64/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.87.96/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.89.0/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.89.128/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.89.160/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.89.192/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.89.224/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.89.32/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.89.64/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.89.96/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.90.0/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.90.128/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.90.160/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.90.192/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.90.224/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.90.32/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.90.96/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.91.0/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.91.128/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.91.160/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.91.192/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.91.224/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.91.32/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.91.64/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.91.96/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.92.0/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.92.128/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.92.160/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.92.192/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.92.32/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.92.64/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.92.96/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "72.14.199.0/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "72.14.199.128/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "72.14.199.160/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "72.14.199.192/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "72.14.199.224/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "72.14.199.32/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "72.14.199.64/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "72.14.199.96/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "74.125.148.0/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "74.125.148.128/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "74.125.148.160/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "74.125.148.192/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "74.125.148.224/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "74.125.148.32/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "74.125.148.64/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "74.125.148.96/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "74.125.149.0/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "74.125.149.128/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "74.125.149.160/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "74.125.149.192/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "74.125.149.224/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "74.125.149.32/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "74.125.149.64/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "74.125.149.96/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "74.125.150.0/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "74.125.150.32/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "74.125.150.64/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "74.125.151.0/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "74.125.151.128/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "74.125.151.160/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "74.125.151.192/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "74.125.151.224/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "74.125.151.32/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "74.125.151.64/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "74.125.151.96/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "74.125.216.0/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "74.125.216.128/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "74.125.216.160/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "74.125.216.192/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "74.125.216.224/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "74.125.216.32/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "74.125.216.64/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "74.125.216.96/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "74.125.217.0/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "74.125.217.128/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "74.125.217.32/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "74.125.217.64/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "74.125.217.96/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "74.125.218.0/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "74.125.218.128/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "74.125.218.160/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "74.125.218.192/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "74.125.218.224/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "74.125.218.32/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "74.125.218.64/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "74.125.218.96/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "74.125.219.0/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "74.125.219.32/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
}
]
}
+773
View File
@@ -0,0 +1,773 @@
{
"BotDesc": "These Json files are collected by SamWaf",
"BotList": [
{
"ip": "192.178.5.0/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "34.100.182.96/28",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "34.101.50.144/28",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "34.118.254.0/28",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "34.118.66.0/28",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "34.126.178.96/28",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "34.146.150.144/28",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "34.147.110.144/28",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "34.151.74.144/28",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "34.152.50.64/28",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "34.154.114.144/28",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "34.155.98.32/28",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "34.165.18.176/28",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "34.175.160.64/28",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "34.176.130.16/28",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "34.22.85.0/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "34.64.82.64/28",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "34.65.242.112/28",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "34.80.50.80/28",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "34.88.194.0/28",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "34.89.10.80/28",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "34.89.198.80/28",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "34.96.162.48/28",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "35.247.243.240/28",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.64.0/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.64.128/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.64.160/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.64.192/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.64.224/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.64.32/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.64.64/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.64.96/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.65.0/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.65.160/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.65.192/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.65.224/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.65.32/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.65.64/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.65.96/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.66.0/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.66.128/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.66.160/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.66.192/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.66.32/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.66.64/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.66.96/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.68.0/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.68.32/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.68.64/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.69.0/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.69.128/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.69.160/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.69.192/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.69.224/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.69.32/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.69.64/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.69.96/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.70.0/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.70.128/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.70.160/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.70.192/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.70.224/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.70.32/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.70.64/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.70.96/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.71.0/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.71.128/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.71.160/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.71.192/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.71.224/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.71.32/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.71.64/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.71.96/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.72.0/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.72.128/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.72.160/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.72.192/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.72.224/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.72.32/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.72.64/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.72.96/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.73.0/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.73.128/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.73.160/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.73.192/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.73.224/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.73.32/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.73.64/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.73.96/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.74.0/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.74.128/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.74.32/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.74.64/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.74.96/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.75.0/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.75.128/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.75.160/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.75.192/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.75.224/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.75.32/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.75.64/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.75.96/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.76.0/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.76.128/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.76.160/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.76.192/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.76.224/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.76.32/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.76.64/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.76.96/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.77.0/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.77.128/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.77.160/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.77.192/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.77.224/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.77.32/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.77.64/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.77.96/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.78.0/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.78.32/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.79.0/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.79.128/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.79.160/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.79.192/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.79.224/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.79.32/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.79.64/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
},
{
"ip": "66.249.79.96/27",
"updatetime": "2024-01-23 23:00:42 UTC",
"iptype": "ipv4cidr",
"remark": "offical"
}
]
}
File diff suppressed because it is too large Load Diff
+33
View File
@@ -0,0 +1,33 @@
{
"BotDesc": "These Json files are collected by SamWaf",
"BotList": {
"GoogleBot": {
"filename": "googlebot.json",
"updatetime": "2024-01-26 02:52:12 UTC"
},
"GoogleAdsBot": {
"filename": "googleadsbot.json",
"updatetime": "2024-01-26 02:52:12 UTC"
},
"GoogleUserTriggeredBot": {
"filename": "googleusertriggeredbot.json",
"updatetime": "2024-01-26 02:52:13 UTC"
},
"BingBot": {
"filename": "bingbot.json",
"updatetime": "2024-01-26 02:52:11 UTC"
},
"BaiduBot": {
"filename": "baidubot.json",
"updatetime": "2024-01-26 02:52:55 UTC"
},
"WeiPayCallbackBot": {
"filename": "weipaycallbackbot.json",
"updatetime": "2024-01-26 02:52:56 UTC"
},
"ByteDanceBot": {
"filename": "bytedancebot.json",
"updatetime": "2024-01-26 03:54:00 UTC"
}
}
}
+5
View File
@@ -25,4 +25,9 @@ var (
GCONFIG_RECORD_ALL_SRC_BYTE_INFO int64 = 0 //记录原始信息(默认不开启)
GCONFIG_RECORD_TOKEN_EXPIRE_MINTUTES int64 = 5 //令牌有效期 单位分钟
GCONFIG_RECORD_DNS_BOT_EXPIRE_HOURS int64 = 24 //DNS bot有效期 单位小时 默认1天
GCONFIG_RECORD_DNS_NORMAL_EXPIRE_HOURS int64 = 7 * 24 //DNS 正常有效期 单位小时 默认7天
GCONFIG_RECORD_SPIDER_DENY int64 = 0 //爬虫禁止访问开关 默认 0 只检测不阻止访问 1 检测并阻止访问
)
+6
View File
@@ -65,6 +65,9 @@ var publicKey string //公钥key
//go:embed exedata/owasp
var owaspAssets embed.FS
//go:embed exedata/spiderbot
var spiderBotAssets embed.FS
// wafSystenService 实现了 service.Service 接口
type wafSystenService struct{}
@@ -161,6 +164,9 @@ func (m *wafSystenService) run() {
if err != nil {
zlog.Error("owasp", err.Error())
}
//TODO 准备释放最新spider bot
/*// 启动一个 goroutine 来处理信号
go func() {
// 创建一个通道来接收信号
+146 -35
View File
@@ -5,11 +5,18 @@ import (
"strings"
)
// BotResult 检测结果
type BotResult struct {
IsBot bool //是否是爬虫
IsNormalBot bool //是否是正常爬虫 false 会拦截
BotName string //爬虫名称
}
/*
*
判断是否正确的搜索引擎 返回值: 是否是爬虫,是否是正常爬虫, 爬虫名称
*/
func DetermineNormalSearch(userAgent, ip string) (bool, bool, string) {
func DetermineNormalSearch(userAgent, ip string) BotResult {
if strings.Contains(userAgent, "Baiduspider") {
return baiduSpider(ip)
} else if strings.Contains(userAgent, "google") {
@@ -25,29 +32,45 @@ func DetermineNormalSearch(userAgent, ip string) (bool, bool, string) {
} else if strings.Contains(userAgent, "Bytespider") {
return byteSpider(ip)
}
return false, false, "未知"
return BotResult{false, false, ""}
}
/*
*
百度的蜘蛛
*/
func baiduSpider(ip string) (bool, bool, string) {
func baiduSpider(ip string) BotResult {
//先查询本地库
//然后远端查询
lookup, err := ReverseDNSLookup(ip)
if err == nil {
if len(lookup) > 0 {
if strings.HasSuffix(lookup[0], ".baidu.com.") || strings.HasSuffix(lookup[0], ".baidu.jp.") {
return true, true, "百度爬虫"
return BotResult{
IsBot: true,
IsNormalBot: true,
BotName: "百度爬虫",
}
} else {
return true, false, "可能不是百度爬虫"
return BotResult{
IsBot: true,
IsNormalBot: false,
BotName: "可能不是百度爬虫",
}
}
} else {
return true, false, "可能不是百度爬虫"
return BotResult{
IsBot: true,
IsNormalBot: false,
BotName: "可能不是百度爬虫",
}
}
} else {
return true, false, "伪装百度爬虫"
return BotResult{
IsBot: true,
IsNormalBot: true,
BotName: "查询超时",
}
}
}
@@ -55,26 +78,50 @@ func baiduSpider(ip string) (bool, bool, string) {
*
谷歌的蜘蛛
*/
func googleSpider(ip string) (bool, bool, string) {
func googleSpider(ip string) BotResult {
//先查询本地库
//然后远端查询
lookup, err := ReverseDNSLookup(ip)
if err == nil {
if len(lookup) > 0 {
if strings.HasSuffix(lookup[0], ".googlebot.com.") {
return true, true, "Google爬虫"
return BotResult{
IsBot: true,
IsNormalBot: true,
BotName: "Google爬虫",
}
} else if strings.HasSuffix(lookup[0], ".google.com.") {
return true, true, "Google爬虫(特殊)"
return BotResult{
IsBot: true,
IsNormalBot: true,
BotName: "Google爬虫(特殊)",
}
} else if strings.HasSuffix(lookup[0], ".googleusercontent.com.") {
return true, true, "Google爬虫(用户触发)"
return BotResult{
IsBot: true,
IsNormalBot: true,
BotName: "Google爬虫(用户触发)",
}
} else {
return true, false, "可能不是Google爬虫"
return BotResult{
IsBot: true,
IsNormalBot: false,
BotName: "可能不是Google爬虫",
}
}
} else {
return true, false, "可能不是Google爬虫"
return BotResult{
IsBot: true,
IsNormalBot: false,
BotName: "可能不是Google爬虫",
}
}
} else {
return true, false, "伪装Google爬虫"
return BotResult{
IsBot: true,
IsNormalBot: true,
BotName: "查询超时",
}
}
}
@@ -82,22 +129,38 @@ func googleSpider(ip string) (bool, bool, string) {
*
bing的蜘蛛
*/
func bingSpider(ip string) (bool, bool, string) {
func bingSpider(ip string) BotResult {
//先查询本地库
//然后远端查询
lookup, err := ReverseDNSLookup(ip)
if err == nil {
if len(lookup) > 0 {
if strings.HasSuffix(lookup[0], ".msn.com.") {
return true, true, "Bing爬虫"
return BotResult{
IsBot: true,
IsNormalBot: true,
BotName: "Bing爬虫",
}
} else {
return true, false, "可能不是Bing爬虫"
return BotResult{
IsBot: true,
IsNormalBot: false,
BotName: "可能不是Bing爬虫",
}
}
} else {
return true, false, "可能不是Bing爬虫"
return BotResult{
IsBot: true,
IsNormalBot: false,
BotName: "可能不是Bing爬虫",
}
}
} else {
return true, false, "伪装Bing爬虫"
return BotResult{
IsBot: true,
IsNormalBot: true,
BotName: "可能不是Bing爬虫",
}
}
}
@@ -105,22 +168,38 @@ func bingSpider(ip string) (bool, bool, string) {
*
sogou蜘蛛
*/
func sogouSpider(ip string) (bool, bool, string) {
func sogouSpider(ip string) BotResult {
//先查询本地库
//然后远端查询
lookup, err := ReverseDNSLookup(ip)
if err == nil {
if len(lookup) > 0 {
if strings.HasSuffix(lookup[0], ".sogou.com.") {
return true, true, "搜狗爬虫"
return BotResult{
IsBot: true,
IsNormalBot: true,
BotName: "搜狗爬虫",
}
} else {
return true, false, "可能不是搜狗爬虫"
return BotResult{
IsBot: true,
IsNormalBot: false,
BotName: "可能不是搜狗爬虫",
}
}
} else {
return true, false, "可能不是搜狗爬虫"
return BotResult{
IsBot: true,
IsNormalBot: false,
BotName: "可能不是搜狗爬虫",
}
}
} else {
return true, false, "伪装搜狗爬虫"
return BotResult{
IsBot: true,
IsNormalBot: true,
BotName: "查询超时",
}
}
}
@@ -128,7 +207,7 @@ func sogouSpider(ip string) (bool, bool, string) {
*
360 搜索引擎
*/
func spider360(ip string) (bool, bool, string) {
func spider360(ip string) BotResult {
// 将要检查的 IP 地址段转换成数组
ipRanges := []string{
"180.153.232.",
@@ -165,9 +244,17 @@ func spider360(ip string) (bool, bool, string) {
}
}
if isInRange {
return true, true, "360爬虫"
return BotResult{
IsBot: true,
IsNormalBot: true,
BotName: "360爬虫",
}
} else {
return true, false, "伪装360爬虫"
return BotResult{
IsBot: true,
IsNormalBot: false,
BotName: "伪装360爬虫",
}
}
}
@@ -175,22 +262,38 @@ func spider360(ip string) (bool, bool, string) {
*
UC 搜索
*/
func yisouSpider(ip string) (bool, bool, string) {
func yisouSpider(ip string) BotResult {
//先查询本地库
//然后远端查询
lookup, err := ReverseDNSLookup(ip)
if err == nil {
if len(lookup) > 0 {
if strings.HasSuffix(lookup[0], ".sm.cn.") {
return true, true, "神马搜索爬虫"
return BotResult{
IsBot: true,
IsNormalBot: true,
BotName: "神马搜索爬虫",
}
} else {
return true, false, "可能不是神马搜索爬虫"
return BotResult{
IsBot: true,
IsNormalBot: false,
BotName: "可能不是神马搜索爬虫",
}
}
} else {
return true, false, "可能不是神马搜索爬虫"
return BotResult{
IsBot: true,
IsNormalBot: false,
BotName: "可能不是神马搜索爬虫",
}
}
} else {
return true, false, "伪装神马搜索爬虫"
return BotResult{
IsBot: true,
IsNormalBot: true,
BotName: "查询超时",
}
}
}
@@ -198,7 +301,7 @@ func yisouSpider(ip string) (bool, bool, string) {
*
字节跳动的爬虫
*/
func byteSpider(ip string) (bool, bool, string) {
func byteSpider(ip string) BotResult {
ipRanges := []string{
"110.249.201.0/24",
"110.249.202.0/24",
@@ -214,8 +317,16 @@ func byteSpider(ip string) (bool, bool, string) {
isInRanges := utils.CheckIPInRanges(ip, ipRanges)
if isInRanges {
return true, true, "字节跳动爬虫"
return BotResult{
IsBot: true,
IsNormalBot: true,
BotName: "字节跳动爬虫",
}
} else {
return true, false, "伪装字节跳动爬虫"
return BotResult{
IsBot: true,
IsNormalBot: false,
BotName: "伪装字节跳动爬虫",
}
}
}
+3 -8
View File
@@ -1,7 +1,6 @@
package wafbot
import (
"SamWaf/common/zlog"
"SamWaf/global"
"context"
"fmt"
@@ -10,7 +9,7 @@ import (
)
func ReverseDNSLookup(ipAddress string) ([]string, error) {
startTime := time.Now()
//startTime := time.Now()
ctx := context.Background()
d := net.Dialer{Resolver: &net.Resolver{
@@ -23,16 +22,12 @@ func ReverseDNSLookup(ipAddress string) ([]string, error) {
defer cancel()
names, err := d.Resolver.LookupAddr(ctxWithTimeout, ipAddress)
elapsed := time.Since(startTime)
//elapsed := time.Since(startTime)
zlog.Debug("搜索引擎查询耗时", elapsed.String())
//zlog.Debug("搜索引擎查询耗时", elapsed.String())
if err != nil {
return nil, fmt.Errorf("逆向 DNS 查询失败: %s", err)
}
if len(names) == 0 {
return nil, fmt.Errorf("未找到与该 IP 地址关联的域名")
}
return names, nil
}
+29 -2
View File
@@ -5,11 +5,38 @@ import (
"testing"
)
func TestReverseDNSLookup(t *testing.T) {
lookup, err := ReverseDNSLookup("114.119.151.1")
func TestReverseGoogleDNSLookup(t *testing.T) {
lookup, err := ReverseDNSLookup("66.249.64.174")
if err == nil {
for _, s := range lookup {
fmt.Println(s)
}
} else {
fmt.Println(err)
}
}
func TestReverseDNSLookup(t *testing.T) {
lookup, err := ReverseDNSLookup("3.3.77.3")
if err == nil {
for _, s := range lookup {
fmt.Println(s)
}
} else {
fmt.Println("错误:", err)
}
}
func BenchmarkReverseDNSLookup(b *testing.B) {
for i := 0; i < b.N; i++ {
_, err := ReverseDNSLookup("66.249.64.174")
if err != nil {
fmt.Println(err)
}
//逆向 DNS 查询失败: lookup 174.64.249.66.in-addr.arpa. on 192.168.0.1:53: write udp 192.168.0.108:56942->119.29.29.29:53: i/o timeout
/*if lookup != nil {
fmt.Println(lookup)
}*/
}
}
+36 -7
View File
@@ -1,12 +1,15 @@
package wafenginecore
import (
"SamWaf/enums"
"SamWaf/global"
"SamWaf/innerbean"
"SamWaf/model/detection"
"SamWaf/model/wafenginmodel"
"SamWaf/wafbot"
"net/http"
"net/url"
"time"
)
/*
@@ -20,19 +23,45 @@ func (waf *WafEngine) CheckBot(r *http.Request, weblogbean *innerbean.WebLog, fo
Title: "",
Content: "",
}
isBot, isNormalBot, BotName := wafbot.DetermineNormalSearch(weblogbean.USER_AGENT, weblogbean.SRC_IP)
if isBot == true {
if isNormalBot {
weblogbean.GUEST_IDENTIFICATION = BotName
//检查是否是正常IP已经cache
isNormalCacheExist := global.GCACHE_WAFCACHE.IsKeyExist(enums.CACHE_DNS_NORMAL_IP + weblogbean.SRC_IP)
if isNormalCacheExist {
return result
}
//检查是否是bot已经cache
isBotCacheExist := global.GCACHE_WAFCACHE.IsKeyExist(enums.CACHE_DNS_BOT_IP + weblogbean.SRC_IP)
botResult := wafbot.BotResult{}
if !isBotCacheExist {
botResult = wafbot.DetermineNormalSearch(weblogbean.USER_AGENT, weblogbean.SRC_IP)
} else {
botResult = global.GCACHE_WAFCACHE.Get(enums.CACHE_DNS_BOT_IP + weblogbean.SRC_IP).(wafbot.BotResult)
}
if botResult.IsBot == true {
if botResult.IsNormalBot {
weblogbean.GUEST_IDENTIFICATION = botResult.BotName
} else {
weblogbean.GUEST_IDENTIFICATION = BotName
weblogbean.GUEST_IDENTIFICATION = botResult.BotName
weblogbean.RISK_LEVEL = 1
result.IsBlock = true
result.Title = BotName
if global.GCONFIG_RECORD_SPIDER_DENY == 1 {
result.IsBlock = true
} else {
result.IsBlock = false
}
result.Title = botResult.BotName
result.Content = "请正确访问"
return result
}
if !isBotCacheExist {
//如果是bot 加入cache里面
global.GCACHE_WAFCACHE.SetWithTTl(enums.CACHE_DNS_BOT_IP+weblogbean.SRC_IP, botResult, time.Duration(global.GCONFIG_RECORD_DNS_BOT_EXPIRE_HOURS)*time.Hour)
}
} else {
//如果不是bot 加入到正常cache里面
global.GCACHE_WAFCACHE.SetWithTTl(enums.CACHE_DNS_NORMAL_IP+weblogbean.SRC_IP, weblogbean.SRC_IP, time.Duration(global.GCONFIG_RECORD_DNS_NORMAL_EXPIRE_HOURS)*time.Hour)
}
return result
}
+4
View File
@@ -57,6 +57,9 @@ func setConfigIntValue(name string, value int64, change int) {
case "token_expire_time":
global.GCONFIG_RECORD_TOKEN_EXPIRE_MINTUTES = value
break
case "spider_deny":
global.GCONFIG_RECORD_SPIDER_DENY = value
break
default:
zlog.Warn("Unknown config item:", name)
}
@@ -166,5 +169,6 @@ func TaskLoadSetting(initLoad bool) {
updateConfigIntItem(initLoad, "system", "record_all_src_byte_info", global.GCONFIG_RECORD_ALL_SRC_BYTE_INFO, "启动记录原始请求BODY报文(1启动 0关闭)", "int", "")
updateConfigIntItem(initLoad, "system", "token_expire_time", global.GCONFIG_RECORD_TOKEN_EXPIRE_MINTUTES, "管理平台令牌有效期,单位分钟(默认5分钟)", "int", "")
updateConfigIntItem(initLoad, "system", "spider_deny", global.GCONFIG_RECORD_SPIDER_DENY, "爬虫禁止访问开关 默认 0 只检测不阻止访问 1 检测并阻止访问)", "int", "")
}