Here I got this script for you that can help you to secure your server from attackers or bots.
Just add ip addresses you want to block to a file, on each line one, and run the script. Iptables will do the rest.
# file with on each line an ip address you want to block
# show and remove duplicate ip addresses from the block_ip_list file
IPS=$(grep -Ev "^#" $BLOCKDB)
for i in $IPS