Guest User

deny POST from all but JP

a guest
Mar 15th, 2024
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.46 KB | Source Code | 0 0
  1. #! /usr/bin/env bash
  2. wget -q https://raw.githubusercontent.com/ipverse/rir-ip/master/country/jp/ipv4-aggregated.txt https://raw.githubusercontent.com/ipverse/rir-ip/master/country/jp/ipv6-aggregated.txt
  3. cat << 'EOF' > .htaccess
  4. <Limit POST>
  5. Order Allow, Deny
  6. EOF
  7. cat ipv4-aggregated.txt ipv6-aggregated.txt | sed -e '/^\#/d' | sed -e 's/^/Allow from /g' >> .htaccess
  8. cat << 'EOF' >> .htaccess
  9. Deny from all
  10. </Limit>
  11. EOF
  12. rm ipv4-aggregated.txt ipv6-aggregated.txt
Advertisement
Add Comment
Please, Sign In to add comment