Python-msfrpc,什么是错的

时间:2015-01-07 00:14:50

标签: python

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;

总是回归:

  

控制台创建失败

     

和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:在on_client_data'", "lib/rex/proto/http/server.rb:158:in块中开始'”,   “lib / rex / io / stream_server.rb:48:在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:在monitor_clients'", "lib/rex/io/stream_server.rb:73:in块中开始'”,   “lib / rex / thread_factory.rb:22:在spawn'中的call'", "lib/rex/thread_factory.rb:22:in块中”,   “lib / msf / core / thread_manager.rb:100:在spawn'中的call'", "lib/msf/core/thread_manager.rb:100:in块中”,   'error_message':'错误的参数个数(2个为1)','error_class':   'ArgumentError','error_string':'错误的参数个数(2个用于   1)','错误':真实}`

代码有什么问题?

1 个答案:

答案 0 :(得分:0)

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

您可能打开了几个会话。试着打开一个。还记得:

  

msfconsole

     

msfrpc load Pass=<password>

在另一个窗口中