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:in
rpc_create'",
"lib/msf/core/rpc/v10/service.rb:152:in block in process'",
"lib/ruby/1.9.1/timeout.rb:68:in
timeout'",
"lib/msf/core/rpc/v10/service.rb:152:in process'",
"lib/msf/core/rpc/v10/service.rb:90:in
on_request_uri'",
"lib/msf/core/rpc/v10/service.rb:72:in block in start'",
"lib/rex/proto/http/handler/proc.rb:38:in
call'",
"lib/rex/proto/http/handler/proc.rb:38:in on_request'",
"lib/rex/proto/http/server.rb:365:in
dispatch_request'",
"lib/rex/proto/http/server.rb:299:in on_client_data'",
"lib/rex/proto/http/server.rb:158:in
block in start'",
"lib/rex/io/stream_server.rb:48:in call'",
"lib/rex/io/stream_server.rb:48:in
on_client_data'",
"lib/rex/io/stream_server.rb:192:in block in monitor_clients'",
"lib/rex/io/stream_server.rb:190:in
each'",
"lib/rex/io/stream_server.rb:190:in monitor_clients'",
"lib/rex/io/stream_server.rb:73:in
block in start'",
"lib/rex/thread_factory.rb:22:in call'",
"lib/rex/thread_factory.rb:22:in
block in spawn'",
"lib/msf/core/thread_manager.rb:100:in call'",
"lib/msf/core/thread_manager.rb:100:in
block 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
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:in
rpc_create'", "lib/msf/core/rpc/v10/service.rb:152:inblock in process'", "lib/ruby/1.9.1/timeout.rb:68:in
timeout'", "lib/msf/core/rpc/v10/service.rb:152:inprocess'", "lib/msf/core/rpc/v10/service.rb:90:in
on_request_uri'", "lib/msf/core/rpc/v10/service.rb:72:inblock in start'", "lib/rex/proto/http/handler/proc.rb:38:in
call'", "lib/rex/proto/http/handler/proc.rb:38:inon_request'", "lib/rex/proto/http/server.rb:365:in
dispatch_request'", "lib/rex/proto/http/server.rb:299:inon_client_data'", "lib/rex/proto/http/server.rb:158:in
block in start'", "lib/rex/io/stream_server.rb:48:incall'", "lib/rex/io/stream_server.rb:48:in
on_client_data'", "lib/rex/io/stream_server.rb:192:inblock in monitor_clients'", "lib/rex/io/stream_server.rb:190:in
each'", "lib/rex/io/stream_server.rb:190:inmonitor_clients'", "lib/rex/io/stream_server.rb:73:in
block in start'", "lib/rex/thread_factory.rb:22:incall'", "lib/rex/thread_factory.rb:22:in
block in spawn'", "lib/msf/core/thread_manager.rb:100:incall'", "lib/msf/core/thread_manager.rb:100:in
block 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