update 03-29 20:37

This commit is contained in:
github-actions[bot] 2022-03-29 20:37:11 +08:00
parent f65efd6938
commit 7ab8b376ce
5 changed files with 68645 additions and 1080 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -96,7 +96,7 @@ function down_oui(){
[ $logrow -lt "10" ] && rm -f ${oui_base} >/dev/null 2>&1
if [ ! -z "$oui_data" ] && [ "$oui_data" -ne "3" ] && [ ! -f ${oui_base} ]; then
echo "`date "+%Y-%m-%d %H:%M:%S"` 【初始化】设备MAC厂商信息不存在重新下载" >> ${logfile}
wget --no-check-certificate -t 3 -T 15 -O ${dir}oui.txt https://linuxnet.ca/ieee/oui.txt >/dev/null 2>&1
wget --no-check-certificate -t 3 -T 15 -O ${dir}oui.txt https://standards-oui.ieee.org/oui/oui.txt >/dev/null 2>&1
if [ -f ${dir}oui.txt ] && [ "$oui_data" -eq "1" ]; then
cat ${dir}oui.txt|grep "base 16"|grep -i "apple\|aruba\|asus\|autelan\|belkin\|bhu\|buffalo\|cctf\|cisco\|comba\|datang\|dell\|dlink\|dowell\|ericsson\|fast\|feixun\|\
fiberhome\|fujitsu\|grentech\|h3c\|hisense\|hiwifi\|honghai\|honghao\|hp\|htc\|huawei\|intel\|jinli\|jse\|lenovo\|lg\|liteon\|malata\|meizu\|mercury\|meru\|moto\|netcore\|\
@ -205,7 +205,7 @@ function getname(){
done
( ! echo "$tmp_name"|grep -q -w "unknown\|*" ) && [ ! -z "$tmp_name" ] && echo "$tmp_name" && return || unset tmp_name # 为unknown时重新读取
[ -f "$oui_base" ] && local tmp_name=$(cat $oui_base|grep -i $(echo "$2"|cut -c 1,2,4,5,7,8)|sed -nr 's#^.*16)..(.*)#\1#gp'|sed 's/ /_/g')
[ ! -z "$oui_data" ] && [ "$oui_data" -eq "4" ] && local tmp_name=$(curl -sS "http://standards-oui.ieee.org/oui.txt"|grep -i $(echo "$2"|cut -c 1,2,4,5,7,8)|sed -nr 's#^.*16)..(.*)#\1#gp'|sed 's/ /_/g')
[ ! -z "$oui_data" ] && [ "$oui_data" -eq "4" ] && local tmp_name=$(curl -sS "https://standards-oui.ieee.org/oui/oui.txt"|grep -i $(echo "$2"|cut -c 1,2,4,5,7,8)|sed -nr 's#^.*16)..(.*)#\1#gp'|sed 's/ /_/g')
[ -z "$tmp_name" ] && local tmp_name="unknown"
echo "$tmp_name"
}
@ -964,7 +964,7 @@ function login_send(){
cat ${dir}login_monitor|grep -i "accepted login"|awk '{print $4" "$NF}' >> ${dir}web_login
cat ${dir}login_monitor|grep -i "Password auth succeeded\|Pubkey auth succeeded"|grep -Eo "[0-9]{2}:[0-9]{2}:[0-9]{2}.*[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}"|awk '{print $1" "$NF" "$5}' >> ${dir}ssh_login
cat ${dir}login_monitor|grep -i "failed login"|grep -Eo "[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}" >> ${dir}web_failed
cat ${dir}login_monitor|grep -i "Bad password attempt\|Login attempt for nonexistent user from"|grep -Eo "[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}" >> ${dir}ssh_failed
cat ${dir}login_monitor|grep -i "Exit before auth from"|grep -Eo "[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}" >> ${dir}ssh_failed
echo "" > ${dir}login_monitor
add_ip_black
@ -1025,12 +1025,12 @@ function login_send(){
if [ -z "$title" ]; then
title="${login_ip} 通过 web 频繁尝试登陆"
content="${content}${str_splitline}${str_title_start} 登陆信息${str_title_end}${str_linefeed}${str_tab}设备 IP ${str_space}${str_space}${str_space}${str_space}${login_ip}"
elif ( echo "$title"|grep -q "频繁尝试登陆" ); then
title="${login_ip} ${title}"
content="${content}${str_splitline}${str_tab}设备 IP ${str_space}${str_space}${str_space}${str_space}${login_ip}"
else
title="设备状态变化"
content="${content}${str_splitline}${str_title_start} 登陆信息${str_title_end}${str_linefeed}${str_tab}设备 IP ${str_space}${str_space}${str_space}${str_space}${login_ip}"
elif ( echo "$title"|grep -q "频繁尝试登陆" ); then
title="${login_ip} ${title}"
content="${content}${str_splitline}${str_tab}设备 IP ${str_space}${str_space}${str_space}${str_space}${login_ip}"
else
title="设备状态变化"
content="${content}${str_splitline}${str_title_start} 登陆信息${str_title_end}${str_linefeed}${str_tab}设备 IP ${str_space}${str_space}${str_space}${str_space}${login_ip}"
fi
fi
sed -i "/^${login_ip}$/d" ${dir}web_failed
@ -1050,12 +1050,12 @@ function login_send(){
if [ -z "$title" ]; then
title="${login_ip} 通过 ssh 频繁尝试登陆"
content="${content}${str_splitline}${str_title_start} 登陆信息${str_title_end}${str_linefeed}${str_tab}设备 IP ${str_space}${str_space}${str_space}${str_space}${login_ip}"
elif ( echo "$title"|grep -q "频繁尝试登陆" ); then
title="${login_ip} ${title}"
content="${content}${str_splitline}${str_tab}设备 IP ${str_space}${str_space}${str_space}${str_space}${login_ip}"
else
title="设备状态变化"
content="${content}${str_splitline}${str_title_start} 登陆信息${str_title_end}${str_linefeed}${str_tab}设备 IP ${str_space}${str_space}${str_space}${str_space}${login_ip}"
elif ( echo "$title"|grep -q "频繁尝试登陆" ); then
title="${login_ip} ${title}"
content="${content}${str_splitline}${str_tab}设备 IP ${str_space}${str_space}${str_space}${str_space}${login_ip}"
else
title="设备状态变化"
content="${content}${str_splitline}${str_title_start} 登陆信息${str_title_end}${str_linefeed}${str_tab}设备 IP ${str_space}${str_space}${str_space}${str_space}${login_ip}"
fi
fi
sed -i "/^${login_ip}$/d" ${dir}ssh_failed
@ -1069,9 +1069,10 @@ function login_send(){
# 添加黑名单
function add_ip_black(){
[ -f "${ip_blacklist_path}" ] && local logrow=$(grep -c "" ${ip_blacklist_path}) || local logrow="0"
[ ! -f "${ip_blacklist_path}" ] && local logrow="0"
[ ! -z "$web_login_black" ] && [ "$web_login_black" -eq "0" ] || [ -z "$web_login_black" ] && local logrow="0"
[ ! -f "${ip_blacklist_path}" ] && touch ${ip_blacklist_path}
local logrow=$(grep -c "" ${ip_blacklist_path})
[ ! -z "$web_login_black" ] && [ "$web_login_black" -eq "0" ] || [ -z "$web_login_black" ] && logrow=0
[ ! -z "$1" ] && logrow=logrow+1
ipset flush ip_blacklist >/dev/null 2>&1
if [ $logrow -le "0" ]; then

View File

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=natflow
PKG_VERSION:=20220402
PKG_VERSION:=20220403
PKG_SOURCE_URL:=https://codeload.github.com/ptpt52/natflow/tar.gz/$(PKG_VERSION)?
PKG_HASH:=skip

View File

@ -12,7 +12,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=uugamebooster
PKG_VERSION:=v2.19.10
PKG_VERSION:=v2.21.12
PKG_RELEASE:=1
include $(INCLUDE_DIR)/package.mk