Diễn đàn Trái Tim Yên Bái 2024

 Quên mật khẩu
 Đăng ký
Xem: 2766|Trả lời: 1
Thu gọn cột thông tin

Chống DDOS bằng cách chặn IP dùng .htaccess

[Lấy địa chỉ]
  • Tâm trạng hàng ngày
    Hạnh phúc
    2-7-2025 09:43 PM
  • Đã viết: 13 ngày

    [LV.3]Spam 3

    Đăng lúc 15-7-2011 05:04 PM | Xem tất |Chế độ đọc

    Mời bạn đăng ký để giao lưu kết bạn nhé <3

    Bạn phải đăng nhập để xem được nội dung, nếu bạn chưa có tài khoản? hãy Đăng ký

    x
                                                    Chống DDOS bằng cách chặn IP dùng .htaccess

    Trước tiên vào trang này: http://www.countryipblocks.net/

    Đây là một trang tra cứu về địa chỉ IP miễn phí và update Database thường xuyên.

    Cũng ở cột bên phải, kéo xuống phần Country IP listing, gõ 2 ký tự thể hiện quốc gia mà bạn muốn tra cứu dải địa chỉ IP (VN là Việt Nam, TH là Thailand, DE là Đức... chẳng hạn). và chọn CIDR Format rồi ấn Submit
    Bạn sẽ nhận được danh sách IP Việt Nam như sau:

    1. # Country: VIET NAM
    2. # ISO Code: VN
    3. # Total Networks: 198
    4. # Total Subnets:  15,515,392
    5. 1.52.0.0/14
    6. 14.0.16.0/20
    7. 14.160.0.0/11
    8. 14.224.0.0/11
    9. 27.0.12.0/22
    10. 27.2.0.0/15
    11. 27.64.0.0/12
    12. 27.118.16.0/20
    13. 42.1.64.0/18
    14. 42.96.0.0/18
    15. 42.112.0.0/13
    16. 49.156.52.0/22
    17. 49.213.64.0/18
    18. 49.236.208.0/22
    19. 49.246.128.0/18
    20. 49.246.192.0/19
    21. 58.186.0.0/15
    22. 61.11.224.0/19
    23. 61.28.224.0/19
    24. 101.53.0.0/18
    25. 101.96.12.0/22
    26. 101.96.64.0/18
    27. 101.99.0.0/18
    28. 103.1.200.0/22
    29. 103.1.208.0/22
    30. 103.1.236.0/22
    31. 103.2.220.0/22
    32. 103.2.224.0/22
    33. 103.2.228.0/22
    34. 103.3.244.0/22
    35. 103.3.248.0/22
    36. 103.3.252.0/22
    37. 103.4.128.0/22
    38. 103.10.88.0/22
    39. 103.246.104.0/24
    40. 110.35.64.0/21
    41. 110.35.72.0/21
    42. 110.44.184.0/21
    43. 111.65.240.0/20
    44. 111.91.232.0/22
    45. 112.72.64.0/18
    46. 112.78.0.0/20
    47. 112.109.88.0/21
    48. 112.137.128.0/20
    49. 112.197.0.0/16
    50. 112.213.80.0/20
    51. 113.20.96.0/19
    52. 113.22.0.0/16
    53. 113.23.0.0/17
    54. 113.52.32.0/19
    55. 113.61.108.0/22
    56. 113.160.0.0/11
    57. 115.72.0.0/13
    58. 115.84.176.0/21
    59. 115.146.120.0/21
    60. 115.165.160.0/21
    61. 116.68.128.0/21
    62. 116.96.0.0/12
    63. 116.118.0.0/17
    64. 116.193.64.0/20
    65. 116.212.32.0/19
    66. 117.0.0.0/13
    67. 117.103.192.0/18
    68. 117.122.0.0/17
    69. 118.68.0.0/14
    70. 118.102.0.0/21
    71. 118.107.64.0/18
    72. 119.15.160.0/19
    73. 119.17.192.0/18
    74. 119.18.128.0/20
    75. 119.18.184.0/21
    76. 119.82.128.0/20
    77. 120.50.184.0/21
    78. 120.72.80.0/21
    79. 120.72.96.0/19
    80. 120.138.64.0/20
    81. 122.102.112.0/22
    82. 122.129.0.0/18
    83. 122.201.8.0/21
    84. 123.16.0.0/12
    85. 124.157.0.0/18
    86. 124.158.0.0/20
    87. 125.58.0.0/18
    88. 125.212.128.0/17
    89. 125.214.0.0/18
    90. 125.234.0.0/15
    91. 125.253.112.0/20
    92. 171.224.0.0/11
    93. 175.103.64.0/18
    94. 175.106.0.0/22
    95. 180.93.0.0/16
    96. 180.148.0.0/21
    97. 180.148.128.0/20
    98. 180.214.236.0/22
    99. 182.161.80.0/20
    100. 182.236.112.0/22
    101. 182.237.20.0/22
    102. 183.80.0.0/16
    103. 183.81.0.0/17
    104. 183.90.160.0/21
    105. 183.91.0.0/19
    106. 183.91.160.0/19
    107. 202.0.79.0/24
    108. 202.4.168.0/24
    109. 202.4.176.0/24
    110. 202.6.2.0/24
    111. 202.6.96.0/23
    112. 202.9.79.0/24
    113. 202.9.80.0/24
    114. 202.9.84.0/24
    115. 202.37.86.0/23
    116. 202.43.108.0/22
    117. 202.44.137.0/24
    118. 202.47.87.0/24
    119. 202.47.142.0/24
    120. 202.52.39.0/24
    121. 202.55.132.0/22
    122. 202.56.57.0/24
    123. 202.58.245.0/24
    124. 202.59.238.0/23
    125. 202.59.252.0/23
    126. 202.60.104.0/21
    127. 202.74.56.0/24
    128. 202.74.58.0/23
    129. 202.78.224.0/21
    130. 202.79.232.0/21
    131. 202.87.212.0/22
    132. 202.92.4.0/22
    133. 202.93.156.0/22
    134. 202.94.82.0/24
    135. 202.94.88.0/23
    136. 202.124.204.0/24
    137. 202.130.36.0/23
    138. 202.134.16.0/21
    139. 202.134.54.0/24
    140. 202.151.160.0/20
    141. 202.158.244.0/22
    142. 202.160.124.0/23
    143. 202.172.4.0/23
    144. 202.191.56.0/22
    145. 203.8.127.0/24
    146. 203.8.172.0/24
    147. 203.34.144.0/24
    148. 203.77.178.0/24
    149. 203.79.28.0/24
    150. 203.89.140.0/22
    151. 203.99.248.0/22
    152. 203.113.128.0/19
    153. 203.113.160.0/19
    154. 203.119.8.0/22
    155. 203.119.36.0/22
    156. 203.119.44.0/22
    157. 203.119.58.0/23
    158. 203.119.60.0/22
    159. 203.119.64.0/21
    160. 203.119.72.0/22
    161. 203.128.240.0/21
    162. 203.160.0.0/23
    163. 203.160.96.0/21
    164. 203.161.178.0/24
    165. 203.162.0.0/21
    166. 203.162.8.0/21
    167. 203.162.16.0/20
    168. 203.162.32.0/19
    169. 203.162.64.0/18
    170. 203.162.128.0/20
    171. 203.162.144.0/20
    172. 203.162.160.0/19
    173. 203.162.192.0/18
    174. 203.163.128.0/18
    175. 203.170.26.0/23
    176. 203.171.16.0/20
    177. 203.176.160.0/21
    178. 203.189.28.0/22
    179. 203.190.160.0/20
    180. 203.191.8.0/21
    181. 203.191.48.0/21
    182. 203.195.0.0/18
    183. 203.201.56.0/22
    184. 203.205.0.0/18
    185. 203.209.180.0/22
    186. 203.210.128.0/18
    187. 203.210.192.0/18
    188. 210.2.64.0/18
    189. 210.86.224.0/20
    190. 210.211.96.0/19
    191. 210.245.0.0/19
    192. 210.245.32.0/19
    193. 210.245.64.0/18
    194. 218.100.10.0/24
    195. 218.100.14.0/24
    196. 218.100.60.0/24
    197. 220.231.64.0/18
    198. 221.121.0.0/18
    199. 221.132.0.0/18
    200. 221.133.0.0/19
    201. 222.252.0.0/14
    202. 223.27.104.0/21
    Sao chép mã
    Tạo file .htaccess với nội dung như sau rồi up lên thư mục root đang bị ddos, chmod 404 để cấm thay đổi.
    1.     RewriteEngine on
    2. ErrorDocument 404 /404.html
    3. <Files ".htaccess">
    4. deny from all
    5. </Files>
    6. order deny,allow
    7. deny from all
    8. allow from 64.0.0.0/14
    9. allow from 64.0.0.0/22
    10. allow from 64.0.0.0/18
    11. allow from 64.0.0.0/15
    12. allow from 64.0.0.0/19
    13. allow from 64.255.180.0/14
    14. allow from 64.255.180.0/22
    15. allow from 64.255.180.0/18
    16. allow from 64.255.180.0/15
    17. allow from 64.255.180.0/19
    18. allow from 80.0.0.0/14
    19. allow from 80.0.0.0/22
    20. allow from 80.0.0.0/18
    21. allow from 80.0.0.0/15
    22. allow from 80.0.0.0/19
    23. allow from 80.239.0.0/14
    24. allow from 80.239.0.0/22
    25. allow from 80.239.0.0/18
    26. allow from 80.239.0.0/15
    27. allow from 80.239.0.0/19
    28. allow from 82.145.209.0/14
    29. allow from 82.145.209.0/22
    30. allow from 82.145.209.0/18
    31. allow from 82.145.209.0/15
    32. allow from 82.145.209.0/19
    33. allow from 80.239.243.0/14
    34. allow from 80.239.243.0/22
    35. allow from 80.239.243.0/18
    36. allow from 80.239.243.0/15
    37. allow from 80.239.243.0/19
    38. allow from 80.239.242.0/14
    39. allow from 80.239.242.0/22
    40. allow from 80.239.242.0/18
    41. allow from 80.239.242.0/15
    42. allow from 80.239.242.0/19

    43. allow from 72.30.142.247/14
    44. allow from 72.30.142.247/22
    45. allow from 72.30.142.247/18
    46. allow from 72.30.142.247/15
    47. allow from 72.30.142.247/19

    48. allow from 1.52.0.0/14
    49. allow from 14.0.16.0/20
    50. allow from 14.160.0.0/11
    51. allow from 14.224.0.0/11
    52. allow from 27.0.12.0/22
    53. allow from 27.2.0.0/15
    54. allow from 27.64.0.0/12
    55. allow from 27.118.16.0/20
    56. allow from 42.1.64.0/18
    57. allow from 42.96.0.0/18
    58. allow from 42.112.0.0/13
    59. allow from 49.156.52.0/22
    60. allow from 49.213.64.0/18
    61. allow from 49.236.208.0/22
    62. allow from 49.246.128.0/18
    63. allow from 49.246.192.0/19
    64. allow from 58.186.0.0/15
    65. allow from 61.11.224.0/19
    66. allow from 61.28.224.0/19
    67. allow from 101.53.0.0/18
    68. allow from 101.96.12.0/22
    69. allow from 101.96.64.0/18
    70. allow from 101.99.0.0/18
    71. allow from 103.1.200.0/22
    72. allow from 103.1.208.0/22
    73. allow from 103.1.236.0/22
    74. allow from 103.2.220.0/22
    75. allow from 103.2.224.0/22
    76. allow from 103.2.228.0/22
    77. allow from 110.35.64.0/21
    78. allow from 110.35.72.0/21
    79. allow from 110.44.184.0/21
    80. allow from 111.65.240.0/20
    81. allow from 111.91.232.0/22
    82. allow from 112.72.64.0/18
    83. allow from 112.78.0.0/20
    84. allow from 112.109.88.0/21
    85. allow from 112.137.128.0/20
    86. allow from 112.197.0.0/16
    87. allow from 112.213.80.0/20
    88. allow from 113.20.96.0/19
    89. allow from 113.22.0.0/16
    90. allow from 113.23.0.0/17
    91. allow from 113.52.32.0/19
    92. allow from 113.61.108.0/22
    93. allow from 113.160.0.0/11
    94. allow from 115.72.0.0/13
    95. allow from 115.84.176.0/21
    96. allow from 115.146.120.0/21
    97. allow from 115.165.160.0/21
    98. allow from 116.68.128.0/21
    99. allow from 116.96.0.0/12
    100. allow from 116.118.0.0/17
    101. allow from 116.193.64.0/20
    102. allow from 116.212.32.0/19
    103. allow from 117.0.0.0/13
    104. allow from 117.103.192.0/18
    105. allow from 117.122.0.0/17
    106. allow from 118.68.0.0/14
    107. allow from 118.102.0.0/21
    108. allow from 118.107.64.0/18
    109. allow from 119.15.160.0/19
    110. allow from 119.17.192.0/18
    111. allow from 119.18.128.0/20
    112. allow from 119.18.184.0/21
    113. allow from 119.82.128.0/20
    114. allow from 120.50.184.0/21
    115. allow from 120.72.80.0/21
    116. allow from 120.72.96.0/19
    117. allow from 120.138.64.0/20
    118. allow from 122.102.112.0/22
    119. allow from 122.129.0.0/18
    120. allow from 122.201.8.0/21
    121. allow from 123.16.0.0/12
    122. allow from 124.157.0.0/18
    123. allow from 124.158.0.0/20
    124. allow from 125.58.0.0/18
    125. allow from 125.212.128.0/17
    126. allow from 125.214.0.0/18
    127. allow from 125.234.0.0/15
    128. allow from 125.253.112.0/20
    129. allow from 171.224.0.0/11
    130. allow from 175.103.64.0/18
    131. allow from 175.106.0.0/22
    132. allow from 180.93.0.0/16
    133. allow from 180.148.0.0/21
    134. allow from 180.148.128.0/20
    135. allow from 180.214.236.0/22
    136. allow from 182.161.80.0/20
    137. allow from 182.236.112.0/22
    138. allow from 182.237.20.0/22
    139. allow from 183.81.0.0/17
    140. allow from 183.90.160.0/21
    141. allow from 183.91.0.0/19
    142. allow from 183.91.160.0/19
    143. allow from 202.0.79.0/24
    144. allow from 202.4.168.0/24
    145. allow from 202.4.176.0/24
    146. allow from 202.6.2.0/24
    147. allow from 202.6.96.0/23
    148. allow from 202.9.79.0/24
    149. allow from 202.9.80.0/24
    150. allow from 202.9.84.0/24
    151. allow from 202.37.86.0/23
    152. allow from 202.43.108.0/22
    153. allow from 202.44.137.0/24
    154. allow from 202.47.87.0/24
    155. allow from 202.47.142.0/24
    156. allow from 202.52.39.0/24
    157. allow from 202.55.132.0/22
    158. allow from 202.56.57.0/24
    159. allow from 202.58.245.0/24
    160. allow from 202.59.238.0/23
    161. allow from 202.59.252.0/23
    162. allow from 202.60.104.0/21
    163. allow from 202.74.56.0/24
    164. allow from 202.74.58.0/23
    165. allow from 202.78.224.0/21
    166. allow from 202.79.232.0/21
    167. allow from 202.87.212.0/22
    168. allow from 202.92.4.0/22
    169. allow from 202.93.156.0/22
    170. allow from 202.94.82.0/24
    171. allow from 202.94.88.0/23
    172. allow from 202.124.204.0/24
    173. allow from 202.130.36.0/23
    174. allow from 202.134.16.0/21
    175. allow from 202.134.54.0/24
    176. allow from 202.151.160.0/20
    177. allow from 202.158.244.0/22
    178. allow from 202.160.124.0/23
    179. allow from 202.172.4.0/23
    180. allow from 202.191.56.0/22
    181. allow from 203.8.127.0/24
    182. allow from 203.8.172.0/24
    183. allow from 203.34.144.0/24
    184. allow from 203.77.178.0/24
    185. allow from 203.79.28.0/24
    186. allow from 203.89.140.0/22
    187. allow from 203.99.248.0/22
    188. allow from 203.113.128.0/19
    189. allow from 203.113.160.0/19
    190. allow from 203.119.8.0/22
    191. allow from 203.119.36.0/22
    192. allow from 203.119.44.0/22
    193. allow from 203.119.58.0/23
    194. allow from 203.119.60.0/22
    195. allow from 203.119.64.0/21
    196. allow from 203.119.72.0/22
    197. allow from 203.128.240.0/21
    198. allow from 203.160.0.0/23
    199. allow from 203.160.96.0/21
    200. allow from 203.161.178.0/24
    201. allow from 203.162.0.0/21
    202. allow from 203.162.8.0/21
    203. allow from 203.162.16.0/20
    204. allow from 203.162.32.0/19
    205. allow from 203.162.64.0/18
    206. allow from 203.162.128.0/20
    207. allow from 203.162.144.0/20
    208. allow from 203.162.160.0/19
    209. allow from 203.162.192.0/18
    210. allow from 203.163.128.0/18
    211. allow from 203.170.26.0/23
    212. allow from 203.171.16.0/20
    213. allow from 203.176.160.0/21
    214. allow from 203.189.28.0/22
    215. allow from 203.190.160.0/20
    216. allow from 203.191.8.0/21
    217. allow from 203.191.48.0/21
    218. allow from 203.195.0.0/18
    219. allow from 203.201.56.0/22
    220. allow from 203.205.0.0/18
    221. allow from 203.209.180.0/22
    222. allow from 203.210.128.0/18
    223. allow from 203.210.192.0/18
    224. allow from 210.2.64.0/18
    225. allow from 210.86.224.0/20
    226. allow from 210.211.96.0/19
    227. allow from 210.245.0.0/19
    228. allow from 210.245.32.0/19
    229. allow from 210.245.64.0/18
    230. allow from 218.100.10.0/24
    231. allow from 218.100.14.0/24
    232. allow from 218.100.60.0/24
    233. allow from 220.231.64.0/18
    234. allow from 221.121.0.0/18
    235. allow from 221.132.0.0/18
    236. allow from 221.133.0.0/19
    237. allow from 222.252.0.0/14
    238. allow from 223.27.104.0/21
    239. <Files 403.shtml>
    240. order allow,deny
    241. allow from all
    242. </Files>
    243. AuthUserFile "/home/thaiduon/.htpasswds/public_html/passwd"
    244. AuthType Basic
    245. AuthName "User:   NTD    -  Pass:  NTD"
    246. require valid-user
    Sao chép mã
    Kết quả: tất cả ip không nằm trong list được phép ( allow ) trong file .htaccess thì sẽ không truy cập được vào site bạn cũng như các tool ddos không thể kết nối đến site bạn. Dĩ nhiên là không có gì tuyệt đối nhé. Chứ BOTNET nó chỉ cần 1 lần connect server bạn phải - Deny 1 lần thế đủ xỉu.

    Chúc sống sót ^^


    Đăng lúc 16-7-2011 08:09 AM | Xem tất
    chả hiểu cái file của em, cứ thay đổi là không chạy dc forum host nản quá >.<
    Bạn phải đăng nhập mới được đăng bài Đăng nhập | Đăng ký

    Quy tắc điểm

    Đóng

    Thông báoTrước /1 Sau

    Phòng tối|Lưu trữ|Diễn đàn Yên Bái 2024 Community Guidelines |

    GMT+7, 14-10-2026 09:07 PM , Processed in 0.024321 second(s), 18 queries .

    Powered by Discuz! X3.4

    © 2001-2013 Comsenz Inc.

    Trả lời nhanh Lên trên Trở lại danh sách