Skip to content

Instantly share code, notes, and snippets.

View cool-doge's full-sized avatar
😎
I'm looking for something cool that makes money :)

KeonWoo PARK cool-doge

😎
I'm looking for something cool that makes money :)
  • Seoul, Republic of Korea
  • 10:06 (UTC +09:00)
View GitHub Profile
@cool-doge
cool-doge / Only-Cloudflare.sh
Last active January 22, 2023 10:01
Allow 80, 443 Port Cloudflare only.
#!/bin/bash
if [ $(whoami) != "root" ]
then
echo "Please run as root"
exit
fi
#ipv4
for i in `curl -s https://www.cloudflare.com/ips-v4`
do
/sbin/iptables -I INPUT -p tcp -s $i --dport 80 -j ACCEPT
@cool-doge
cool-doge / Scanner-drop.py
Last active July 11, 2023 11:50
Block Shodan, Censys scanner Python code for Linux server.
#Block Shodan.io, Censys.io scanner.
import os
shodan_ip = ['208.180.20.97','198.20.69.74','198.20.69.98','198.20.70.114','198.20.99.130','93.120.27.62','66.240.236.119','71.6.135.131','66.240.192.138','71.6.167.142','82.221.105.6','82.221.105.7','71.6.165.200','188.138.9.50','85.25.103.50','85.25.43.94','71.6.146.185','71.6.158.166','198.20.87.98','66.240.219.146','209.126.110.38','104.236.198.48','104.131.0.69','162.159.244.38','93.174.95.106','94.102.49.193','80.82.77.139','94.102.49.190','185.163.109.66','89.248.172.16','71.6.146.186','89.248.167.131','159.203.176.62','185.181.102.18','80.82.77.33','216.117.2.180','98.143.148.107','155.94.254.133','155.94.254.143','155.94.222.12','98.143.148.135'] #Shodan.io Scanner IP list
for i in shodan_ip:
os.system("/sbin/iptables -A INPUT -s {} -j DROP".format(i))
os.system("/sbin/iptables -A INPUT -s 198.108.66.0/24 -j DROP") #Censys.io Scanner IP range 1
os.system("/sbin/iptables -A INPUT -s 74.120.14.0/24 -j DROP") #Censys.io Scanner IP range 2
os.system("/