我想使用python客户端创建一个Nessus Security Scanner并通过getStatus检查状态并通过getReport方法获取结果。虽然,我读过这些帮助通过PHP(SoftLayer API Nessus Scan Status/Report via PHP)。但是,我怎么可以通过Python客户端使用这些? 当我打电话的setInitParameter(SCAN_ID)的蟒蛇,异常的流: SoftLayerAPIError(客户端):功能(“setInitParameter”),是不是这个服务SoftLayer API Nessus扫描状态/通过python报告
0
A
回答
0
我建议你阅读客户端的文档的有效方法第一:
https://github.com/softlayer/softlayer-python https://softlayer-api-python-client.readthedocs.io/en/latest/
初始化参数被设定如下:
clientService.getObject(id=myInitParameter)
在这里你可以找到更多的例子使用客户端:
https://softlayer.github.io/python/
在这里你可以找到更多的文档:
http://sldn.softlayer.com/blog
而且renember与不像PHP客户端的数据SoftLayer的Python客户端正在发送json格式的请求:
$client = SoftLayer_SoapClient::getClient('SoftLayer_Account', null, $apiUsername, $apiKey);
$accountInfo = $client->getObject();
$hardware = $client->getHardware();
foreach ($hardware as $server){
$scanclient = SoftLayer_SoapClient::getClient('SoftLayer_Network_Security_Scanner_Request', '', $apiUsername, $apiKey)
$scantemplate = new stdClass();
$scantemplate->accountId = $accountInfo->id;
$scantemplate->hardwareId = $server->id;
$scantemplate->ipAddress = $server->primaryIpAddress;
try{
// Successfully creates new scan
$scan = $scanclient->createObject($scantemplate);
} catch (Exception $e){
echo $e->getMessage() . "\n\r";
}
会是l ike this:
clientAccount = client['SoftLayer_Account']
accountInfo = clientAccount.getObject() #for this case we do not need init parameter
hardware = clientAccount.getHardware() #for this case we do not need init parameter
for server in hardware:
scanclient = client['SoftLayer_Network_Security_Scanner_Request']
scantemplate = {
"accountId": accountInfo["id"],
"hardwareId": server["id"],
"ipAddress": server["primaryIpAddress"]
}
scanclient.createObject(scantemplate)
相关问题
- 1. 转换HTML字符串来报告Nessus的安全扫描
- 2. c#通过rdp扫描api
- 3. 基于证书的nessus扫描说明?
- 4. SoftLayer漏洞扫描蟒
- 5. 通过RESTful API报告服务状态时使用什么HTTP状态码?
- 6. 避免通过Veracode的静态扫描扫描第三方库
- 7. 通过帧扫描
- 8. 如何通过nessus API提交目标?
- 9. SoftLayer漏洞扫描 - 奇怪的异常
- 10. Windows传真和扫描报告
- 11. golang反映sql扫描报告错误
- 12. 内部漏洞扫描报告
- 13. Softlayer API - 列出Evault Backup状态
- 14. (Softlayer API)如何获得softlayer的NAS存储卷状态?
- 15. 扫描通过JSON技术
- 16. 通过jTextArea扫描单词
- 17. Nessus API客户端提取扫描的开始和结束时间 - Ruby脚本
- 18. 硒IDE是否支持通过和失败状态报告?
- 19. Nessus XML-RPC API
- 20. SQL事务报告/状态
- 21. 避免tomcat状态报告
- 22. Nessus没有主机数据可用于此扫描错误
- 23. Nessus扫描仪返回Cleartext凭证漏洞
- 24. 通过API获取活动报告
- 25. 通过API安排非抽样报告
- 26. Python,URL扫描
- 27. Python hcitool扫描
- 28. Python:扫描raw_input
- 29. 如何通过斑马线扫描意向请扫描图像?
- 30. 如何通过扫描码(非虚拟键码)获取关键状态?
AHA,我可以通过导引设置参数id = scan_id来设置id为getStatus或getReport方法。 –
client ['SoftLayer_Network_Security_Scanner_Request']。getStatus(id = 15326); #漏洞扫描的ID –