https://github.com/nanqinlang-script/defender
simple scripts to provide defence
https://github.com/nanqinlang-script/defender
Last synced: 5 months ago
JSON representation
simple scripts to provide defence
- Host: GitHub
- URL: https://github.com/nanqinlang-script/defender
- Owner: nanqinlang-script
- License: gpl-3.0
- Created: 2018-02-13T08:33:44.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-03-01T10:52:08.000Z (about 7 years ago)
- Last Synced: 2024-08-05T17:43:08.015Z (9 months ago)
- Language: Shell
- Size: 21.5 KB
- Stars: 25
- Watchers: 2
- Forks: 8
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
- awesome-hacking-lists - nanqinlang-script/defender - simple scripts to provide defence (Shell)
README
# defender
[](https://github.com/nanqinlang/defender)
[](https://github.com/nanqinlang/defender)
[](https://github.com/nanqinlang/defender)
[](https://github.com/nanqinlang/defender)simple scripts to provide defence
## accesslog.sh
ban ip from `/home/site/access-log/access.log`, the ban rule is in "ban $1" part of the script.
```bash
nohup bash accesslog.sh &
```## c.sh
ban ip according to the connection numbers noted on netstat.write value in the script file:
```bash
# your public ip
public_ip=# max connection number
define=# port
# such as 80 or 443
#port=80
port=
```then run it:
```bash
nohup bash c.sh &
```## ssh.sh
ban ip according to the tried times noted on ssh login log file.write value in the script file:
```bash
# log file
# centos: /var/log/secure
# debian: /var/log/auth.log
log_file=# your public ip
public_ip=# define max tried logined times
define=
```then run it:
```bash
nohup bash ssh.sh &
```