Skip to content

Commit 29872df

Browse files
author
Stephen
committed
Merge branch 'master' into dependabot/bundler/irb-1.12.0
2 parents 05f833f + 9e94709 commit 29872df

File tree

11 files changed

+244
-258
lines changed

11 files changed

+244
-258
lines changed

Diff for: Gemfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ gem 'espeak-ruby', '~> 1.1.0' # Text-to-Voice
2323
gem 'rake', '~> 13.1'
2424
gem 'otr-activerecord', '~> 2.2.0'
2525
gem 'sqlite3', '~> 1.7'
26-
gem 'rubocop', '~> 1.60.2', require: false
26+
gem 'rubocop', '~> 1.62.1', require: false
2727

2828
# Geolocation support
2929
group :geoip do

Diff for: Gemfile.lock

+6-6
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ GEM
131131
mojo_magick (~> 0.6.5)
132132
rqrcode_core (~> 1.0)
133133
racc (1.7.3)
134-
rack (2.2.8)
134+
rack (2.2.8.1)
135135
rack-protection (3.2.0)
136136
base64 (>= 0.1.0)
137137
rack (~> 2.2, >= 2.2.4)
@@ -165,19 +165,19 @@ GEM
165165
diff-lcs (>= 1.2.0, < 2.0)
166166
rspec-support (~> 3.13.0)
167167
rspec-support (3.13.0)
168-
rubocop (1.60.2)
168+
rubocop (1.62.1)
169169
json (~> 2.3)
170170
language_server-protocol (>= 3.17.0)
171171
parallel (~> 1.10)
172172
parser (>= 3.3.0.2)
173173
rainbow (>= 2.2.2, < 4.0)
174174
regexp_parser (>= 1.8, < 3.0)
175175
rexml (>= 3.2.5, < 4.0)
176-
rubocop-ast (>= 1.30.0, < 2.0)
176+
rubocop-ast (>= 1.31.1, < 2.0)
177177
ruby-progressbar (~> 1.7)
178178
unicode-display_width (>= 2.4.0, < 3.0)
179-
rubocop-ast (1.30.0)
180-
parser (>= 3.2.1.0)
179+
rubocop-ast (1.31.2)
180+
parser (>= 3.3.0.4)
181181
ruby-progressbar (1.13.0)
182182
ruby2_keywords (0.0.5)
183183
rubyzip (2.3.2)
@@ -276,7 +276,7 @@ DEPENDENCIES
276276
rdoc (~> 6.6)
277277
rest-client (~> 2.1.0)
278278
rspec (~> 3.13)
279-
rubocop (~> 1.60.2)
279+
rubocop (~> 1.62.1)
280280
rubyzip (~> 2.3)
281281
rushover (~> 0.3.0)
282282
selenium-webdriver (~> 4.18)

Diff for: core/main/configuration.rb

+10-6
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,12 @@ def validate
7272

7373
return unless validate_public_config_variable?(@config)
7474

75+
# Note for developers:
76+
# The configuration path 'beef.http.public_port' is deprecated.
77+
# Use the new format for public_port variables as described in the BeEF project documentation.
78+
# Refer to the BeEF configuration guide for the web server configuration details:
79+
# https://github.com/beefproject/beef/wiki/Configuration#web-server-configuration
7580
if @config['beef']['http']['public_port']
76-
print_error 'Config path beef.http.public_port is deprecated.'
77-
print_error 'Please use the new format for public variables found'
78-
print_error 'https://github.com/beefproject/beef/wiki/Configuration#web-server-configuration'
7981
return
8082
end
8183

@@ -277,13 +279,15 @@ def load_modules_config
277279

278280
private
279281

282+
# Note for developers:
283+
# The configuration path 'beef.http.public' is deprecated.
284+
# Use the new format for public variables as described in the BeEF project documentation.
285+
# Refer to the BeEF configuration guide for the web server configuration details:
286+
# https://github.com/beefproject/beef/wiki/Configuration#web-server-configuration
280287
def validate_public_config_variable?(config)
281288
return true if config['beef']['http']['public'].is_a?(Hash) ||
282289
config['beef']['http']['public'].is_a?(NilClass)
283290

284-
print_error 'Config path beef.http.public is deprecated.'
285-
print_error 'Please use the new format for public variables found'
286-
print_error 'https://github.com/beefproject/beef/wiki/Configuration#web-server-configuration'
287291
false
288292
end
289293
end

Diff for: core/module.rb

+7-3
Original file line numberDiff line numberDiff line change
@@ -301,9 +301,13 @@ def self.parse_targets(mod)
301301

302302
targets = {}
303303
target_config.each do |k, v|
304-
next unless BeEF::Core::Constants::CommandModule.const_defined? "VERIFIED_#{k.upcase}"
305-
306-
key = BeEF::Core::Constants::CommandModule.const_get "VERIFIED_#{k.upcase}"
304+
# Convert the key to a string if it's not already one
305+
k_str = k.to_s.upcase
306+
307+
# Use the adjusted string key for the rest of the process
308+
next unless BeEF::Core::Constants::CommandModule.const_defined? "VERIFIED_#{k_str}"
309+
310+
key = BeEF::Core::Constants::CommandModule.const_get "VERIFIED_#{k_str}"
307311
targets[key] = [] unless targets.key? key
308312
browser = nil
309313

Diff for: extensions/dns/model.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class Rule < BeEF::Core::Model
1212
# Hooks the model's "save" event. Validates pattern/response and generates a rule identifier.
1313
before_save :check_rule
1414
self.table_name = 'dns_rules'
15-
serialize :response, Array
15+
serialize :response, type: Array
1616

1717
private
1818

Diff for: extensions/qrcode/qrcode.rb

+17-6
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,25 @@ def self.pre_http_start(_http_hook_server)
2828
fullurls << target
2929
# relative URLs
3030
else
31-
# network interfaces
32-
BeEF::Core::Console::Banners.interfaces.each do |int|
33-
next if int == '0.0.0.0'
31+
32+
# Retrieve the list of network interfaces from BeEF::Core::Console::Banners
33+
interfaces = BeEF::Core::Console::Banners.interfaces
3434

35-
fullurls << "#{beef_proto}://#{int}:#{beef_port}#{target}"
35+
# Check if the interfaces variable is nil, indicating that network interfaces are not available
36+
if interfaces.nil?
37+
print_error "[QR] Error: Network interfaces information is unavailable."
38+
print_error "[QR] Error: This will be acceptable during testing."
39+
else
40+
# If interfaces are available, iterate over each network interface
41+
interfaces.each do |int|
42+
# Skip the loop iteration if the interface address is '0.0.0.0' (which generally represents all IPv4 addresses on the local machine)
43+
next if int == '0.0.0.0'
44+
# Construct full URLs using the network interface address, and add them to the fullurls array
45+
# The URL is composed of the BeEF protocol, interface address, BeEF port, and the target path
46+
fullurls << "#{beef_proto}://#{int}:#{beef_port}#{target}"
47+
end
3648
end
37-
# beef host
38-
fullurls << "#{beef_proto}://#{beef_host}:#{beef_port}#{target}" unless beef_host == '0.0.0.0'
49+
3950
end
4051
end
4152

0 commit comments

Comments
 (0)