Python-msfrpc,怎么了

Python-msfrpc, whats is wrong

def pwn_run():
    client = msfrpc.Msfrpc({})
    client.login('msf','abc123')
    try:
            res = client.call('console.create')
            console_id = res['id']
    except:
        print "Console create failed\r\n"
        sys.exit()
    con_job_DUMP=client.call('console.read', [console_id])

    print console_id;

总是返回:

Console create failed

and res ={'error_backtrace': ("lib/msf/core/rpc/v10/rpc_console.rb:15:inrpc_create'", "lib/msf/core/rpc/v10/service.rb:152:in block in process'", "lib/ruby/1.9.1/timeout.rb:68:intimeout'", "lib/msf/core/rpc/v10/service.rb:152:in process'", "lib/msf/core/rpc/v10/service.rb:90:inon_request_uri'", "lib/msf/core/rpc/v10/service.rb:72:in block in start'", "lib/rex/proto/http/handler/proc.rb:38:incall'", "lib/rex/proto/http/handler/proc.rb:38:in on_request'", "lib/rex/proto/http/server.rb:365:indispatch_request'", "lib/rex/proto/http/server.rb:299:in on_client_data'", "lib/rex/proto/http/server.rb:158:inblock in start'", "lib/rex/io/stream_server.rb:48:in call'", "lib/rex/io/stream_server.rb:48:inon_client_data'", "lib/rex/io/stream_server.rb:192:in block in monitor_clients'", "lib/rex/io/stream_server.rb:190:ineach'", "lib/rex/io/stream_server.rb:190:in monitor_clients'", "lib/rex/io/stream_server.rb:73:inblock in start'", "lib/rex/thread_factory.rb:22:in call'", "lib/rex/thread_factory.rb:22:inblock in spawn'", "lib/msf/core/thread_manager.rb:100:in call'", "lib/msf/core/thread_manager.rb:100:inblock in spawn'"), 'error_message': 'wrong number of arguments (2 for 1)', 'error_class': 'ArgumentError', 'error_string': 'wrong number of arguments (2 for 1)', 'error': True}`

代码有什么问题?

我遇到了类似的问题!我试过制作几个虚拟控制台,但显然出于某种原因你做不到!

您可能打开了多个会话。尝试只打开一个。还要记住:

msfconsole

msfrpc load Pass=<password>

另一个window