url_ban_list 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 494ad6952e045fc9204c3abaa7ad11f102f89c6bc302b4591bce16802b74ff19
4
+ data.tar.gz: 4fff77b6c49de6672d369073f1f7c223052d17d678094d647a53a41d7be107f8
5
+ SHA512:
6
+ metadata.gz: 1aba22cb48ea11c157ac308b1095cc378755c5b663133d87f9e8b9e8a33f304c25ba66d9dc9db614f89880b0ee8d69b4bedc788169f48b292c9bc09816db5066
7
+ data.tar.gz: 7bcbf1b225314bba76b68b36e63920c8ee347f159fec486c7131f57917cc0eaa5e5e6a32783ce675105098e58013818c4092ce8cdb91a10dcb495f46b3bb84e0
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 3.1.3
data/CHANGELOG.md ADDED
@@ -0,0 +1,3 @@
1
+ ## [1.0.0] - 7-01-2024
2
+
3
+ - Initial release
@@ -0,0 +1,84 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
+
7
+ We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
+
9
+ ## Our Standards
10
+
11
+ Examples of behavior that contributes to a positive environment for our community include:
12
+
13
+ * Demonstrating empathy and kindness toward other people
14
+ * Being respectful of differing opinions, viewpoints, and experiences
15
+ * Giving and gracefully accepting constructive feedback
16
+ * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
+ * Focusing on what is best not just for us as individuals, but for the overall community
18
+
19
+ Examples of unacceptable behavior include:
20
+
21
+ * The use of sexualized language or imagery, and sexual attention or
22
+ advances of any kind
23
+ * Trolling, insulting or derogatory comments, and personal or political attacks
24
+ * Public or private harassment
25
+ * Publishing others' private information, such as a physical or email
26
+ address, without their explicit permission
27
+ * Other conduct which could reasonably be considered inappropriate in a
28
+ professional setting
29
+
30
+ ## Enforcement Responsibilities
31
+
32
+ Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
33
+
34
+ Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
35
+
36
+ ## Scope
37
+
38
+ This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
39
+
40
+ ## Enforcement
41
+
42
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at dzierbicki.kamil@outlook.com. All complaints will be reviewed and investigated promptly and fairly.
43
+
44
+ All community leaders are obligated to respect the privacy and security of the reporter of any incident.
45
+
46
+ ## Enforcement Guidelines
47
+
48
+ Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
49
+
50
+ ### 1. Correction
51
+
52
+ **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
53
+
54
+ **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
55
+
56
+ ### 2. Warning
57
+
58
+ **Community Impact**: A violation through a single incident or series of actions.
59
+
60
+ **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
61
+
62
+ ### 3. Temporary Ban
63
+
64
+ **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
65
+
66
+ **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
67
+
68
+ ### 4. Permanent Ban
69
+
70
+ **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
71
+
72
+ **Consequence**: A permanent ban from any sort of public interaction within the community.
73
+
74
+ ## Attribution
75
+
76
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
77
+ available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
78
+
79
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
80
+
81
+ [homepage]: https://www.contributor-covenant.org
82
+
83
+ For answers to common questions about this code of conduct, see the FAQ at
84
+ https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
data/Gemfile ADDED
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
4
+
5
+ # Specify your gem's dependencies in url_ban_list.gemspec
6
+ gemspec
7
+
8
+ gem 'minitest', '~> 5.0'
9
+ gem 'rake', '~> 13.0'
data/Gemfile.lock ADDED
@@ -0,0 +1,21 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ url_ban_list (1.0.0)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ minitest (5.17.0)
10
+ rake (13.0.6)
11
+
12
+ PLATFORMS
13
+ arm64-darwin-22
14
+
15
+ DEPENDENCIES
16
+ minitest (~> 5.0)
17
+ rake (~> 13.0)
18
+ url_ban_list!
19
+
20
+ BUNDLED WITH
21
+ 2.3.26
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2024 Kamil Dzierbicki OxyconIt!
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,49 @@
1
+ # UrlBanList
2
+
3
+ Ban bots or attackers filtered by requested URL.
4
+
5
+ ### Motivation
6
+ I had a big attack by bots that want to fetch sensitive data from the application.
7
+ I had to block them by IP address. But they were using a lot of IP addresses, so I decided to block them by requested URL.
8
+ This simple gem is a result of my work with having honeypot for 3 years and what they would like to scan and download.
9
+
10
+ ## Installation
11
+ The list was created specifically for **Ruby/Rails apps**. Sites using PHP, for example, may be falsely banned.
12
+ Install the gem and add it to the application's gemfile by executing it:
13
+
14
+ $ bundle add url_ban_list
15
+
16
+ or manually by adding `gem 'url_ban_list'` into your Gemfile.
17
+
18
+ ## Usage
19
+ When you are using [Rack-Attack](https://github.com/rack/rack-attack) gem, you can add the following code to your `config/initializers/rack_attack.rb` file:
20
+
21
+ ```ruby
22
+ # config/initializers/rack_attack.rb
23
+ class Rack::Attack
24
+ # block bots targeting suspicious URLS - ban for 24 hours
25
+ blocklist('ban-suspicious-url') do |req|
26
+ Rack::Attack::Allow2Ban.filter("ban-get-#{req.ip}-#{OpenSSL::Digest::SHA256.hexdigest(req.user_agent.to_s)}",
27
+ maxretry: 0,
28
+ findtime: 1.minute,
29
+ bantime: 24.hours) do
30
+ ::UrlBanList::URLS.include?(req.path)
31
+ end
32
+ end
33
+ end
34
+ ```
35
+ Then **restart** the app and check the logs in your console when requesting for example:
36
+ - www.yoursite.com/.env
37
+ - www.yoursite.com/.git/config
38
+ etc.
39
+
40
+ ## Development
41
+
42
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
43
+
44
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
45
+
46
+
47
+ ## License
48
+
49
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
data/Rakefile ADDED
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'bundler/gem_tasks'
4
+ require 'rake/testtask'
5
+
6
+ Rake::TestTask.new(:test) do |t|
7
+ t.libs << 'test'
8
+ t.libs << 'lib'
9
+ t.test_files = FileList['test/**/*_test.rb']
10
+ end
11
+
12
+ require 'rubocop/rake_task'
13
+
14
+ RuboCop::RakeTask.new
15
+
16
+ task default: %i[test rubocop]
@@ -0,0 +1,293 @@
1
+ # frozen_string_literal: true
2
+
3
+ module UrlBanList
4
+ URLS = %w[ /wp-includes/wlwmanifest.xml
5
+ /wp/wp-includes/wlwmanifest.xml
6
+ /website/wp-includes/wlwmanifest.xml
7
+ /wordpress/wp-includes/wlwmanifest.xml
8
+ /web/wp-includes/wlwmanifest.xml
9
+ /blog/wp-includes/wlwmanifest.xml
10
+ /sito/wp-includes/wlwmanifest.xml
11
+ /cms/wp-includes/wlwmanifest.xml
12
+ /site/wp-includes/wlwmanifest.xml
13
+ /wp2/wp-includes/wlwmanifest.xml
14
+ /test/wp-includes/wlwmanifest.xml
15
+ /wp1/wp-includes/wlwmanifest.xml
16
+ /news/wp-includes/wlwmanifest.xml
17
+ /2019/wp-includes/wlwmanifest.xml
18
+ /shop/wp-includes/wlwmanifest.xml
19
+ /2018/wp-includes/wlwmanifest.xml
20
+ /media/wp-includes/wlwmanifest.xml
21
+ /wp-login.php
22
+ /.git/config
23
+ /.env
24
+ /version
25
+ /.vscode/sftp.json
26
+ /debug/default/view?panel=config
27
+ /ecp/Current/exporttool/microsoft.exchange.ediscovery.exporttool.application
28
+ /server-status
29
+ /login.action
30
+ /.DS_Store
31
+ /config.json
32
+ /telescope/requests
33
+ /?rest_route=/wp/v2/users/
34
+ /v2/_catalog
35
+ /_all_dbs
36
+ /Public/home/js/check.js
37
+ /static/admin/javascript/hetong.js
38
+ /_ignition/health-check/
39
+ /public/_ignition/health-check/
40
+ /s/034323e2832313e27363e2237313/_/;/META-INF/maven/com.atlassian.jira/jira-webapp-dist/pom.properties
41
+ /s/6383e213e21323e2430313/_/;/META-INF/maven/com.atlassian.jira/jira-webapp-dist/pom.properties
42
+ /administrator/index.php
43
+ /xmlrpc.php
44
+ /misc/ajax.js
45
+ /wp-admin/install.php
46
+ /wp/wp-admin/install.php
47
+ /new/wp-admin/install.php
48
+ /old/wp-admin/install.php
49
+ /wordpress/wp-admin/install.php
50
+ /oldsite/wp-admin/install.php
51
+ /blog/wp-admin/install.php
52
+ /cms/wp-admin/install.php
53
+ /web/wp-admin/install.php
54
+ /backup/wp-admin/install.php
55
+ /site/wp-admin/install.php
56
+ /test/wp-admin/install.php
57
+ /2020/wp-includes/wlwmanifest.xml
58
+ /secrets.yml
59
+ /blog/wp-login.php
60
+ /js../.git/config
61
+ /wp/wp-login.php
62
+ /bitbucket-pipelines.yml
63
+ /config/settings.yml
64
+ /matomo/.travis.yml
65
+ /redmine/config/settings.yml
66
+ /assets../.git/config
67
+ /img../.git/config
68
+ /static../.git/config
69
+ /redmine/config/secrets.yml
70
+ /test/config/secrets.yml
71
+ /info.php
72
+ /media../.git/config
73
+ /content../.git/config
74
+ /css../.git/config
75
+ /.travis.yml
76
+ /config/secrets.yml
77
+ /lib../.git/config
78
+ /api/search?folderIds=0
79
+ /settings.yml
80
+ /events../.git/config
81
+ /images../.git/config
82
+ /config/configuration.yml
83
+ /railsapp/config/storage.yml
84
+ /.azure-pipelines.yml
85
+ /azure-pipelines.yml
86
+ /cloud-config.yml
87
+ /core-cloud-config.yml
88
+ /.sass-lint.yml
89
+ /config/storage.yml
90
+ /pantheon.upstream.yml
91
+ /docker-cloud.yml
92
+ /configuration.yml
93
+ /pipeline.yaml
94
+ /storage.yml
95
+ /_config.yml
96
+ /config/security.yml
97
+ /app/config/security.yml
98
+ /wp-cli.yml
99
+ /.styleci.yml
100
+ /security.yml
101
+ /blog/xmlrpc.php
102
+ /wp/xmlrpc.php
103
+ /wordpress/wp-login.php
104
+ /admin/wp-login.php
105
+ /wp-admin/wp-login.php
106
+ /login/wp-login.php
107
+ /web/wp-login.php
108
+ /shop/wp-login.php
109
+ /new/wp-login.php
110
+ /site/wp-login.php
111
+ /.remote
112
+ /.local
113
+ /.production
114
+ /vendor/.env
115
+ /lib/.env
116
+ /lab/.env
117
+ /cronlab/.env
118
+ /cron/.env
119
+ /core/.env
120
+ /core/app/.env
121
+ /core/Datavase/.env
122
+ /database/.env
123
+ /config/.env
124
+ /assets/.env
125
+ /app/.env
126
+ /apps/.env
127
+ /uploads/.env
128
+ /sitemaps/.env
129
+ /saas/.env
130
+ /api/.env
131
+ /psnlink/.env
132
+ /exapi/.env
133
+ /site/.env
134
+ /admin/.env
135
+ /web/.env
136
+ /public/.env
137
+ /en/.env
138
+ /tools/.env
139
+ /v1/.env
140
+ /v2/.env
141
+ /administrator/.env
142
+ /laravel/.env
143
+ /.git/HEAD
144
+ /__MACOSX/.git/config
145
+ /api/user/v1/.git/config
146
+ /api/admin/v3/.git/config
147
+ /api/.git/config
148
+ /api/user/v4/.git/config
149
+ /api/user/v2/.git/config
150
+ /api/admin/v4/.git/config
151
+ /api/user/v3/.git/config
152
+ /api/v1/.git/config
153
+ /aomanalyzer/.git/config
154
+ /api/admin/v1/.git/config
155
+ /admin/.git/config
156
+ /alpha/.git/config
157
+ /api/admin/v2/.git/config
158
+ /a/.git/config
159
+ /api/v2/.git/config
160
+ /site/.git/config
161
+ /static/.git/config
162
+ /database/.git/config
163
+ /m/.git/config
164
+ /old-cuburn/.git/config
165
+ /samples/.git/config
166
+ /new/.git/config
167
+ /application/.git/config
168
+ /store/.git/config
169
+ /test/.git/config
170
+ /v3/.git/config
171
+ /wp-content/plugins/.git/config
172
+ /vendor/.git/config
173
+ /app/.git/config
174
+ /blog/.git/config
175
+ /qa/.git/config
176
+ /common/.git/config
177
+ /repos/.git/config
178
+ /wp-content/themes/.git/config
179
+ /api/v4/.git/config
180
+ /wiki/.git/config
181
+ /public/.git/config
182
+ /gateway/.git/config
183
+ /shop/.git/config
184
+ /web/.git/config
185
+ /repository/.git/config
186
+ /dev/.git/config
187
+ /wp-includes/js/.git/config
188
+ /v2/.git/config
189
+ /v1/.git/config
190
+ /staging/.git/config
191
+ /build/.git/config
192
+ /user/.git/config
193
+ /flock/.git/config
194
+ /data/.git/config
195
+ /beta/.git/config
196
+ /git/.git/config
197
+ /cms/.git/config
198
+ /live/.git/config
199
+ /backup/.git/config
200
+ /wp-content/.git/config
201
+ /s3/.git/config
202
+ /blog/wp-content/themes/.git/config
203
+ /demo/.git/config
204
+ /api/v3/.git/config
205
+ /wp-admin/setup-config.php?step=1
206
+ /old/wp-admin/setup-config.php?step=1
207
+ /wordpress/wp-admin/setup-config.php?step=1
208
+ /backup/wp-admin/setup-config.php?step=1
209
+ /OLD/wp-admin/setup-config.php?step=1
210
+ /config/application.ini
211
+ /application/application.ini
212
+ /application/configs/application.ini
213
+ /application.ini
214
+ /configs/application.ini
215
+ /behat.yml
216
+ /behat.yml.dist
217
+ /app/config/parameters.yml
218
+ /app/config/parameters.yml.dist
219
+ /parameters.yml
220
+ /parameters.yml.dist
221
+ /data.sql
222
+ /wp-content/uploads/dump.sql
223
+ /dump.sql
224
+ /mysql.sql
225
+ /dbdump.sql
226
+ /users.sql
227
+ /1.sql
228
+ /mysqldump.sql
229
+ /db.sql
230
+ /localhost.sql
231
+ /translate.sql
232
+ /wp-content/mysql.sql
233
+ /backup.sql
234
+ /sql.sql
235
+ /db_backup.sql
236
+ /temp.sql
237
+ /site.sql
238
+ /database.sql
239
+ /install.sh
240
+ /update.sh
241
+ /.build.sh
242
+ /.jenkins.sh
243
+ /build.sh
244
+ /config.sh
245
+ /.travis.sh
246
+ /run.sh
247
+ /init.sh
248
+ /deploy.sh
249
+ /wp-setup.sh
250
+ /compile.sh
251
+ /startup.sh
252
+ /env.sh
253
+ /setup.sh
254
+ /backup.sh
255
+ /local2prod.sh
256
+ /local2dev.sh
257
+ /reminder.sh
258
+ /dev2local.sh
259
+ /mysqlbackup.sh
260
+ /prod2local.sh
261
+ /aws.sh
262
+ /phpmyadmin
263
+ /php/phpmyadmin
264
+ /admin/phpmyadmin
265
+ /web/phpmyadmin
266
+ /administrator/components/com_joommyadmin/phpmyadmin
267
+ /apache-default/phpmyadmin
268
+ /typo3/phpmyadmin
269
+ /forum/phpmyadmin
270
+ /_phpmyadmin
271
+ /xampp/phpmyadmin
272
+ /phpMyAdmin
273
+ /blog/phpmyadmin
274
+ /admin/phpmyadmin/
275
+ /phpmyadmin/
276
+ /administrator/components/com_joommyadmin/phpmyadmin/
277
+ /blog/phpmyadmin/
278
+ /web/phpmyadmin/
279
+ /xampp/phpmyadmin/
280
+ /php/phpmyadmin/
281
+ /apache-default/phpmyadmin/
282
+ /_phpmyadmin/
283
+ /typo3/phpmyadmin/
284
+ /forum/phpmyadmin/
285
+ /phpMyAdmin/
286
+ /db/robomongo.json
287
+ /robomongo.json
288
+ /ruby/config/storage.yml
289
+ /.licenserc.yaml
290
+ /redmine/config/configuration.yml
291
+ /.aws/credentials
292
+ ]
293
+ end
data/lib/version.rb ADDED
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module UrlBanList
4
+ VERSION = '1.0.0'
5
+ end
metadata ADDED
@@ -0,0 +1,56 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: url_ban_list
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Kamil Dzierbicki
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2024-01-10 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Ban attackers when they try to access to restricted urls
14
+ email:
15
+ - dzierbicki.kamil@outlook.com
16
+ executables: []
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - ".ruby-version"
21
+ - CHANGELOG.md
22
+ - CODE_OF_CONDUCT.md
23
+ - Gemfile
24
+ - Gemfile.lock
25
+ - LICENSE.txt
26
+ - README.md
27
+ - Rakefile
28
+ - lib/url_ban_list.rb
29
+ - lib/version.rb
30
+ homepage: https://blog.oxyconit.com/
31
+ licenses:
32
+ - MIT
33
+ metadata:
34
+ homepage_uri: https://github.com/Oxyconit/url_ban_list
35
+ source_code_uri: https://github.com/Oxyconit/url_ban_list
36
+ changelog_uri: https://github.com/Oxyconit/url_ban_list
37
+ post_install_message:
38
+ rdoc_options: []
39
+ require_paths:
40
+ - lib
41
+ required_ruby_version: !ruby/object:Gem::Requirement
42
+ requirements:
43
+ - - ">="
44
+ - !ruby/object:Gem::Version
45
+ version: 2.0.0
46
+ required_rubygems_version: !ruby/object:Gem::Requirement
47
+ requirements:
48
+ - - ">="
49
+ - !ruby/object:Gem::Version
50
+ version: '0'
51
+ requirements: []
52
+ rubygems_version: 3.3.26
53
+ signing_key:
54
+ specification_version: 4
55
+ summary: List of urls to ban
56
+ test_files: []