deny-ssh-password-attack
deny-ssh-password-attack copied to clipboard
提示SNAPSHOT,: out of range,是否不支持?
作者你好: 查看日志里面为: [2021-02-27 11:20:00] iptables -N DenyPwdHack [2021-02-27 11:20:00] iptables -I INPUT -p tcp -m multiport --dports 22,443 -j DenyPwdHack
直接运行sh文件,提示SNAPSHOT,: out of range,是否不支持这个版本的OpenWrt,或者还需要设置哪里吗?
方便的话,提点一下,谢谢!
请用调试模式执行脚本,把日志发给我吧。调试模式执行方法: bash -x DenyPwdHack.sh 如果日志过多,可以写入到日志文件里面,把文件发给我吧。 bash -x DenyPwdHack.sh &> /tmp/DenyPwdHack.sh.log
相同问题,好像我的openwrt版本不对,所以我删掉了18检测后,日志打印和上个那位一样 root@OpenWrt:~# bash -x DenyPwdHack.sh
- ChainName=DenyPwdHack
- LOG_DEST=/tmp/DenyPwdHack.log
- Deny_Port=22,443
- INPUT_RULE='INPUT -p tcp -m multiport --dports 22,443 -j DenyPwdHack'
- LOG_KEY_WORD='auth.info\s+sshd.Failed password for|luci:\s+failed\s+login|auth.info. sshd.*Connection closed by.*port.*preauth'
- exclude_ip='192.168.|127.0.0.1'
- Failed_times=5
- BlackList_exp=2160 ++ date '+%Y-%m-%d %H:%M:%S'
- LOG_DT='2021-10-28 15:45:25'
- iptables -n --list DenyPwdHack
- [[ 0 -ne 0 ]]
- iptables -C INPUT -p tcp -m multiport --dports 22,443 -j DenyPwdHack
- [[ 0 -ne 0 ]] ++ logread ++ grep -v '192.168.|127.0.0.1' ++ uniq -c ++ awk '{if($1>5) print $2}' ++ awk '/auth.info\s+sshd.*Failed password for|luci:\s+failed\s+login|auth.info.*sshd.*C onnection closed by.*port.*preauth/ {for(i=1;i<=NF;i++) if($i~/^(([0-9]{1,2}|1[0-9]{2}|2 [0-4][0-9]|25[0-5]).){3}([0-9]{1,2}|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/) print $i}' ++ sort
- DenyIPLIst= ++ echo '' ++ wc -l
- IPList_sum=1
- [[ 1 -ne 0 ]] ++ iptables --line-numbers -nL DenyPwdHack ++ awk '/Added at/ {for(i=1;i<=NF;i++) if($i~/[0-9]{4}(-[0-9]{2}){2}/) print $1","$i" "$(i +1)}' ++ sort -rn
- ChainList= ++ echo '' ++ wc -l ++ grep -v '^$'
- ChainList_num=0
- [[ 0 -ne 0 ]]
同样的问题,怎么处理的呢?
同样的问题,提示out of range. bash -x 命令又提示 ash 找不到... 环境信息: 固件版本 OpenWrt SNAPSHOT r9765-141698c / LuCI Master (git-19.092.22656-fb453f5) 内核版本 4.14.109