Hide_Ya_Ips 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/README.md +24 -0
- data/Rakefile +4 -0
- data/lib/Hide_Ya_Ips/version.rb +5 -0
- data/lib/Hide_Ya_Ips.rb +28 -0
- data/sig/Hide_Ya_Ips.rbs +4 -0
- metadata +49 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 25612870db0d563e912bc5b49212f0fdf81754c2ce562c19cf5b0de1a6832399
|
|
4
|
+
data.tar.gz: cd72b5cb4c8ecb929c68df050dd3589e9b682114f9121cb2c09e11a6cb9cd0f6
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 75c906dc5b900149dcefa7072c36c5f59623078715c53789d6196141dd94c0cf51f5025899663a38f0bd2912ab2ec71ba38885318a55d317d91b4d929c577ed0
|
|
7
|
+
data.tar.gz: 5d0521f14aa1722499ad5c42ca245738dc31b28e049c9dfd729807fe1c1c1da7818bab52108704928286fcac1f5623fae9eafbe5fb91fe8ce72a78e8d2687146
|
data/README.md
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# HideYaIps
|
|
2
|
+
|
|
3
|
+
TREAT YA SELF by removing your IP from apache web server logs and replace each instance of the IPS with a random generated IP.. Different types of logs will be added at a later time. This gem will take the given IP and go to apache2 logs (/var/log/access.log)... You will need to run as sudo sadly.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
```ruby
|
|
7
|
+
gem install Hide_Ya_Ips
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## Usage
|
|
11
|
+
|
|
12
|
+
```ruby
|
|
13
|
+
require './lib/Hide_Ya_Ips'
|
|
14
|
+
hyi = HideYaIps::WebServer.new
|
|
15
|
+
hyi.ip = "38.99.236.50"
|
|
16
|
+
hyi.apache
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Contributing
|
|
23
|
+
|
|
24
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/Hide_Ya_Ips.
|
data/Rakefile
ADDED
data/lib/Hide_Ya_Ips.rb
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative "Hide_Ya_Ips/version"
|
|
4
|
+
|
|
5
|
+
module HideYaIps
|
|
6
|
+
class WebServer
|
|
7
|
+
attr_accessor :ip
|
|
8
|
+
def initialize(path: File.join('/var', 'log', 'access.log'))
|
|
9
|
+
@ip = ip
|
|
10
|
+
@path = path
|
|
11
|
+
end
|
|
12
|
+
def apache
|
|
13
|
+
out = ''
|
|
14
|
+
# generate random IP
|
|
15
|
+
new_ip = Array.new(4) { rand(256) }.join('.')
|
|
16
|
+
File.readlines(@path).each do |line|
|
|
17
|
+
old_ip = line.match(/((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)/)
|
|
18
|
+
out += if old_ip.to_s == @ip
|
|
19
|
+
line.gsub(old_ip.to_s, new_ip)
|
|
20
|
+
else
|
|
21
|
+
line
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
File.delete(@path)
|
|
25
|
+
File.open(@path, 'w+') { |file| file.write(out) }
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
data/sig/Hide_Ya_Ips.rbs
ADDED
metadata
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: Hide_Ya_Ips
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.1.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Michael-Meade
|
|
8
|
+
- Banksy
|
|
9
|
+
autorequire:
|
|
10
|
+
bindir: exe
|
|
11
|
+
cert_chain: []
|
|
12
|
+
date: 2025-11-14 00:00:00.000000000 Z
|
|
13
|
+
dependencies: []
|
|
14
|
+
description: TREAT YA SELF By removing your IP from web server logs with a randomly
|
|
15
|
+
generated IPs
|
|
16
|
+
email:
|
|
17
|
+
- noway@lol.com
|
|
18
|
+
executables: []
|
|
19
|
+
extensions: []
|
|
20
|
+
extra_rdoc_files: []
|
|
21
|
+
files:
|
|
22
|
+
- README.md
|
|
23
|
+
- Rakefile
|
|
24
|
+
- lib/Hide_Ya_Ips.rb
|
|
25
|
+
- lib/Hide_Ya_Ips/version.rb
|
|
26
|
+
- sig/Hide_Ya_Ips.rbs
|
|
27
|
+
homepage:
|
|
28
|
+
licenses: []
|
|
29
|
+
metadata: {}
|
|
30
|
+
post_install_message:
|
|
31
|
+
rdoc_options: []
|
|
32
|
+
require_paths:
|
|
33
|
+
- lib
|
|
34
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
35
|
+
requirements:
|
|
36
|
+
- - ">="
|
|
37
|
+
- !ruby/object:Gem::Version
|
|
38
|
+
version: '0'
|
|
39
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
40
|
+
requirements:
|
|
41
|
+
- - ">="
|
|
42
|
+
- !ruby/object:Gem::Version
|
|
43
|
+
version: '0'
|
|
44
|
+
requirements: []
|
|
45
|
+
rubygems_version: 3.4.20
|
|
46
|
+
signing_key:
|
|
47
|
+
specification_version: 4
|
|
48
|
+
summary: Replaces Your IP with a random one in Web logs
|
|
49
|
+
test_files: []
|