Skip to content

Commit 2de8f1b

Browse files
committed
Fixups for specs
1 parent 6910cb0 commit 2de8f1b

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

lib/metasploit/framework/spec/constants.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ module Metasploit::Framework::Spec::Constants
2020
# and not dynamically loaded code
2121
PERSISTENT_CHILD_CONSTANT_NAMES = %w{
2222
Error
23+
External
2324
Loader
2425
MetasploitClassCompatibilityError
2526
Namespace

lib/msf/core/modules/external/bridge.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,12 @@ def write_message(fd, json)
8585
end
8686

8787
def read_json(id, fd)
88-
resp = fd.readpartial(10_000)
89-
JSON.parse(resp)
88+
begin
89+
resp = fd.readpartial(10_000)
90+
JSON.parse(resp)
91+
rescue EOFError => e
92+
{}
93+
end
9094
end
9195

9296
def close_ios

lib/msf/core/modules/external/shim.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
class Msf::Modules::External::Shim
66
def self.generate(module_path)
77
mod = Msf::Modules::External::Bridge.new(module_path)
8+
return '' unless mod.meta
89
case mod.meta['type']
910
when 'remote_exploit.cmd_stager.wget'
1011
s = remote_exploit_cmd_stager(mod)

0 commit comments

Comments
 (0)