RuntimeError can't add a new key into hash during iteration #727

Closed
sempervictus opened this Issue Aug 24, 2012 · 2 comments

3 participants

@sempervictus

When selecting a payload the framework will occasionally throw an error about inserting a new key into a hash during iteration. To reproduce, edit a module within the framework a few times, and pry the edited module for good measure.

This error makes running any exploits impossible without a framework restart as payloads cannot be set or tab completed

Example output when trying to tab complete a payload in a module:
set PAYLOAD wi[-] RbReadline Error: RuntimeError can't add a new key into hash during iteration

/opt/metasploit4/msf4/lib/msf/core/payload_set.rb:308:in []='
/opt/metasploit4/msf4/lib/msf/core/payload_set.rb:308:in
add_single'
/opt/metasploit4/msf4/lib/msf/core/payload_set.rb:105:in block in recalculate'
/opt/metasploit4/msf4/lib/msf/core/payload_set.rb:94:in
each_pair'
/opt/metasploit4/msf4/lib/msf/core/payload_set.rb:94:in recalculate'
/opt/metasploit4/msf4/lib/msf/core/module_manager.rb:84:in
create'
/opt/metasploit4/msf4/lib/msf/core/module_manager.rb:195:in block in demand_load_modules'
/opt/metasploit4/msf4/lib/msf/core/module_manager.rb:191:in
each_pair'
/opt/metasploit4/msf4/lib/msf/core/module_manager.rb:191:in demand_load_modules'
/opt/metasploit4/msf4/lib/msf/core/module_manager.rb:128:in
each_module'
/opt/metasploit4/msf4/lib/msf/core/exploit.rb:805:in compatible_payloads'
/opt/metasploit4/msf4/lib/msf/ui/console/command_dispatcher/core.rb:2513:in
option_values_payloads'
/opt/metasploit4/msf4/lib/msf/ui/console/command_dispatcher/core.rb:2404:in tab_complete_option'
/opt/metasploit4/msf4/lib/msf/ui/console/command_dispatcher/core.rb:1858:in
cmd_set_tabs'
/opt/metasploit4/msf4/lib/rex/ui/text/dispatcher_shell.rb:350:in tab_complete_helper'
/opt/metasploit4/msf4/lib/rex/ui/text/dispatcher_shell.rb:310:in
block in tab_complete_stub'
/opt/metasploit4/msf4/lib/rex/ui/text/dispatcher_shell.rb:299:in each'
/opt/metasploit4/msf4/lib/rex/ui/text/dispatcher_shell.rb:299:in
tab_complete_stub'
/opt/metasploit4/msf4/lib/rex/ui/text/dispatcher_shell.rb:284:in tab_complete'
/opt/metasploit4/msf4/lib/rex/ui/text/shell.rb:59:in
block in init_tab_complete'
/opt/metasploit4/msf4/lib/readline_compatible.rb:157:in call'
/opt/metasploit4/msf4/lib/readline_compatible.rb:157:in
readline_attempted_completion_function'
/opt/metasploit4/msf4/lib/rbreadline.rb:6262:in gen_completion_matches'
/opt/metasploit4/msf4/lib/rbreadline.rb:6747:in
rl_complete_internal'
/opt/metasploit4/msf4/lib/rbreadline.rb:6837:in rl_complete'
/opt/metasploit4/msf4/lib/rbreadline.rb:4307:in
_rl_dispatch_subseq'
/opt/metasploit4/msf4/lib/rbreadline.rb:4296:in _rl_dispatch'
/opt/metasploit4/msf4/lib/rbreadline.rb:4716:in
readline_internal_charloop'
/opt/metasploit4/msf4/lib/rbreadline.rb:4790:in readline_internal'
/opt/metasploit4/msf4/lib/rbreadline.rb:4812:in
readline'
/opt/metasploit4/msf4/lib/readline_compatible.rb:77:in readline'
/opt/metasploit4/msf4/lib/rex/ui/text/input/readline.rb:90:in
pgets'
/opt/metasploit4/msf4/lib/rex/ui/text/shell.rb:184:in run'
/opt/metasploit4/msf4/msfconsole:143:in

'

@SPYSHARKSecurity

I have this issue also

@todb-r7

This is being worked on Redmine http://dev.metasploit.com/redmine/issues/7037

@todb-r7 todb-r7 closed this Nov 17, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment