4
任何人都知道爲什麼我得到這個錯誤?Python XMLRPC Nessus錯誤
我使用http://code.google.com/p/nessusxmlrpc/wiki/HowTo
[email protected]:~/NessusXMLRPC-0.21# python newnessusscan.py
Traceback (most recent call last):
File "newnessusscan.py", line 6, in <module>
scan = x.quickScan("MyXMLTestSCan", "192.168.1.100", "Internal Network Scan")
File "/root/NessusXMLRPC-0.21/NessusXMLRPC.py", line 280, in quickScan
if type(policies['policy']) is dict:
TypeError: list indices must be integers, not str
我想傳遞一個整數藏漢但沒有這樣的運氣。
附件是從由具有該問題的實際模塊的代碼:
if type(policies['policy']) is dict:
# There appears to be only one configured policy
policy = policies['policy']
if policy['policyName'] == policy_name:
policy_id = policy['policyID']
包括的是對newnessusscan.py的引擎收錄的鏈接: http://pastebin.com/Bd2Zsw49
謝謝,phihag爲你的真棒python技能,並花時間來修復這個bug。 – 2012-01-04 21:50:21