Advertisement
Guest User

Untitled

a guest
Apr 24th, 2016
1,121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2.  
  3. PS3='Prosze co chcesz zrobic: '
  4. options=("Tworzenie bazy danych" "Blokowanie" "Informacje o autorze" "Wyjscie")
  5. select opt in "${options[@]}"
  6. do
  7. case $opt in
  8. "Tworzenie bazy danych")
  9. ipset --flush
  10. ipset create jp hash:net
  11. for IP1 in $(wget -O - http://www.ipdeny.com/ipblocks/data/countries/jp.zone)
  12. do
  13. ipset add jp $IP1
  14. done
  15. ipset create cn hash:net
  16. for IP2 in $(wget -O - http://www.ipdeny.com/ipblocks/data/countries/cn.zone)
  17. do
  18. ipset add cn $IP2
  19. done
  20. ipset create ru hash:net
  21. for IP3 in $(wget -O - http://www.ipdeny.com/ipblocks/data/countries/ru.zone)
  22. do
  23. ipset add ru $IP3
  24. done
  25. ipset create us hash:net
  26. for IP4 in $(wget -O - http://www.ipdeny.com/ipblocks/data/countries/us.zone)
  27. do
  28. ipset add us $IP4
  29. done
  30. ipset create ua hash:net
  31. for IP5 in $(wget -O - http://www.ipdeny.com/ipblocks/data/countries/ua.zone)
  32. do
  33. ipset add ua $IP5
  34. done
  35. ipset create tr hash:net
  36. for IP6 in $(wget -O - http://www.ipdeny.com/ipblocks/data/countries/tr.zone)
  37. do
  38. ipset add tr $IP6
  39. done
  40. ipset create be hash:net
  41. for IP7 in $(wget -O - http://www.ipdeny.com/ipblocks/data/countries/be.zone)
  42. do
  43. ipset add be $IP7
  44. done
  45. echo -e "\E[32m ============= \033[0m"
  46. echo -e "\E[32m Tworzenie listy zakonczone. \033[0m"
  47. echo -e "\E[32m Przejdz do kroku nr.2 \033[0m"
  48. echo -e "\E[32m ============= \033[0m"
  49. echo -e "\E[36m 1)Tworzenie bazy danych \033[0m"
  50. echo -e "\E[36m 2)Blokowanie \033[0m"
  51. echo -e "\E[36m 3)Informacje o autorze \033[0m"
  52. echo -e "\E[36m 4)Wyjscie \033[0m"
  53. ;;
  54. "Blokowanie")
  55. iptables -A INPUT -m set --match-set jp src -j DROP
  56. iptables -A INPUT -m set --match-set cn src -j DROP
  57. iptables -A INPUT -m set --match-set ru src -j DROP
  58. iptables -A INPUT -m set --match-set us src -j DROP
  59. iptables -A INPUT -m set --match-set ua src -j DROP
  60. iptables -A INPUT -m set --match-set tr src -j DROP
  61. iptables -A INPUT -m set --match-set be src -j DROP
  62. iptables --list
  63. echo -e "\E[32m ============= \033[0m"
  64. echo -e "\E[32m Blokowanie listy zakonczone. \033[0m"
  65. echo -e "\E[32m Mozna przejs cdo kroku nr.4 \033[0m"
  66. echo -e "\E[32m ============= \033[0m"
  67. echo -e "\E[36m 1)Tworzenie bazy danych \033[0m"
  68. echo -e "\E[36m 2)Blokowanie \033[0m"
  69. echo -e "\E[36m 3)Informacje o autorze \033[0m"
  70. echo -e "\E[36m 4)Wyjscie \033[0m"
  71. ;;
  72. "Informacje o autorze")
  73. echo -e "\E[32m ============= \033[0m"
  74. echo -e "\E[32m Prosty skrypt do wycinania niechcianych krajów \033[0m"
  75. echo -e "\E[32m Zakaz dalszego udostepniania bez zgody autora \033[0m"
  76. echo -e "\E[32m Dimitri specjalnie dla ForGame.pl \033[0m"
  77. echo -e "\E[32m ============= \033[0m"
  78. echo -e "\E[36m 1)Tworzenie bazy danych \033[0m"
  79. echo -e "\E[36m 2)Blokowanie \033[0m"
  80. echo -e "\E[36m 3)Informacje o autorze \033[0m"
  81. echo -e "\E[36m 4)Wyjscie \033[0m"
  82. ;;
  83. "Wyjscie")
  84. break
  85. ;;
  86. *) echo invalid option;;
  87. esac
  88. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement