deadfinder 1.4.3 → 1.5.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 +4 -4
- data/lib/deadfinder/version.rb +1 -1
- data/lib/deadfinder.rb +26 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b8024d88f4693ba6418aab2cca93f3c267fa823f2fa7b47116d39d7d6adb3d40
|
4
|
+
data.tar.gz: 0c494d74bbbb448eb482204b2525478847d13b62e32c4b2cbd97f16315890973
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b231b730274c98b22672a4169cb943054db76b6ae0fec70f66eee4eb9e314217942b71d0d4da854556d8f7ec81e33d29be8cb9a758ea12ab3d7aec4ce40907b0
|
7
|
+
data.tar.gz: 55ae74b443389b62dbd34150deed7e9de433540ca8e2796ed753d90366849f8690d6025d21cd513154e2379cf31c582817c7dd5119ecf629da42dd1d2571296a
|
data/lib/deadfinder/version.rb
CHANGED
data/lib/deadfinder.rb
CHANGED
@@ -23,6 +23,7 @@ class DeadFinderRunner
|
|
23
23
|
'timeout' => 10,
|
24
24
|
'output' => '',
|
25
25
|
'headers' => [],
|
26
|
+
'worker_headers' => [],
|
26
27
|
'silent' => true,
|
27
28
|
'verbose' => false,
|
28
29
|
'include30x' => false
|
@@ -81,11 +82,29 @@ class DeadFinderRunner
|
|
81
82
|
uri = URI.parse(j)
|
82
83
|
|
83
84
|
# Create HTTP request with timeout and headers
|
84
|
-
|
85
|
+
proxy_uri = URI.parse(options['proxy']) if options['proxy'] && !options['proxy'].empty?
|
86
|
+
http = if proxy_uri
|
87
|
+
Net::HTTP.new(uri.host, uri.port, proxy_uri.host, proxy_uri.port, proxy_uri.user, proxy_uri.password)
|
88
|
+
else
|
89
|
+
Net::HTTP.new(uri.host, uri.port)
|
90
|
+
end
|
85
91
|
http.use_ssl = (uri.scheme == 'https')
|
86
92
|
http.read_timeout = options['timeout'].to_i if options['timeout']
|
87
93
|
|
94
|
+
# Set SSL verification mode
|
95
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_NONE if http.use_ssl?
|
96
|
+
|
88
97
|
request = Net::HTTP::Get.new(uri.request_uri)
|
98
|
+
|
99
|
+
# Add User-Agent header
|
100
|
+
request['User-Agent'] = options['user_agent']
|
101
|
+
|
102
|
+
# Add worker headers if provided
|
103
|
+
options['worker_headers']&.each do |header|
|
104
|
+
key, value = header.split(':', 2)
|
105
|
+
request[key.strip] = value.strip
|
106
|
+
end
|
107
|
+
|
89
108
|
response = http.request(request)
|
90
109
|
status_code = response.code.to_i
|
91
110
|
Logger.verbose "Status Code: #{status_code} for #{j}" if options['verbose']
|
@@ -178,7 +197,12 @@ class DeadFinder < Thor
|
|
178
197
|
class_option :concurrency, aliases: :c, default: 50, type: :numeric, desc: 'Number of concurrency'
|
179
198
|
class_option :timeout, aliases: :t, default: 10, type: :numeric, desc: 'Timeout in seconds'
|
180
199
|
class_option :output, aliases: :o, default: '', type: :string, desc: 'File to write JSON result'
|
181
|
-
class_option :headers, aliases: :H, default: [], type: :array,
|
200
|
+
class_option :headers, aliases: :H, default: [], type: :array,
|
201
|
+
desc: 'Custom HTTP headers to send with initial request'
|
202
|
+
class_option :worker_headers, default: [], type: :array, desc: 'Custom HTTP headers to send with worker requests'
|
203
|
+
class_option :user_agent, default: 'Mozilla/5.0 (compatible; DeadFinder/1.5.0;)', type: :string,
|
204
|
+
desc: 'User-Agent string to use for requests'
|
205
|
+
class_option :proxy, aliases: :p, default: '', type: :string, desc: 'Proxy server to use for requests'
|
182
206
|
class_option :silent, aliases: :s, default: false, type: :boolean, desc: 'Silent mode'
|
183
207
|
class_option :verbose, aliases: :v, default: false, type: :boolean, desc: 'Verbose mode'
|
184
208
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: deadfinder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- hahwul
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-10-
|
11
|
+
date: 2024-10-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: colorize
|