security-gem 0.1.2 → 0.1.5

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.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: security-gem
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - tuckerweibell
@@ -28,11 +28,15 @@ files:
28
28
  - bin/setup
29
29
  - file.json
30
30
  - lib/security/gem.rb
31
- - lib/security/gem/builder.rb
31
+ - lib/security/gem/security.rb
32
32
  - lib/security/gem/version.rb
33
33
  - lib/security/test.rb
34
- - payloads.txt
35
34
  - security-gem.gemspec
35
+ - sql_common_commands.txt
36
+ - sql_payloads.txt
37
+ - top_user_agents.txt
38
+ - xss_common_scripts.txt
39
+ - xss_payloads.txt
36
40
  homepage: https://github.com/tuckerweibell/security-gem
37
41
  licenses:
38
42
  - MIT
@@ -1,45 +0,0 @@
1
- require 'json'
2
- require 'logger'
3
- require 'logger/formatter'
4
- require 'net/http'
5
- require 'open-uri'
6
- require 'dotenv'
7
- Dotenv.load
8
-
9
- module SecurityLogger
10
-
11
- #Create logs used for SQL Injection detections
12
- class Sql_Injection
13
- def initialize
14
-
15
- end
16
-
17
- def log(input)
18
- logger = Logger.new(STDOUT)
19
- logger.formatter = proc do |severity, datetime, progname, msg|
20
- {
21
- severity: severity,
22
- timestamp: datetime.to_s,
23
- app: progname,
24
- message: msg
25
- }.to_json + $/
26
- end
27
-
28
- error = {:input => input, :ip_origin => request.ip}
29
- logger.warn(JSON.parse(error.to_json))
30
- end
31
-
32
- def check_input(input)
33
- uri = ENV['PATH_TO_PAYLOAD']
34
- uri = URI(uri)
35
- file = Net::HTTP.get(uri)
36
- file.each_line do |file|
37
- if file.strip == input.strip
38
- self.log(input.strip)
39
- break
40
- end
41
- end
42
-
43
- end
44
- end
45
- end